Skip to content

[BUG]: Incorrect use of TEC maps in ionospheric delay #19

@alfonsoSR

Description

@alfonsoSR

Describe the issue:

The ensure_resources method of the Ionospheric delay class creates a dictionary with a tuple of time.Time objects as key, and a path to an ionex file as value. The tuple of dates represents the period of time covered by that ionex file. This is the resources dictionary.

The load_resources method goes over the resources and fills two lists: one with the initial epochs of coverage of each ionex file (first element of tuple), and one with grid interpolators for the TEC maps contained in the ionex files. Since each ionex file contains multiple TEC maps (e.g. 13), the length of the list of interpolators will be 13 times that of the list of epochs.

In the following lines of the load_resources method, for each baseline, we:

  1. Calculate latitude and longitude of station at epochs in list produced above
  2. Evaluate the grid interpolators at those latitude-longitude pairs, to get the TEC at the station as function of time
  3. Generate an interpolator of TEC as function of time
            # Station latitude and longitude for each coverage epoch
            coords = coordinates.EarthLocation(
                *baseline.station.location(tec_epochs, frame="itrf").T,
                unit="m",
            ).to_geodetic("GRS80")
            lat: np.ndarray = coords.lat.deg  # type: ignore
            lon: np.ndarray = coords.lon.deg  # type: ignore

            # Get TEC at station coordinates for each epoch in coverage
            tec_at_station_coordinates: list[float] = [
                float(tec_grid_interpolator([lon, lat])[0])
                for tec_grid_interpolator, lon, lat in zip(
                    tec_grid_interpolators, lon, lat
                )
            ]

If we have two ionex files, tec_epochs, lat and lon will have a length of 2, but tec_grid_interpolators will have a length of 26 (assuming 13 maps per ionex file). This means that the second element of tec_at_station_coordinates does not include the TEC for the first map in the second ionex file, as expected, but the second map of the first ionex file. In other words, the implementation assumes that each ionex file contains a single TEC map, which is not the case.

How to reproduce the issue:

VEX file: ec094a.vix
Target: juice
Displacements: All
Delays: All
pride version: 1.2.10

Modify the source code of delays.models.Ionosphere to print the length of the lists above, and notice that they do not match

OS and Python version:

OS and Python version independent

Expected behavior:

The header section of the IONEX files includes three lines specifying the initial epoch, final epoch, and step size for the coverage. The function IonexInterface.read_data_from_ionex_file should retrieve this information, discretize the coverage period accordingly, and then return a dictionary of tec interpolators with their epoch as key, and the grid interpolator as value.

These are the epochs that should be used to create the tec_epochs list in the load_resources method of the Ionospheric delay class.

Current behavior:

In what matters to TEC epochs, the Ionospheric class assumes that each IONEX file contains a single TEC map, and incorrectly associates interpolated TEC values with reference epochs of different files.

Additional context:

No response

Sub-issues

Metadata

Metadata

Assignees

Labels

Projects

Status

To Start

Relationships

None yet

Development

No branches or pull requests

Issue actions