geopulse.sources.intermagnet

INTERMAGNET IAGA-2002 loader.

Wraps geopulse.io.iaga2002.read_iaga2002() and standardises the result into a BFieldTimeSeries — nT → T conversion, HDZF frame converted to geographic X (north) / Y (east), and cropped to the requested time window.

Frame conventions

  • XYZF reporting is the easy case: X = geographic north, Y = geographic east, Z = downward, all in nT. Direct mapping to bx_T, by_T, bz_T.

  • HDZF reporting: H = horizontal magnitude (nT), D = declination (minutes of arc in the IAGA convention — most observatories still emit this way; some emit degrees). The declination is the angle from geographic north to the horizontal-field direction, measured positive east. So:

    X = H · cos(D_rad),   Y = H · sin(D_rad).
    

    Pass declination_unit="degrees" if the observatory reports D in degrees (D max magnitude around 20 is a giveaway).

Missing samples (IAGA 99999 / 88888 sentinels) surface as NaN on the returned series; downstream code must filter or interpolate.

Classes

INTERMAGNETSource(file_path[, declination_unit])

Loader for INTERMAGNET IAGA-2002 magnetometer data.

class geopulse.sources.intermagnet.INTERMAGNETSource(file_path, declination_unit='minutes')[source]

Bases: BFieldSource

Loader for INTERMAGNET IAGA-2002 magnetometer data.

Parameters:
  • file_path (str) – Path to the .min / .sec / .iaga file.

  • declination_unit (str) – Interpretation of the D column for HDZF files. Default: "minutes" (IAGA-2002 native). Ignored for XYZF files.

Examples

>>> src = INTERMAGNETSource("OTT_20240510.min")
>>> b = src.load(start_s=0, end_s=86400)
>>> b.bx_T.shape
(1440,)
load(start_s=-inf, end_s=inf, dt_s=1.0, station_id='')[source]

Load and standardise the file.

Parameters:
  • start_s (float) – Time window in UNIX epoch seconds (UTC). Defaults return the full file. Samples outside the window are dropped.

  • end_s (float) – Time window in UNIX epoch seconds (UTC). Defaults return the full file. Samples outside the window are dropped.

  • dt_s (float) – Ignored — the file’s native sampling rate is used. Present for ABC symmetry.

  • station_id (str) – Override for the station identifier. If empty, the file’s IAGA CODE is used.

Return type:

BFieldTimeSeries

Returns:

BFieldTimeSeries – Bx/By/Bz in Tesla, time in UTC epoch seconds.

Raises:

DataError – On unrecognised reporting orientation or empty windowed slice.