Output¶
-
class
pfsspy.
Output
(alr, als, alp, grid, input_map=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.
input_map (sunpy.map.GenericMap) – The input map.
Notes
Instances of this class are intended to be created by
pfsspy.pfss
, and not by users.Attributes Summary
B on the centres of the cell faces.
B as a (weighted) averaged on grid points.
Unit
of the input map data.Coordinate frame of the input map.
Radial magnetic field component on the source surface.
Coordinates of the polarity inversion lines on the source surface.
Methods Summary
get_bvec
(coords[, out_type])Interpolate magnetic vectors at arbitrary coordinates.
save
(file)Save the output to file.
trace
(tracer, seeds)Trace magnetic field lines.
Attributes Documentation
-
bc
¶ B on the centres of the cell faces.
- Returns
br (numpy.ndarray)
btheta (numpy.ndarray)
bphi (numpy.ndarray)
-
bg
¶ B as a (weighted) averaged on grid points.
- Returns
A
(nphi + 1, ns + 1, nrho + 1, 3)
shaped array. The last index gives the corodinate axis, 0 for Bphi, 1 for Bs, 2 for Brho.- Return type
-
coordinate_frame
¶ Coordinate frame of the input map.
Notes
This is either a
HeliographicCarrington
orHeliographicStonyhurst
frame, depending on the input map.
-
dtime
¶
-
source_surface_br
¶ Radial magnetic field component on the source surface.
- Returns
- Return type
-
source_surface_pils
¶ Coordinates of the polarity inversion lines on the source surface.
Notes
This is always returned as a list of
SkyCoord
, as in general there may be more than one polarity inversion line.
Methods Documentation
-
get_bvec
(coords, out_type='spherical')¶ Interpolate magnetic vectors at arbitrary coordinates.
- Parameters
coords (
astropy.SkyCoord
) – An arbitary point or set of points (length N >= 1) in the PFSS model domain (1Rs < r < Rss).out_type (str, optional) – Takes values ‘spherical’ (default) or ‘cartesian’ and specifies whether the output vector is in spherical coordinates (B_r, B_theta, B_phi) or cartesian (B_x, B_y, B_z).
- Returns
bvec – (N, 3) shaped array of magnetic field vectors.
- Return type
ndarray
Notes
The output coordinate system is defined by the input magnetogram with x-z plane equivalent to the plane containing the Carrington meridian (0 deg longitude)
The spherical coordinates follow the physics convention: https://upload.wikimedia.org/wikipedia/commons/thumb/4/4f/3D_Spherical.svg/240px-3D_Spherical.svg.png) Therefore the polar angle (theta) is the co-latitude, rather than the latitude, with range 0 (north pole) to 180 degrees (south pole)
The conversion which relates the spherical and cartesian coordinates is as follows:
\[B_R = sin\theta cos\phi B_x + sin\theta sin\phi B_y + cos\theta B_z\]\[B_\theta = cos\theta cos\phi B_x + cos\theta sin\phi B_y - sin\theta B_z\]\[B_\phi = -sin\phi B_x + cos\phi B_y\]The above equations may be written as a (3x3) matrix and inverted to retrieve the inverse transformation (cartesian from spherical)
-
save
(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.
-
trace
(tracer, seeds)¶ Trace magnetic field lines.
- Parameters
tracer (tracing.Tracer) – Field line tracer.
seeds (astropy.coordinates.SkyCoord) – Starting coordinates.