Skip to content

IGRF-14

International Geomagnetic Reference Field (14th generation). Computes Earth's magnetic field using spherical harmonic coefficients to degree 13, covering 1900 to 2030.

Note

For usage guidance and examples, see Magnetic Field Models in the Learn section.

Geodetic ENZ Output

igrf_geodetic_enz builtin

igrf_geodetic_enz(epc: Epoch, x_geod: ndarray, angle_format: AngleFormat) -> ndarray

Compute IGRF-14 magnetic field in the geodetic ENZ frame.

The geodetic ENZ frame has zenith perpendicular to the WGS84 ellipsoid surface.

Parameters:

Name Type Description Default
epc Epoch

Epoch of computation

required
x_geod ndarray

Geodetic position [longitude, latitude, altitude_m]. Angle units controlled by angle_format. Altitude always in meters.

required
angle_format AngleFormat

Whether longitude/latitude are in degrees or radians

required

Returns:

Type Description
ndarray

numpy.ndarray: Magnetic field [B_east, B_north, B_zenith] in nT

Example
1
2
3
4
5
6
7
import brahe as bh
import numpy as np

epc = bh.Epoch.from_date(2025, 1, 1, bh.TimeSystem.UTC)
x_geod = np.array([0.0, 80.0, 0.0])  # lon=0, lat=80 deg, alt=0 m
b = bh.igrf_geodetic_enz(epc, x_geod, bh.AngleFormat.DEGREES)
print(f"B_east={b[0]:.1f}, B_north={b[1]:.1f}, B_zenith={b[2]:.1f} nT")

Geocentric ENZ Output

igrf_geocentric_enz builtin

igrf_geocentric_enz(epc: Epoch, x_geod: ndarray, angle_format: AngleFormat) -> ndarray

Compute IGRF-14 magnetic field in the geocentric ENZ frame.

The geocentric ENZ frame has zenith along the geocentric radial direction.

Parameters:

Name Type Description Default
epc Epoch

Epoch of computation

required
x_geod ndarray

Geodetic position [longitude, latitude, altitude_m]. Angle units controlled by angle_format. Altitude always in meters.

required
angle_format AngleFormat

Whether longitude/latitude are in degrees or radians

required

Returns:

Type Description
ndarray

numpy.ndarray: Magnetic field [B_east, B_north, B_zenith] in nT

Example
1
2
3
4
5
6
import brahe as bh
import numpy as np

epc = bh.Epoch.from_date(2025, 1, 1, bh.TimeSystem.UTC)
x_geod = np.array([0.0, 80.0, 0.0])
b = bh.igrf_geocentric_enz(epc, x_geod, bh.AngleFormat.DEGREES)

ECEF Output

igrf_ecef builtin

igrf_ecef(epc: Epoch, x_geod: ndarray, angle_format: AngleFormat) -> ndarray

Compute IGRF-14 magnetic field in the ECEF frame.

Parameters:

Name Type Description Default
epc Epoch

Epoch of computation

required
x_geod ndarray

Geodetic position [longitude, latitude, altitude_m]. Angle units controlled by angle_format. Altitude always in meters.

required
angle_format AngleFormat

Whether longitude/latitude are in degrees or radians

required

Returns:

Type Description
ndarray

numpy.ndarray: Magnetic field [B_x, B_y, B_z] in ECEF frame, in nT

Example
1
2
3
4
5
6
import brahe as bh
import numpy as np

epc = bh.Epoch.from_date(2025, 1, 1, bh.TimeSystem.UTC)
x_geod = np.array([0.0, 80.0, 0.0])
b = bh.igrf_ecef(epc, x_geod, bh.AngleFormat.DEGREES)

See Also