Output

class pfsspy.Output(alr, als, alp, grid)

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.

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([ax]) Plot the polarity inversion line on the source surface.
plot_source_surface([ax]) Plot a 2D image of the magnetic field at the source surface.
save(file) Save the output to file.
trace(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(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(ax=None)

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.

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(x0, atol=0.0001, rtol=0.0001)

Traces a field-line from x0.

Uses scipy.integrate.solve_ivp, with an LSODA method.

Parameters:
x0 : array

Starting coordinate, in cartesian coordinates.

dtf : float, optional

Absolute tolerance of the tracing.

rtol : float, optional

Relative tolerance of the tracing.

Returns:
fl : FieldLine