spinifex.ionospheric.ionex_parser

Module to parse the IONosphere map EXchange (IONEX) data format, as described in Schaer and Gurtner (1998)

Classes

IonexData

Object containing all necessary information from Ionex data

IonexHeader

Object containing header information from ionex file

Functions

_fill_data_record(→ None)

Helper function to parse a data block of a single map in ionex.

_read_ionex_data(→ IonexData)

This function parses the IONEX file.

_read_ionex_header(→ IonexHeader)

Read header from ionex file. Put filepointer to the end of the header.

_replace_midnight_data(→ IonexData)

mtigate jumps in tec value at midnight by inserting the tec value of the next day

read_ionex(→ IonexData)

Read and parse a ionex file. Returns a ionex object.

unique_days_from_ionex(→ astropy.time.Time)

Get unique days from a ionex object or list of ionex objects.

unique_days_from_ionex_files(→ astropy.time.Time)

Get unique days from a list of ionex files.

Module Contents

class spinifex.ionospheric.ionex_parser.IonexData[source]

Bases: NamedTuple

Object containing all necessary information from Ionex data

dims: int[source]

dimension of the heights (usually 1)

h: numpy.typing.NDArray[numpy.float64][source]

available heights (km)

lats: numpy.typing.NDArray[numpy.float64][source]

array with available latitude values (degrees)

lons: numpy.typing.NDArray[numpy.float64][source]

array with available longitude values (degrees)

rms: numpy.typing.NDArray[numpy.float64][source]

array with rms of tecvalues times x lons x lats (TECU, if available, nan otherwise)

tec: numpy.typing.NDArray[numpy.float64][source]

array with tecvalues times x lons x lats (TECU)

times: astropy.time.Time[source]

available times

class spinifex.ionospheric.ionex_parser.IonexHeader[source]

Bases: NamedTuple

Object containing header information from ionex file

dims: int[source]

dimension of the heights (usually 1)

h: numpy.typing.NDArray[numpy.float64][source]

available heights (km)

lats: numpy.typing.NDArray[numpy.float64][source]

array with available latitude values (degrees)

lons: numpy.typing.NDArray[numpy.float64][source]

array with available longitude values (degrees)

mfactor: float[source]

multiplication factor for tec values

times: astropy.time.Time[source]

available times

spinifex.ionospheric.ionex_parser._fill_data_record(data: numpy.typing.NDArray[numpy.float64], filep: TextIO, stop_label: str, timeidx: int, ionex_header: IonexHeader) None[source]

Helper function to parse a data block of a single map in ionex. Puts filepointer to the end of the map

Parameters

dataNDArray

pre allocated array to store the datablock

filepTextIO

_description_

stop_labelstr

end of the data block indicator

timeidxint

index of time of the data block

ionex_headernamedtuple

header information

spinifex.ionospheric.ionex_parser._read_ionex_data(filep: TextIO, options: spinifex.ionospheric.tec_data.IonexOptions | None = None) IonexData[source]

This function parses the IONEX file. Some fixed structure (like data records being strings of exactly 80 characters) of the file is assumed. This structure is described in Schaer and Gurtner (1998).

Parameters

filepTextIO

pointer to an ionex file

optionsIonexOptions | None, optional

options for ionex model, by default None

Returns

IonexData

ionex object

spinifex.ionospheric.ionex_parser._read_ionex_header(filep: TextIO) IonexHeader[source]

Read header from ionex file. Put filepointer to the end of the header.

spinifex.ionospheric.ionex_parser._replace_midnight_data(ionex: IonexData, next_day_ionex: IonexData) IonexData[source]

mtigate jumps in tec value at midnight by inserting the tec value of the next day

Parameters

ionexIonexData

ionex data object

next_day_ionexIonexData

ionex data of the next day

Returns

IonexData

ionex data object with the data of last timeslot replaced by the data of the next day

spinifex.ionospheric.ionex_parser.read_ionex(ionex_filename: pathlib.Path, next_day_ionex_filename: pathlib.Path | None = None, options: spinifex.ionospheric.tec_data.IonexOptions | None = None) IonexData[source]

Read and parse a ionex file. Returns a ionex object.

Parameters

ionex_filenamestr

name of the ionex data file

next_day_ionex_filenamestr| None

name of the ionex data file for the next day (to remove midnight jumps)

optionsIonexOptions

Options for the ionex model.

Returns

IonexData

ionex object with data and grid

spinifex.ionospheric.ionex_parser.unique_days_from_ionex(ionex_data: IonexData | list[IonexData]) astropy.time.Time[source]

Get unique days from a ionex object or list of ionex objects.

Parameters

ionex_dataIonexData | list[IonexData]

ionex object or list of ionex objects

Returns

Time

unique days

spinifex.ionospheric.ionex_parser.unique_days_from_ionex_files(ionex_files: list[pathlib.Path] | pathlib.Path) astropy.time.Time[source]

Get unique days from a list of ionex files.

Parameters

ionex_fileslist[Path]

list of ionex files

Returns

Time

unique days