media_corrections

This submodule contains download utilities for ancillary media-correction data, including IONEX ionospheric maps and VMF tropospheric mapping functions. The download_ancillary() function is the main convenience interface for downloading both data sources for a UTC date range. Source-specific interfaces for IONEX and VMF products are documented in the submodules listed above. The DownloadAtmosphericData class provides the legacy atmospheric-data downloader interface in this media-correction namespace.

Functions

download_ancillary(start, end, *[, ionex, ...])

Download all ancillary atmospheric and ionospheric data for a date range.

download_ancillary(start: datetime.datetime, end: datetime.datetime, *, ionex: bool = True, vmf: bool = True, vmf_technique: tudatpy.data_input.data_retrieval.media_corrections.vmf.vmf_downloader.VmfTechnique = VmfTechnique.GNSS, vmf_processing: tudatpy.data_input.data_retrieval.media_corrections.vmf.vmf_downloader.VmfProcessing = VmfProcessing.OPERATIONAL, ionex_products: Sequence[tudatpy.data_input.data_retrieval.media_corrections.ionex.ionex_downloader.IonexProduct] | None = None, ionex_resolution: tudatpy.data_input.data_retrieval.media_corrections.ionex.ionex_downloader.IonexResolution | None = IonexResolution.TWO_HOUR, vmf_stations_to_keep: Sequence[str] | None = None, base_directory: pathlib.Path | str = '~/.tudat/ancillary', netrc_path: pathlib.Path | str | None = None) → dict[str, tudatpy.data_input.data_retrieval.media_corrections._common.DownloadResult][source]

Download all ancillary atmospheric and ionospheric data for a date range.

Convenience wrapper around download_ionex() and download_vmf() that downloads all requested data products into organized sub-directories.

Parameters:
  • start (datetime) – Start of the UTC date range (inclusive).

  • end (datetime) – End of the UTC date range (inclusive).

  • ionex (bool, default = True) – Download IONEX ionospheric map files.

  • vmf (bool, default = True) – Download VMF troposphere mapping function files.

  • vmf_technique (VmfTechnique, default = VmfTechnique.GNSS) – Geodetic technique for VMF products.

  • vmf_processing (VmfProcessing, default = VmfProcessing.OPERATIONAL) – VMF processing type.

  • ionex_products (sequence of IonexProduct, optional) – Ordered preference list for IONEX. Defaults to all products.

  • ionex_resolution (IonexResolution or None, default = IonexResolution.TWO_HOUR) – IONEX temporal resolution override.

  • base_directory (Path or str, default = "~/.tudat/ancillary") – Root directory; sub-folders ionex/ and vmf/ are created underneath.

  • netrc_path (Path or str, optional) – Path to .netrc for CDDIS authentication.

Returns:

Keys "ionex" and/or "vmf" (only present if requested), each mapping to a DownloadResult.

Return type:

dict[str, DownloadResult]

Examples

>>> from datetime import datetime
>>> from tudatpy.data_input.data_retrieval.media_corrections import (
...     download_ancillary, VmfTechnique)
>>>
>>> # Download everything (IONEX + VMF GNSS)
>>> results = download_ancillary(datetime(2025, 3, 1), datetime(2025, 3, 7))
>>> print(results["ionex"].all_files)
>>> print(results["vmf"].all_files)
>>>
>>> # Download only VMF with optical/SLR technique
>>> results = download_ancillary(
...     datetime(2025, 3, 1), datetime(2025, 3, 7),
...     ionex=False, vmf_technique=VmfTechnique.OPTICAL
... )

Classes

DownloadAtmosphericData()

Downloader for atmospheric ancillary data products.

DownloadResult(downloaded, existing, failed)

Result of a download operation.

class DownloadAtmosphericData[source]

Bases: object

Downloader for atmospheric ancillary data products.

download_ionex_vmf3_files(start_utc: str, end_utc: str, dac: str = 'JPL', typ: str = 'FIN', smp: str = '02H', vmf_technique: str = 'GNSS', ionex_repo: str = 'Data/ionex_temp', vmf3_repo: str = 'Data/vmf3_temp', ionex: bool = True, vmf3: bool = True, clear_repository: bool = False) → dict[str, tudatpy.data_input.data_retrieval.media_corrections._common.DownloadResult][source]

Download IONEX and VMF3 files over a UTC date range.

Parameters:
  • start_utc (str) – Start date/time in ISO format.

  • end_utc (str) – End date/time in ISO format.

  • dac (str, default="JPL") – IONEX data analysis center.

  • typ (str, default="FIN") – IONEX product type.

  • smp (str, default="02H") – IONEX sample interval.

  • vmf_technique (str, default="GNSS") – VMF technique name.

  • ionex_repo (str, default="Data/ionex_temp") – Local IONEX output directory.

  • vmf3_repo (str, default="Data/vmf3_temp") – Local VMF3 output directory.

  • ionex (bool, default=True) – Whether IONEX files are downloaded.

  • vmf3 (bool, default=True) – Whether VMF3 files are downloaded.

  • clear_repository (bool, default=False) – Whether enabled output directories are removed before download.

Returns:

Download results keyed by product type.

Return type:

dict[str, DownloadResult]

class DownloadResult(downloaded: list[pathlib.Path] = <factory>, existing: list[pathlib.Path] = <factory>, failed: list[str] = <factory>)[source]

Bases: object

Result of a download operation.

downloaded

Files newly fetched in this call.

Type:

list[Path]

existing

Files that already existed locally and were not re-downloaded.

Type:

list[Path]

failed

Human-readable failure descriptions for days where no file could be obtained.

Type:

list[str]

property all_files: list[Path]

read-only

All available files (downloaded + existing), sorted by name.

Type:

list[Path]

property success: bool

read-only

True when at least one file is available and nothing failed.

Type:

bool

Exceptions

AncillaryDownloadError

Base exception for download failures.

AuthenticationError

Raised when authentication credentials are missing or invalid.

class AncillaryDownloadError[source]

Bases: Exception

Base exception for download failures.

class AuthenticationError[source]

Bases: AncillaryDownloadError

Raised when authentication credentials are missing or invalid.

IONEX downloads from NASA CDDIS require Earthdata credentials stored in a ~/.netrc file. See the download_ionex docstring for setup instructions.