download_utilities
Functions
|
Create a Pooch object to track and retrieve ephemeris files. |
|
This function partially encapsulates the functionality of the |
|
Will check for existing local files, any file not found will be printed |
|
Override the functionality of Pooch's Decompress class so that the resulting |
|
Utility to remove all the files tracked by the pooch retriever. This includes |
Module Contents
- make_retriever(aux_config: layup.utilities.layup_configs.AuxiliaryConfigs, directory_path: str | None = None) pooch.Pooch[source]
Create a Pooch object to track and retrieve ephemeris files.
- Parameters:
aux_config (AuxiliaryConfigs) – Dataclass of auxiliary configuration file arguments.
directory_path (string, optional) – The base directory to place all downloaded files. Default = None
- Returns:
The instance of a Pooch object used to track and retrieve files.
- Return type:
pooch.Pooch
- download_files_if_missing(aux_config: layup.utilities.layup_configs.AuxiliaryConfigs, args: argparse.Namespace) None[source]
This function partially encapsulates the functionality of the layup.bootstrap command line tool. While layup.bootstrap allows for forced re-downloading of files, this function will only download files that are not already present in the local cache.
- Parameters:
aux_configs (AuxiliaryConfigs) – Dataclass of configuration file arguments. This includes the AuxiliaryConfigs dataclass that contains the configuration for the bootstrap files.
args (Namespace) – The command line arguments. This includes the –cache argument that specifies the directory to store the downloaded files.
- _check_for_existing_files(aux_config: layup.utilities.layup_configs.AuxiliaryConfigs, retriever: pooch.Pooch) bool[source]
Will check for existing local files, any file not found will be printed to the terminal.
- Parameters:
aux_configs (AuxiliaryConfigs) – Dataclass of auxiliary configuration file arguments.
retriever (pooch.Pooch) – Pooch object that maintains the registry of files to download.
- Returns:
Returns True if all files are found in the local cache, False otherwise.
- Return type:
bool
- _decompress(fname: str, action: str, pup: pooch.Pooch) None[source]
Override the functionality of Pooch’s Decompress class so that the resulting decompressed file uses the original file name without the compression extension. For instance filename.json.bz will be decompressed and saved as filename.json.
- Parameters:
fname (str) – Original filename
action (str) – One of [“download”, “update”, “fetch”]
pup (pooch.Pooch) – The Pooch object that defines the location of the file.
- Return type:
None
- _remove_files(aux_config: layup.utilities.layup_configs.AuxiliaryConfigs, retriever: pooch.Pooch) None[source]
Utility to remove all the files tracked by the pooch retriever. This includes the decompressed ObservatoryCodes.json file as well as the META_KERNEL file that are created after downloading the files in the DATA_FILES_TO_DOWNLOAD list.
- Parameters:
aux_config (AuxiliaryConfigs) – Dataclass of auxiliary configuration file arguments.
retriever (pooch.Pooch) – Pooch object that maintains the registry of files to download.
- Return type:
None