pub struct MagneticModel { /* private fields */ }Expand description
A spherical-harmonic model of the main field: Gauss coefficients at an epoch and their linear secular variation, to degree 12.
Implementations§
Source§impl MagneticModel
impl MagneticModel
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
The model’s name, as its coefficient file’s header gives it.
Sourcepub fn epoch_year(&self) -> f64
pub fn epoch_year(&self) -> f64
The epoch t₀ of the main-field coefficients, decimal year.
Sourcepub fn valid_until_year(&self) -> f64
pub fn valid_until_year(&self) -> f64
The end of the model’s validity, decimal year.
Sourcepub fn field(
&self,
point: Geodetic,
decimal_year: f64,
) -> Result<MagneticField, CoreError>
pub fn field( &self, point: Geodetic, decimal_year: f64, ) -> Result<MagneticField, CoreError>
The magnetic elements at point (geodetic, on WGS 84, height above the ellipsoid) at time
decimal_year (report, section 1.2, equations 7 to 20).
The geocentric components are
X′ = −Σₙ (a/r)ⁿ⁺² Σₘ (gₙᵐ cos mλ + hₙᵐ sin mλ) dP̆ₙᵐ(sin φ′)/dφ′
Y′ = (1/cos φ′) Σₙ (a/r)ⁿ⁺² Σₘ m (gₙᵐ sin mλ − hₙᵐ cos mλ) P̆ₙᵐ(sin φ′)
Z′ = −Σₙ (n + 1)(a/r)ⁿ⁺² Σₘ (gₙᵐ cos mλ + hₙᵐ sin mλ) P̆ₙᵐ(sin φ′)turned by φ′ − φ into the geodetic frame: X = X′ cos(φ′ − φ) − Z′ sin(φ′ − φ),
Y = Y′, Z = X′ sin(φ′ − φ) + Z′ cos(φ′ − φ). The rates are the same sums over ġ and
ḣ.
At a pole the north and east directions follow the given longitude’s meridian, as the report’s section 1.4 sets them.
§Errors
CoreError::Domain if point fails Geodetic::validated, if decimal_year is outside
the model’s validity ([2025.0, 2030.0] for WMM2025) or not finite, or if the height is
outside MIN_HEIGHT_M to MAX_HEIGHT_M.
Trait Implementations§
Source§impl Clone for MagneticModel
impl Clone for MagneticModel
Source§fn clone(&self) -> MagneticModel
fn clone(&self) -> MagneticModel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MagneticModel
Source§impl Debug for MagneticModel
impl Debug for MagneticModel
Source§impl PartialEq for MagneticModel
impl PartialEq for MagneticModel
Source§fn eq(&self, other: &MagneticModel) -> bool
fn eq(&self, other: &MagneticModel) -> bool
self and other values to be equal, and is used by ==.