scopesim.server.download_utils.create_retriever#
- scopesim.server.download_utils.create_retriever(collection: str, save_dir: Path | str | None = None, url: str | None = None) Pooch#
Create Pooch retriever and load example data registry.
This functions is meant for internal use. Currently supported values for collection are “example_data” (used by the example data download functions, which are part of the user-facing API), “atmo” (for atmospheric libraries) and “psfs” (not yet implemented). The main purpose of this download infrastructure is to be able to store (relatively) large static files in a remote location, instead of having to bundle them in the package (or in IRDB packages).
The
Poochinstance returned by this function can then download any file listed in the respective registry viaretriever.fetch(<filename>, progressbar=True), which returns the full path to the locally cached file. Useretriever.registry_filesto display which files are available for download in each instance.- Parameters:
collection (str) – “Server folder” containing data to be retrieved.
save_dir (Path | str | None, optional) – Local cache location. If None (the default), use the one specified in the global configuration file.
url (str | None, optional) – Server base URL. If None (the default), use the one specified in the global configuration file.
- Returns:
retriever – Pooch retriever instance.
- Return type:
pooch.Pooch