swarmpal.toolboxes.fac.fac_algorithms#

Tools to evaluate FACs using the single-satellite method

Given input containing magnetic field measurements and model predictions, compute the FACs

Adapted from code by Ask Neve Gamby (Swarm-DISC/SwarmPyFAC). For information about the algorithm, see https://doi.org/10.5047/eps.2013.09.006

Attributes#

Functions#

_means(x)

_spherical_delta(p)

Compute the change of spherical positions as an NEC vector

_NEC_to_VSC(v)

Construct a function which transforms vectors from NEC to VSC frame

_radial_current(dB, v, dt)

Calculate radial currents from magnetic residuals and spacecraft velocity

_interpolate_data(t_source, t_target)

Interpolate data from original sampling on t_source to new sampling on t_target

_inclination(v)

fac_single_sat_algo([time, positions, B_res, B_model, ...])

Compute field-aligned current (FAC) from numpy arrays

Module Contents#

swarmpal.toolboxes.fac.fac_algorithms.logger#
swarmpal.toolboxes.fac.fac_algorithms.MU_0#
swarmpal.toolboxes.fac.fac_algorithms._means(x)[source]#
swarmpal.toolboxes.fac.fac_algorithms._spherical_delta(p)[source]#

Compute the change of spherical positions as an NEC vector

swarmpal.toolboxes.fac.fac_algorithms._NEC_to_VSC(v)[source]#

Construct a function which transforms vectors from NEC to VSC frame

swarmpal.toolboxes.fac.fac_algorithms._radial_current(dB, v, dt)[source]#

Calculate radial currents from magnetic residuals and spacecraft velocity

swarmpal.toolboxes.fac.fac_algorithms._interpolate_data(t_source, t_target)[source]#

Interpolate data from original sampling on t_source to new sampling on t_target

swarmpal.toolboxes.fac.fac_algorithms._inclination(v)[source]#
swarmpal.toolboxes.fac.fac_algorithms.fac_single_sat_algo(time=None, positions=None, B_res=None, B_model=None, inclination_limit=30.0, time_jump_limit=1)[source]#

Compute field-aligned current (FAC) from numpy arrays

Parameters:
  • time (array_like) – Array of datetime64[ns]

  • positions (array_like) – Nx3 array of positions (Latitude, Longitude, Radius) in units of (degrees, degrees, metres)

  • B_res (array_like) – Nx3 array of magnetic field residuals in nanoTesla

  • B_model (array_like) – Nx3 array of magnetic field model predictions in nanoTesla

  • inclination_limit (float, optional) – Limit of inclination for FAC validity

  • time_jump_limit (int, optional) – Maximum allowable time step in data for FAC validity

Returns:

{“time”: array_like, “fac”: array_like, “irc”: array_like} FAC (field-aligned current) and IRC (radial current) estimates

Return type:

dict