calculate_K

rbinvariantslib.invariants.calculate_K(model: MagneticFieldModel, starting_point, mirror_latitude=None, Bm=None, pitch_angle=None, step_size=None, reuse_trace=None) CalculateKResult

Calculate the third adiabatic invariant, K.

Either mirror_latitude, Bm, or pitch_angle must be specified.

Parameters:
modelMagneticFieldModel

Grid and magnetic field, loaded using models module

starting_pointtuple of floats

Starting point of the field line trace, as (x, y, z) tuple of floats, in units of Re.

mirror_latitudefloat, optional

Magnetic latitude in degrees to use for the mirroring point, to specify bounce path

Bmfloat, optional

Magnetic field strength at mirroring point, to specify bounce path

pitch_anglefloat, optional

Local pitch angle at starting point, to specify the bounce path. In units of degrees

step_size ; float, optional

Step size to use with the field line trace

Returns:
resultCalculateKResult

Calcualte K variable and related bounce path information

Raises:
FieldLineTraceInsufficient

field line trace empty or too small