atdf

This submodule contains functionality to load tracking data from ATDF/TRK-2-25 files, based on the atdf2ascii [49] Python package, which is used to decode the binary ATDF files into intermediate ASCII tables. The read_atdf_data() function decodes the binary ATDF files and converts them to Tudat-compatible tracking data objects; see also tracking_data.

Alternatively, the lower-level AtdfTrackingDataProcessor class can be used to decode the binary ATDF files into ASCII tables, using the AtdfTrackingDataProcessor.convert_atdf_to_ascii() method, and then convert the ASCII tables to tracking-data and supplementary-data objects, using the AtdfTrackingDataProcessor.process_ascii_tables() method.

read_atdf_data(atdf_file_path: list[pathlib.Path], spacecraft_name: str, output_dir: pathlib.Path = PosixPath('output/atdf2ascii'), count_time: list[float] | None = None, proc_count: int = 1, doppler_two_way: bool = True, doppler_three_way: bool = True, range_two_way: bool = True) → tuple[list[tudatpy.kernel.data_input.tracking_data.TrackingData], list[tudatpy.kernel.data_input.tracking_data.TrackingSupplementaryData]][source]

Read ATDF/TRK-2-25 files into tracking-data containers.

ATDF files are binary DSN closed-loop archival tracking data files containing radiometric spacecraft tracking data. This reader decodes the requested observable groups with atdf2ascii and returns Tudat tracking- data objects together with the corresponding supplementary data. Internally, this function creates an AtdfTrackingDataProcessor, which uses the atdf2ascii Python package to decode the ATDF files into intermediate .msr/.ramp ASCII tables, dispatches the decoded records to the corresponding Tudat converters, and returns the generated Tudat TrackingData and TrackingSupplementaryData objects.

Parameters:
  • atdf_file_path (list[pathlib.Path]) – Paths to ATDF/TRK-2-25 tracking files.

  • spacecraft_name (str) – Spacecraft body name used in generated link definitions (to be used for all files).

  • output_dir (pathlib.Path, default Path("output/atdf2ascii")) – Directory in which atdf2ascii writes the intermediate ASCII tables.

  • count_time (list[float] | None, default None) – Doppler count times (in seconds) to compress the decoded observations to. If None (default), each observation keeps its own count time as archived in the ATDF file, i.e. no compression is applied.

  • proc_count (int) – Number of processors to use for the atdf2ascii decoding step. Defaults to half the available cores.

  • doppler_two_way (bool) – Observable groups to be decoded and converted.

  • doppler_three_way (bool) – Observable groups to be decoded and converted.

  • range_two_way (bool) – Observable groups to be decoded and converted.

Returns:

Tracking data objects and supplementary data objects.

Return type:

tuple[list[TrackingData], list[TrackingSupplementaryData]]

Example

from pathlib import Path
from tudatpy.data_input.tracking_data.atdf import read_atdf_data

# download from https://pds-geosciences.wustl.edu/mgn/mgn-v-rss-1-tracking-v1/mg_2601/
atdf_files = [Path("data/TDF/2267276A.TDF"), Path("data/TDF/2276282A.TDF")]
tracking_data, supplementary_data = read_atdf_data(
    atdf_file_path=atdf_files,
    spacecraft_name="MGN",
    output_dir=Path("output/atdf2ascii"),
    count_time=[60.0],  # Compress Doppler observations to 60 seconds
    doppler_two_way=True,
    doppler_three_way=True,
    range_two_way=False,
)

Supporting API

The class below exposes the lower-level ATDF processing controls used by read_atdf_data(). It can be used to inspect or customize how the tables decoded by atdf2ascii are converted, before the tracking-data and supplementary-data objects are returned.

class AtdfTrackingDataProcessor(atdf_file_path: list[pathlib.Path], spacecraft_name: str)[source]

Bases: object

Processor for ATDF (TRK-2-25) files using atdf2ascii.

For the observable groups enabled through the doppler_*/range_* flags of convert_atdf_to_ascii() and process_ascii_tables(), the processor first runs atdf2ascii to decode the ATDF files into intermediate .msr/.ramp ASCII tables, and then converts them to TrackingData and TrackingSupplementaryData objects.

Parameters:
  • atdf_file_path (list[pathlib.Path]) – List of ATDF file paths to be processed.

  • spacecraft_name (str) – Spacecraft body name used in generated link definitions.

Example

The following example shows how to use the AtdfTrackingDataProcessor class to decode ATDF files and then convert the decoded ASCII tables to Tudat tracking-data and supplementary-data objects. In this example, all observable groups are decoded from the ATDF files, but only 2-way and 3-way Doppler observations are converted to Tudat tracking-data objects.

from pathlib import Path
from tudatpy.data_input.tracking_data.atdf import AtdfTrackingDataProcessor

# download from https://pds-geosciences.wustl.edu/mgn/mgn-v-rss-1-tracking-v1/mg_2601/
atdf_files = [Path("data/TDF/2267276A.TDF"), Path("data/TDF/2276282A.TDF")]
mgn_atdf_processor = AtdfTrackingDataProcessor(
    atdf_file_path=atdf_files,
    spacecraft_name="MGN",
)
output_dir = Path("output/atdf2ascii")
mgn_atdf_processor.convert_atdf_to_ascii(
    output_dir,
    doppler_one_way=True,
    doppler_two_way=True,
    doppler_three_way=True,
    range_one_way=True,
    range_two_way=True,
)
doppler_tracking_data, doppler_supplementary_data = mgn_atdf_processor.process_ascii_tables(
    output_dir,
    doppler_two_way=True,
    doppler_three_way=True,
    range_two_way=False,
)
convert_atdf_to_ascii(output_dir: pathlib.Path, count_time: list[float] | None = None, proc_count: int = 1, doppler_one_way: bool = False, doppler_two_way: bool = True, doppler_three_way: bool = True, range_one_way: bool = False, range_two_way: bool = True)[source]

Decode ATDF files to ASCII tables.

This function converts the binary ATDF files given in the class constructor to ASCII tables using the atdf2ascii [49] tool. The ASCII tables are stored in the given output_dir and optionally compressed to the given count_time. For each ATDF file a .msr table (containing the decoded observations), and a .ramp table (containing the decoded frequency ramps) are created.

Parameters:
  • output_dir (Path) – Directory where the .msr and .ramp ASCII tables will be stored.

  • count_time (list[float] | None, optional) – Count time that Doppler observations should be compressed to. If None, the original count times are preserved, if a list with a single float the observations are compressed to that count time, by default None

  • proc_count (int) – Number of processors to use for the atdf2ascii decoding step. Defaults to half the available cores.

  • doppler_one_way (bool) – Observable groups to be decoded by atdf2ascii. doppler_one_way and range_one_way are not decoded by default, since no converters exist for them yet.

  • doppler_two_way (bool) – Observable groups to be decoded by atdf2ascii. doppler_one_way and range_one_way are not decoded by default, since no converters exist for them yet.

  • doppler_three_way (bool) – Observable groups to be decoded by atdf2ascii. doppler_one_way and range_one_way are not decoded by default, since no converters exist for them yet.

  • range_one_way (bool) – Observable groups to be decoded by atdf2ascii. doppler_one_way and range_one_way are not decoded by default, since no converters exist for them yet.

  • range_two_way (bool) – Observable groups to be decoded by atdf2ascii. doppler_one_way and range_one_way are not decoded by default, since no converters exist for them yet.

process_ascii_tables(output_dir: pathlib.Path, earth_name: str = 'Earth', doppler_two_way: bool = True, doppler_three_way: bool = True, range_two_way: bool = True) → tuple[list[tudatpy.kernel.data_input.tracking_data.TrackingData], list[tudatpy.kernel.data_input.tracking_data.TrackingSupplementaryData]][source]

Process ATDF ASCII tables into tracking data objects.

This method processes the ATDF ASCII tables, generated using the atdf2ascii tool into Tudat-compatible TrackingData and TrackingSupplementaryData objects. It assumes that ASCII tables of the atdf_file_paths have already been generated using the convert_atdf_to_ascii() method and are present in the output_dir.

Parameters:
  • output_dir (Path) – Path to the directory where the ASCII tables are stored.

  • earth_name (str, optional) – Name of the body with ground stations, by default “Earth”

  • doppler_two_way (bool) – Observable groups to convert. These should match the flags used to decode the ASCII tables in output_dir via convert_atdf_to_ascii(), since the corresponding .msr columns are only present if the group was decoded.

  • doppler_three_way (bool) – Observable groups to convert. These should match the flags used to decode the ASCII tables in output_dir via convert_atdf_to_ascii(), since the corresponding .msr columns are only present if the group was decoded.

  • range_two_way (bool) – Observable groups to convert. These should match the flags used to decode the ASCII tables in output_dir via convert_atdf_to_ascii(), since the corresponding .msr columns are only present if the group was decoded.

Returns:

Tracking data and supplementary data objects with the contents of the ASCII tables.

Return type:

tuple[list[TrackingData], list[TrackingSupplementaryData]]