emp.geomagnetic_field

Copyright (C) 2023 by The RAND Corporation See LICENSE and README.md for information on usage and licensing.

This module contains the MagneticField class hierarchy for modeling geomagnetic fields, including dipole and IGRF models.

Classes

CoordinateSystem(value)

Coordinate systems for magnetic field output.

DipoleMagneticField()

Dipole magnetic field model.

IGRFMagneticField([date])

IGRF magnetic field model.

MagneticField()

Abstract base class for magnetic field models.

MagneticFieldFactory()

Factory for creating magnetic field model instances.

MagneticFieldModel(value)

Supported magnetic field models.

class emp.geomagnetic_field.CoordinateSystem(value)[source]

Coordinate systems for magnetic field output.

CARTESIAN_GEO = 'cartesian_geo'
CARTESIAN_MAG = 'cartesian_mag'
LATLONG_MAG = 'latlong_mag'
SPHERICAL_GEO = 'spherical_geo'
class emp.geomagnetic_field.MagneticFieldModel(value)[source]

Supported magnetic field models.

DIPOLE = 'dipole'
IGRF = 'igrf'
class emp.geomagnetic_field.MagneticField[source]

Abstract base class for magnetic field models.

abstractmethod get_field_vector(point, coordinate_system)[source]

Get magnetic field vector in the specified coordinate system.

Return type:

ndarray[Any, dtype[float64]]

get_field_magnitude(point)[source]

Get the magnitude of the magnetic field.

Return type:

float

get_inclination_angle(point)[source]

Get the inclination angle of the magnetic field.

Return type:

float

get_theta_angle(point_burst, point_los)[source]

Get angle between line-of-sight vector and magnetic field.

Return type:

float

class emp.geomagnetic_field.DipoleMagneticField[source]

Dipole magnetic field model.

get_field_vector(point, coordinate_system)[source]

Get magnetic field vector in the specified coordinate system.

Return type:

ndarray[Any, dtype[float64]]

get_inclination_angle(point)[source]

Get inclination angle with dipole-specific validation.

Return type:

float

class emp.geomagnetic_field.IGRFMagneticField(date=None)[source]

IGRF magnetic field model.

__init__(date=None)[source]

Initialize IGRF field with specific date.

Parameters:

date (datetime, optional) – Date for IGRF model evaluation. If None, uses January 1, 2020.

get_field_vector(point, coordinate_system)[source]

Get magnetic field vector in the specified coordinate system.

Return type:

ndarray[Any, dtype[float64]]

get_inclination_angle(point)[source]

Get inclination angle from IGRF field.

Return type:

float

class emp.geomagnetic_field.MagneticFieldFactory[source]

Factory for creating magnetic field model instances.

classmethod create(model, **kwargs)[source]

Create a magnetic field model instance.

Parameters:
  • model (MagneticFieldModel or str) – The magnetic field model type.

  • **kwargs (Any) – Additional arguments passed to model constructor. For IGRF: date (datetime) - date for field evaluation

Returns:

Instance of the requested magnetic field model.

Return type:

MagneticField