Igrf
Defined in: mod.rs:28
pub struct IgrfIGRF (International Geomagnetic Reference Field) model.
Evaluates the geomagnetic field using spherical harmonic expansion.
By default uses built-in IGRF-14 Gauss coefficients (2020 DGRF + 2025 IGRF + SV).
Custom coefficients can be injected at runtime via Igrf::from_coefficients.
Methods
Section titled “Methods”earth()
Section titled “earth()”fn earth() -> Self
Create an IGRF model with built-in IGRF-14 coefficients (degree 13).
with_max_degree()
Section titled “with_max_degree()”fn with_max_degree(max_degree: usize) -> Self
Create an IGRF model truncated to the given maximum degree.
Lower degrees are faster but less accurate. Degree 1 gives a dipole.
Panics
Section titled “Panics”Panics if max_degree is 0 or exceeds IGRF_MAX_DEGREE.
from_coefficients()
Section titled “from_coefficients()”fn from_coefficients(epoch_a: GaussCoefficients, epoch_b: GaussCoefficients, sv: GaussCoefficients, max_degree: usize) -> Self
Create an IGRF model with custom coefficient data injected at runtime.
This allows using coefficient sets from different IGRF generations, or coefficients downloaded/parsed externally.
epoch_a and epoch_b define the two bracketing epochs for interpolation.
sv contains the secular variation for extrapolation beyond epoch_b.