mro

This submodule contains Mars Reconnaissance Orbiter mission file-discovery and download functionality used by LoadPDS.

Classes

MroMixin()

Mars Reconnaissance Orbiter mission file-discovery mixin.

class MroMixin[source]

Bases: object

Mars Reconnaissance Orbiter mission file-discovery mixin.

get_mapping_dict_spk_mro(url)[source]

Description: Fetches and parses phase information for MRO SPK kernels from a given URL. It extracts the phase name along with the associated start and end dates, and returns a dictionary mapping date intervals to phase names.

Inputs:
  • url (str): The URL from which to fetch the phase information.

Outputs:
  • phase_dict (dict): A dictionary where the keys are tuples representing date intervals (start_date, end_date), and the values are dictionaries containing the SPK phase ID (spk_ID).

get_mro_files(local_folder, start_date, end_date, radio_science_file_type='odf')[source]

Description: Downloads various SPICE kernel and ancillary files for the MRO mission, including clock, frame, orientation, and SPK kernels, based on a specified date range. Files are saved in the provided local folder.

Inputs:
  • local_folder (str): Path to the local folder where files will be saved.

  • start_date (datetime): The start date for the data retrieval.

  • end_date (datetime): The end date for the data retrieval.

Outputs:
  • kernel_files_to_load (dict): A dictionary containing the loaded kernel files, categorized by type (e.g., ‘sclk’, ‘fk’, ‘ck’, ‘spk’).

  • radio_science_files_to_load (dict): An empty dictionary for now, intended for radio science files.

  • ancillary_files_to_load (dict): An empty dictionary for now, intended for ancillary files.

get_mro_spk_ID(start_date, end_date, mapping_dict)[source]

Description: Checks if the given date interval overlaps with any of the date intervals in the mapping dictionary, and returns a list of SPK IDs associated with those overlapping intervals.

Inputs:
  • start_date (datetime): The start date of the input interval.

  • end_date (datetime): The end date of the input interval.

  • mapping_dict (dict): A dictionary mapping date intervals (as tuples of start and end dates) to SPK phase IDs (spk_ID).

Outputs:
  • spk_id_list (list): A list of SPK IDs associated with the overlapping intervals.

Raises:

- ValueError – If no SPK IDs are found for the given date interval.

get_url_mro_spk_files(start_date, end_date)[source]

Description: Fetches the SPK file URLs associated with the given date range for the MRO mission. It first retrieves a mapping of SPK phases to date intervals, identifies the SPK IDs that overlap with the input interval, and then constructs the corresponding SPK file URLs.

Inputs:
  • start_date (datetime): The start date of the input interval.

  • end_date (datetime): The end date of the input interval.

Outputs:
  • spk_ID_urls (list): A list of SPK file URLs corresponding to the overlapping SPK IDs.

Raises:

- ValueError – If no SPK file URLs are found for the given date range.