API reference#

This page gives an overview of all public classes and functions within the pysecs package.

SECS Class

The primary class to set up a Spherical Elementary Current System is the SECS class.

SECS([sec_df_loc, sec_cf_loc])

Spherical Elementary Current System (SECS).

SECS Methods

The fit() and predict() methods can be called on the created system to fit to data and then predict at any other location.

SECS.fit(obs_loc, obs_B[, obs_std, epsilon])

Fits the SECS to the given observations.

SECS.fit_unit_currents()

Set all SECs to a unit current amplitude.

SECS.predict(pred_loc[, J])

Calculate the predicted magnetic field or currents.

SECS.predict_B(pred_loc)

Calculate the predicted magnetic fields.

SECS.predict_J(pred_loc)

Calculate the predicted currents.

SECS.has_df

Whether this system has any divergence free currents.

SECS.has_cf

Whether this system has any curl free currents.

SECS.nsec

The number of elementary currents in this system.

Additional functions

The helper functions create the geometrical transforms going from a pole to observation point are described below.

T_df(obs_loc, sec_loc)

Calculate the divergence free magnetic field transfer function.

T_cf(obs_loc, sec_loc)

Calculate the curl free magnetic field transfer function.

J_df(obs_loc, sec_loc)

Calculate the divergence free current density transfer function.

J_cf(obs_loc, sec_loc)

Calculate the curl free magnetic field transfer function.

calc_angular_distance(latlon1, latlon2)

Calculate the angular distance between a set of points.

calc_bearing(latlon1, latlon2)

Calculate the bearing (direction) between a set of points.