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.
Date and time 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.
trace
(tracer, seeds)Trace magnetic field lines.
Attributes Documentation
- bc¶
B on the centres of the cell faces.
- Returns:
br (astropy.units.Quantity) – A
nphi, ns, nrho + 1
shaped Quantity.btheta (astropy.units.Quantity) – A
nphi, ns + 1, nrho
shaped Quantity.bphi (astropy.units.Quantity) – A
nphi + 1, ns, nrho
shaped Quantity.
Notes
The three components are not co-located at the same locations. Component
n
is located on cell faces of constantn
, e.g. ther
component is located on the cell faces at constantr
values.
- bg¶
B as a (weighted) averaged on grid points.
- Returns:
A
(nphi + 1, ns + 1, nrho + 1, 3)
shaped Quantity. The last index gives the corodinate axis, 0 for Bphi, 1 for Bs, 2 for Brho. Because the phi dimension is periodic,bg[0, :, :] == bg[-1, :, :]
.- Return type:
- coordinate_frame¶
Coordinate frame of the input map.
Notes
This is either a
HeliographicCarrington
orHeliographicStonyhurst
frame, depending on the input map.
- dtime¶
Date and time of the input map.
- source_surface_br¶
Radial magnetic field component on the source surface.
- 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.coordinates.SkyCoord
) – An arbitary point or set of points (length N >= 1) in the PFSS model domain (1Rs < r < Rss).out_type (str) – 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 Quantity of magnetic field vectors.
- Return type:
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)
- trace(tracer, seeds)¶
Trace magnetic field lines.
- Parameters:
tracer (tracing.Tracer) – Field line tracer.
seeds (astropy.coordinates.SkyCoord) – Starting coordinates.