tnf

This submodule contains functionality to load tracking data from TNF/TRK-2-34 files. These NASA Deep Space Network (DSN) Tracking and Navigation Files encode radiometric tracking data, including Doppler, range, and ramp records. The format is described in 820-013, TRK-2-34 DSN Tracking System Data Archival Format. The pytrk234 Python package is used heavily for parsing of the binary files and extraction of the raw data records.

The read_tnf_data() function is the main interface for loading the decoded data and converting it to objects that Tudat can process further; see also tracking_data. All other functionality in this module is reserved for better understanding what data is being loaded, and in some cases manipulating it, before it is processed into Tudat-compatible objects.

read_tnf_data(file_names: list[str], requested_observable_types: list[str], spacecraft_name: str | None = None, open_ramp_handling: tudatpy.data_input.tracking_data.tnf._converters.ramp.OpenRampHandling = OpenRampHandling.print_warning_once) → tuple[list[tudatpy.kernel.data_input.tracking_data.TrackingData], list[tudatpy.kernel.data_input.tracking_data.TrackingSupplementaryData]][source]

Read TNF/TRK-2-34 files into tracking-data containers.

TNF/TRK-2-34 files are binary DSN Tracking and Navigation Files containing radiometric spacecraft tracking data. This reader extracts the requested observable groups and returns Tudat tracking-data objects together with the corresponding supplementary data. Internally, this function creates a TnfTrackingDataProcessor, which uses the pytrk234 Python package to decode the TNF/TRK-2-34 files, dispatches the decoded records to the corresponding Tudat converters, applies the selected OpenRampHandling policy to ramp records, and returns the generated Tudat TrackingData and TrackingSupplementaryData objects.

Parameters:
  • file_names (list[str]) – Paths to TNF/TRK-2-34 tracking files.

  • requested_observable_types (list[str]) – Observable groups to extract from the files (to be used for all files).

  • spacecraft_name (str | None, default None) – Optional spacecraft body name used in generated link definitions (to be used for all files).

  • open_ramp_handling (OpenRampHandling, default OpenRampHandling.print_warning_once) – Policy for handling ramp intervals that do not have an explicit end record (to be used for all files).

Returns:

Tracking data objects and supplementary data objects.

Return type:

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

Supporting API

The classes below expose the lower-level TNF processing controls used by read_tnf_data(). They can be used to inspect or customize how records decoded by pytrk234 are converted, in particular how open ramp intervals are handled before the tracking-data and supplementary-data objects are returned.

class OpenRampHandling(*values)[source]

Bases: Enum

Strategy for closing open-ended ramp intervals (i.e. ramps without a trk_chdo.ramp_type event of type 4 or 5 in the file).

close_silently = 2

Close open ramps silently by setting end_time = start_time + 1 s. This implies that the frequency needs to be extrapolated.

print_warning = 3

Close open ramps with a unit interval and print a warning every time.

print_warning_once = 4

Close open ramps with a unit interval and print a warning only on the first occurrence.

raise_exception = 1

Raise a ValueError if any open ramp is found.

class TnfTrackingDataProcessor(tnf_file_paths: list[str], requested_types: list[str], spacecraft_name: str | None = None)[source]

Bases: object

Processor for TNF files using pytrk234.

For a given set of requested observables types (e.g. [‘doppler’, ‘range’]), this processor iterates file-by-file and uses pytrk234 to decode the TNF/TRK-2-34 records. Each converter then extracts its per-file data from the decoded pytrk234 records, the outputs are merged, and each converter’s process method produces TrackingData objects. Ramp data are always extracted and merged into TrackingSupplementaryData objects (one per ground station), holding the stations’ frequency ramps.

Parameters:
  • tnf_file_paths (list[str]) – List of TNF file paths to be processed.

  • requested_types (list[str]) – List of requested radiometric data types.

  • spacecraft_name (str | None, default None) – Optional spacecraft body name used in generated link definitions.

Examples

from tudatpy.data_input.tracking_data.tnf import read_tnf_data
# Define TNF file paths
tnf_files = ["mro_kernels/mromagr2012_002_1426xmmmv1.tnf"]

# Read both Doppler and range data
tracking_data, supplementary_data = read_tnf_data(
    tnf_files,
    ["doppler", "range"],
    spacecraft_name="MRO"
)
process(open_ramp_handling: tudatpy.data_input.tracking_data.tnf._converters.ramp.OpenRampHandling = OpenRampHandling.print_warning_once) → tuple[list[tudatpy.kernel.data_input.tracking_data.TrackingData], list[tudatpy.kernel.data_input.tracking_data.TrackingSupplementaryData]][source]

Process all TNF files provided at initialization.

For each file, pytrk234 decodes the SFDU data. For each requested radiometric data type, the corresponding Tudat converter then extracts data from the decoded records. Ramp data are also extracted to build the stations’ frequency-ramp supplementary data. The per-file outputs are merged and processed to produce the final outputs.

Parameters:

open_ramp_handling (OpenRampHandling) – Strategy for closing open-ended ramp intervals. Defaults to OpenRampHandling.print_warning_once.

Returns:

A tuple (tracking_data, supplementary_data). tracking_data contains one entry per requested radiometric observable group; supplementary_data contains one entry per ground station with associated frequency ramps. Either list is empty if no matching data were extracted.

Return type:

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