cassini

This submodule contains Cassini mission file-discovery and download functionality used by LoadPDS.

Classes

CassiniMixin()

Cassini mission file-discovery mixin.

class CassiniMixin[source]

Bases: object

Cassini mission file-discovery mixin.

cassini_flyby2experiment(flyby_ID)[source]

Description: Returns the experiment data for a given flyby ID from the cassini_titan_flyby_dict. If the provided flyby ID exists in the dictionary, it retrieves the corresponding data; otherwise, it returns a message indicating that the flyby ID was not found.

Inputs:
  • flyby_ID (str): The identifier for a specific flyby.

Outputs:
  • dict or str: The experiment data associated with the provided flyby ID if found, otherwise a message stating that the flyby ID was not found.

get_cassini_flyby_cumindex_url(flyby_dict)[source]

Description: Constructs the URL for the cumulative index (CUMINDEX.TAB) file associated with a specific flyby experiment. The function extracts the ‘experiment’ and ‘cumindex_repo’ (or ‘pds_repo’) values from the provided flyby_dict to build the URL. It then checks if the URL exists by sending a HEAD request. If the URL is valid (status code 200), it returns the URL; otherwise, it attempts an alternative URL and returns it if valid. If neither URL is found, it returns None and prints an error message.

Inputs:
  • flyby_dict (dict): A dictionary containing data for a specific flyby, including the ‘experiment’ and ‘cumindex_repo’ (or ‘pds_repo’) keys used to construct the cumulative index URL.

Outputs:
  • str or None: The constructed cumulative index URL if it exists; otherwise, None if the URL is not found or an error occurs.

get_cassini_flyby_files(local_folder)[source]

Description: Downloads Cassini mission data files related to a specific flyby, including kernel, ancillary, and radio science files. The function fetches the cumulative index table and identifies the relevant files for download based on the provided flyby ID. It handles the file download process, ensuring that files are downloaded only if they are not already present in the specified local folder.

Inputs:
  • local_folder (str): The path to the local directory where files should be downloaded.

Outputs:
  • kernel_files_to_load (dict): A dictionary containing kernel files (e.g., ck, spk).

  • radio_science_files_to_load (dict): A dictionary containing radio science files (e.g., odf).

  • ancillary_files_to_load (dict): A dictionary containing ancillary files (e.g., ion, tro, eop).

get_cassini_flyby_volume_url(flyby_dict)[source]

Description: Retrieves the PDS (Planetary Data System) repository URL for a given flyby experiment. The function extracts the ‘experiment’ value from the provided flyby_dict and constructs the URL based on that information. It then checks whether the constructed URL exists by sending a HEAD request. If the URL is valid (status code 200), the function returns the URL; otherwise, it returns None and prints an error message.

Inputs:
  • flyby_dict (dict): A dictionary containing data for a specific flyby, including the ‘experiment’ key used to construct the URL.

Outputs:
  • str or None: The constructed PDS repository URL if it exists; otherwise, None if the URL is not found or an error occurs.

get_cassini_full_moon_flybys_list(moon)[source]

Description: Returns a list of flyby IDs corresponding to either Titan or Enceladus. If the provided moon name is ‘titan’, it returns the flyby IDs from the cassini_titan_flyby_dict; if the name is ‘enceladus’, it returns the flyby IDs from the enceladus_flyby_dict. If the input moon name is invalid, an error is raised.

Inputs:
  • moon (str): The name of the moon (‘titan’ or ‘enceladus’) for which flyby IDs should be retrieved.

Outputs:
  • list: A list of flyby IDs corresponding to the provided moon. If the moon name is invalid, a ValueError is raised.

get_cassini_volume_cumindex_table(cumindex_url)[source]

Description: Constructs the URL for the cumulative index (CUMINDEX.TAB) file associated with a specific flyby experiment. The function extracts the ‘experiment’ and ‘cumindex_repo’ (or ‘pds_repo’) values from the provided flyby_dict to build the URL. It then checks if the URL exists by sending a HEAD request. If the URL is valid (status code 200), it returns the URL; otherwise, it attempts an alternative URL and returns it if valid. If neither URL is found, it returns None and prints an error message.

Inputs:
  • flyby_dict (dict): A dictionary containing data for a specific flyby, including the ‘experiment’ and ‘cumindex_repo’ (or ‘pds_repo’) keys used to construct the cumulative index URL.

Outputs:
  • str or None: The constructed cumulative index URL if it exists; otherwise, None if the URL is not found or an error occurs.

print_titan_flyby_table()[source]

Description: This method prints a table displaying the Titan flyby data in a readable format. It iterates over the cassini_titan_flyby_dict, extracts relevant information for each flyby, and constructs a table. The table is formatted with headers and colored using the colorama library for enhanced readability.

Input:

None.

Output:

None: This method prints the formatted table to the console.