ADCS.environment.magnetic_field package¶
Submodules¶
Module contents¶
Selectable geomagnetic field model.
Every field evaluation in the package goes through field_gc(), which
dispatches on a model name so that the implementation can be chosen per
orbit – the magnetic counterpart of zonal_J for gravity:
"igrf_numba"(default)The in-tree numba kernel,
ADCS.environment.magnetic_field.igrf14_numba.igrf_gc()."igrf_ppigrf"The
ppigrfpackage, which was the field model up to 0.1.8. Kept so that older results can be reproduced exactly. It is an optional dependency (pip install "Generalized_ADCS[ppigrf]") and is imported only when selected."wmm2025"and"chaos8"WMM2025 and the internal core plus lithospheric CHAOS-8.7 field.
- ADCS.environment.magnetic_field.field_gc(magnetic_model, r, theta, phi, date)[source]¶
Geomagnetic field in geocentric spherical components, from a chosen model.
- Parameters:
magnetic_model (str) – One of
MAGNETIC_MODELS.r (float or numpy.ndarray) – Geocentric radius [km].
theta (float or numpy.ndarray) – Geocentric colatitude [deg].
phi (float or numpy.ndarray) – Geocentric longitude [deg], positive east.
date (datetime.datetime or sequence) – One date, or one date per sample (paired elementwise).
- Returns:
(Br, Btheta, Bphi)in nT, each with the broadcast shape of the coordinates.- Return type:
tuple
- Raises:
ValueError – If
magnetic_modelis unknown.ImportError – If
"igrf_ppigrf"is requested and ppigrf is not installed.
- Example:
>>> from datetime import datetime >>> br, bt, bp = field_gc("igrf_numba", 6771.2, 45.0, 10.0, datetime(2024, 3, 1))
- ADCS.environment.magnetic_field.make_magnetic_field(name=None)[source]¶
Create the concrete model selected by a legacy name.
- Parameters:
name (str or None) – Canonical or accepted alias for a magnetic model.
- Returns:
New concrete magnetic field model instance.
- Return type:
- Raises:
ValueError – If the model name is unknown.
- ADCS.environment.magnetic_field.DEFAULT_MAGNETIC_MODEL = 'igrf_numba'¶
Model used when none is requested.
- ADCS.environment.magnetic_field.MAGNETIC_MODELS = ('igrf_numba', 'igrf_ppigrf', 'wmm2025', 'chaos8')¶
Names accepted by
magnetic_modelarguments throughout the package.