rosetta¶
This submodule contains Rosetta mission file-discovery and download
functionality used by LoadPDS.
Classes¶
Rosetta mission file-discovery mixin. |
- class RosettaMixin[source]¶
Bases:
objectRosetta mission file-discovery mixin.
- add_ro_mission_phase_designation(mapping_dict)[source]¶
Updates mapping_dict entries by adding an ‘Abbn’ field (mission phase abbreviation) based on each entry’s start_date_utc. The function caches the mapping from unique start dates to their mission phase.
- Parameters:
mapping_dict (dict) – Dictionary where keys are rsi_volume_id and values are lists of dictionaries, each having a ‘start_date_utc’ datetime object.
Returns: dict: The updated mapping_dict with two additional keys for each entry:
“Abbn”: the mission phase abbreviation.
“target”: the target designation (“X” for non-target-specific or pre-comet phases, “C” for comet, “M” for Mars, “A” for asteroid flybys).
- get_ro_files(local_folder, start_date, end_date, radio_observation_type=None, skip_kernel_downloads=False)[source]¶
Description: This function downloads and organizes various types of SPICE kernels and radio science files for the ROSETTA mission. It supports downloading kernel files related to radio science, clock data, frame data, SPK (spacecraft position) data, CK (orientation) data, and tropospheric/ionospheric correction files. The function interacts with remote FTP servers to retrieve the data and organizes them into the specified local folder. The data is filtered by a given date range, and the function returns the downloaded files for further use.
- Inputs:
local_folder (str): The local directory where the downloaded files will be saved.
start_date (datetime): The start date for downloading data. This will filter the data to include only those within the date range.
end_date (datetime): The end date for downloading data. This will filter the data to include only those within the date range.
radio_observation_type (str): The type of radio science files to download (e.g. commissioning, checkout, solar conjunction, Lutetia, Global Gravity etc…)
- Outputs:
(dict, dict, dict): A tuple containing:
kernel_files_to_load (dict): A dictionary where the keys are kernel types (e.g., ‘ck’, ‘spk’, ‘fk’, ‘sclk’) and values are lists of paths to the successfully downloaded and loaded kernel files.
radio_science_files_to_load (dict): A dictionary where keys are categories of radio science data (e.g., ‘ifms_dp2’, ‘dsn_dps’) and values are lists of paths to the successfully downloaded radio science files.
ancillary_files_to_load (dict): A dictionary where keys are categories of ancillary data (e.g., ‘ion’, ‘tropospheric’) and values are lists of paths to the successfully downloaded ancillary files, such as tropospheric and ionospheric corrections.
- get_ro_rsi_volume_ID(start_date, end_date, mapping_dict) list[str][source]¶
Given a start_date and end_date, iterate over the mapping_dict (which is keyed by rsi_volume_id) and return a list of rsi_volume_id values whose associated record’s start_date_utc falls within the interval.
- Parameters:
start_date (datetime) – The start of the input date interval.
end_date (datetime) – The end of the input date interval.
mapping_dict (dict) – A dictionary where the keys are rsi_volume_id strings and the values are lists of dictionaries. Each dictionary includes at least: - “rsi_volume_id”: the RSI volume ID - “start_date_utc”: a datetime object representing the record’s start date.
- Returns:
A list of rsi_volume_id strings that fall within the [start_date, end_date] interval.
- Return type:
- Raises:
ValueError – If no matching rsi_volume_id is found.
- get_ro_rsi_volume_ID_mapping(url)[source]¶
Description: Fetches data from a given URL and extracts volume ID, date range, and observation type for the Rosetta mission. The data is returned as a dictionary mapping date intervals to volume IDs and metadata.
- Inputs:
url (str): The URL from which to fetch the data (plain text format).
- Outputs:
mapping_dict (dict): A dictionary where keys are “rsi_volume_id”, and values are dictionaries with:
rsi_volume_id (str): The rsi volume ID.
volume_id (str): The volume ID.
start_date_file (str): Start date (YYYY-MM-DD).
start_date_utc (datetime): Start date in UTC format.
radio_observation_type (str): Type of observation.