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.

gridGrid

Grid that the output was caclulated on.

dtimedatetime, 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, tracer, seeds)

Parameters

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
array

A (nphi, ns, nrho, 3) shaped array. The last index gives the corodinate axis, 0 for Bphi, 1 for Bs, 2 for Brho.

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
axAxes

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
axAxes

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
filestr, file, Path

File to save to. If .npz extension isn’t present it is added when saving the file.

trace(self, tracer, seeds)
Parameters
tracertracing.Tracer
seeds(n, 3) shaped array

Starting coordinates, in cartesian coordinates. pfsspy.coords can be used to convert from spherical coordinates to cartesian coordinates and vice versa.