scopesim.server.OLD_database module

Functions to download instrument packages and example data

scopesim.server.OLD_database.download_package(pkg_path, save_dir=None, url=None, from_cache=None)[source]

Downloads a package to the local disk

Parameters:
pkg_pathstr, list

A .zip package path as given by list_packages()

save_dirstr

The place on the local disk where the .zip package is to be saved. If left as None, defaults to the value in scopesim.rc.__config__[“!SIM.file.local_packages_path”]

urlstr

The URL of the IRDB HTTP server. If left as None, defaults to the value in scopesim.rc.__config__[“!SIM.file.server_base_url”]

from_cachebool

Use the cached versions of the packages. If None, defaults to the RC value: !SIM.file.use_cached_downloads

Returns:
save_pathstr

The absolute path to the saved .zip package

scopesim.server.OLD_database.get_local_packages(path)[source]

List the packages that are available in the directory path

Parameters:
pathstr

Directory containing all local instrument package files

Returns:
pkgslist

Names of packages on the local disk

scopesim.server.OLD_database.list_packages(location='all', url=None, local_dir=None, return_pkgs=False, silent=False)[source]

List all .zip packages found under url

Parameters:
locationstr

[“server”, “local”, “all”] To look for packages on the server or on the local hard-drive, or both

urlstr

The URL of the IRDB HTTP server. If left as None, defaults to the value in scopesim.rc.__config__[“!SIM.file.server_base_url”]

local_dirstr

Path to the folder where the local packages are stored (or downloaded) If left as None, defaults to scopesim.rc.__config__[“!SIM.file.local_packages_path”]

return_pkgsbool

If True, returns a list of package names

silentbool

If True, does not print the list of package names

Returns:
all_pkgslist of str

A list of paths to the .zip packages relative to url The full string should be passed to download_package