# 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

 bc B on the centres of the cell faces. bg B as a (weighted) averaged on grid points. bunit Unit of the input map data. coordinate_frame The coordinate frame that the PFSS solution is in. dtime source_surface_br Br on the source surface. source_surface_pils Coordinates of the polarity inversion lines on the source surface.

Methods Summary

 get_bvec(coords[, out_type]) Evaluate magnetic vectors in pfss model. save(file) Save the output to file. trace(tracer, seeds) param tracer Field line tracer.

Attributes Documentation

bc

B on the centres of the cell faces.

Returns

• br

• btheta

• bphi

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

numpy.ndarray

bunit

Unit of the input map data.

coordinate_frame

The coordinate frame that the PFSS solution is in.

Notes

This is either a HeliographicCarrington or HeliographicStonyhurst frame, depending on the input map.

dtime
source_surface_br

Br on the source surface.

Returns

Return type

sunpy.map.GenericMap

source_surface_pils

Coordinates of the polarity inversion lines on the source surface.

Notes

This is always returned as a list of coordinates, as in general there may be more than one polarity inversion line.

Methods Documentation

get_bvec(coords, out_type='spherical')

Evaluate magnetic vectors in pfss model.

Method which takes an arbitrary astropy SkyCoord and returns a numpy array containing magnetic field vectors evaluated from the parent pfsspy.Output pfss model at the locations specified by the SkyCoords

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 – Magnetic field vectors at the requested locations ndarray.shape = (N,3), units nT)

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)
Parameters