lair.setup_ccg_filter#

lair.setup_ccg_filter(lair_dir=None)[source]#

Set up the CCG filter module from NOAA GML.

Installs _ccg_filter.py into lair_dir, from NOAA’s ccg_filter.zip, unless the file is already there. import lair calls this function: The first import downloads a file says what is downloaded and why, what happens without a network, and how to skip the download or place the file yourself.

Called on its own, it raises when the download fails or the zip holds no ccg_filter.py, and leaves no partial file behind. The file is moved into place atomically, so concurrent first imports (a Slurm array, for example) are safe: one that finds the file already installed uses it.

Parameters:

lair_dir (str, optional) – Directory to install _ccg_filter.py into. Defaults to the lair package directory.

Return type:

None

See also

lair.background.thoning

Fits NOAA’s curve, which needs the filter.

Examples

>>> import lair
>>> lair.setup_ccg_filter()