Output¶
-
class
pfsspy.
Output
(alr, als, alp, grid, dtime=None)¶ Bases:
object
Output of PFSS modelling.
Parameters: - alr :
Vector potential * grid spacing in radial direction.
- als :
Vector potential * grid spacing in elevation direction.
- alp :
Vector potential * grid spacing in azimuth direction.
- grid : Grid
Grid that the output was caclulated on.
- dtime : datetime, optional
Datetime at which the input was measured.
Attributes Summary
al
Vector potential times cell edge lenghts. bc
B on the centres of the cell faces. bg
B as a (weighted) averaged on grid points. source_surface_br
Br on the source surface. Methods Summary
plot_pil
(self[, ax])Plot the polarity inversion line on the source surface. plot_source_surface
(self[, ax])Plot a 2D image of the magnetic field at the source surface. save
(self, file)Save the output to file. trace
(self, x0[, atol, rtol])Traces a field-line from x0. Attributes Documentation
-
al
¶ Vector potential times cell edge lenghts.
Returns ar*Lr, as*Ls, ap*Lp on cell edges.
-
bc
¶ B on the centres of the cell faces.
-
bg
¶ B as a (weighted) averaged on grid points.
Returns: - br : array
- bs : array
- bp : array
-
source_surface_br
¶ Br on the source surface.
Methods Documentation
-
plot_pil
(self, ax=None, **kwargs)¶ Plot the polarity inversion line on the source surface.
The PIL is where Br = 0.
Parameters: - ax : Axes
Axes to plot to. If
None
, creates a new figure.- **kwargs :
Keyword arguments are handed to ax.contour.
-
plot_source_surface
(self, ax=None, **kwargs)¶ Plot a 2D image of the magnetic field at the source surface.
Parameters: - ax : Axes
Axes to plot to. If
None
, creates a new figure.- kwargs :
Additional keyword arguments are handed to pcolormesh that renders the source surface. A useful option here is handing
rasterized=True
to rasterize the image.
-
save
(self, file)¶ Save the output to file.
This saves the required information to reconstruct an Output object in a compressed binary numpy file (see
numpy.savez_compressed()
for more information). The file extension is.npz
, and is automatically added if not present.Parameters: - file : str, file,
Path
File to save to. If
.npz
extension isn’t present it is added when saving the file.
- file : str, file,
-
trace
(self, x0, atol=0.0001, rtol=0.0001)¶ Traces a field-line from x0. x0 must be a cartesian coordinate. See
pfsspy.coords
for more information on coordinate transforms, and helper functions for transforming between coordinate systems.Uses scipy.integrate.solve_ivp, with an LSODA method.
Parameters: - x0 : array
Starting coordinate, in cartesian coordinates.
pfsspy.coords
can be used to convert from spherical coordinates to cartesian coordinates and vice versa.- dtf : float, optional
Absolute tolerance of the tracing.
- rtol : float, optional
Relative tolerance of the tracing.
Returns: - fl :
FieldLine