satpy.composites.aux_data module
Compositors using auxiliary data.
- class satpy.composites.aux_data.StaticImageCompositor(name, filename=None, url=None, known_hash=None, area=None, **kwargs)[source]
Bases:
GenericCompositor,DataDownloadMixinA compositor that loads a static image from disk.
Environment variables in the filename are automatically expanded.
Collect custom configuration values.
- Parameters:
filename (str) – Name to use when storing and referring to the file in the
data_dircache. Ifurlis provided (preferred), then this is used as the filename in the cache and will be appended to<data_dir>/composites/<class_name>/. Ifurlis provided andfilenameis not then thefilenamewill be guessed from theurl. Ifurlis not provided, then it is assumedfilenamerefers to a local file. If thefilenamedoes not come with an absolute path,data_dirwill be used as the directory path. Environment variables are expanded.url (str) – URL to remote file. When the composite is created the file will be downloaded and cached in Satpy’s
data_dir. Environment variables are expanded.known_hash (str or None) – Hash of the remote file used to verify a successful download. If not provided then the download will not be verified. See
satpy.aux_download.register_file()for more information.area (str) – Name of area definition for the image. Optional for images with built-in area definitions (geotiff).
- Use cases:
url + no filename: Satpy determines the filename based on the filename in the URL, then downloads the URL, and saves it to <data_dir>/<filename>. If the file already exists and known_hash is also provided, then the pooch library compares the hash of the file to the known_hash. If it does not match, then the URL is re-downloaded. If it matches then no download.
url + relative filename: Same as case 1 but filename is already provided so download goes to <data_dir>/<filename>. Same hashing behavior. This does not check for an absolute path.
No url + absolute filename: No download, filename is passed directly to generic_image reader. No hashing is done.
No url + relative filename: Check if <data_dir>/<filename> exists. If it does then make filename an absolute path. If it doesn’t, then keep it as is and let the exception at the bottom of the method get raised.
- __init__(name, filename=None, url=None, known_hash=None, area=None, **kwargs)[source]
Collect custom configuration values.
- Parameters:
filename (str) – Name to use when storing and referring to the file in the
data_dircache. Ifurlis provided (preferred), then this is used as the filename in the cache and will be appended to<data_dir>/composites/<class_name>/. Ifurlis provided andfilenameis not then thefilenamewill be guessed from theurl. Ifurlis not provided, then it is assumedfilenamerefers to a local file. If thefilenamedoes not come with an absolute path,data_dirwill be used as the directory path. Environment variables are expanded.url (str) – URL to remote file. When the composite is created the file will be downloaded and cached in Satpy’s
data_dir. Environment variables are expanded.known_hash (str or None) – Hash of the remote file used to verify a successful download. If not provided then the download will not be verified. See
satpy.aux_download.register_file()for more information.area (str) – Name of area definition for the image. Optional for images with built-in area definitions (geotiff).
- Use cases:
url + no filename: Satpy determines the filename based on the filename in the URL, then downloads the URL, and saves it to <data_dir>/<filename>. If the file already exists and known_hash is also provided, then the pooch library compares the hash of the file to the known_hash. If it does not match, then the URL is re-downloaded. If it matches then no download.
url + relative filename: Same as case 1 but filename is already provided so download goes to <data_dir>/<filename>. Same hashing behavior. This does not check for an absolute path.
No url + absolute filename: No download, filename is passed directly to generic_image reader. No hashing is done.
No url + relative filename: Check if <data_dir>/<filename> exists. If it does then make filename an absolute path. If it doesn’t, then keep it as is and let the exception at the bottom of the method get raised.