stilt.transport.hysplit.MetConfig#

class stilt.transport.hysplit.MetConfig(*, directory: pathlib.Path, subgrid_dir: pathlib.Path | None = None, download: str | None = None, download_from: Literal['s3', 'ftp', 'http'] = 's3', file_format: str | None = None, file_tres: str | None = None, subgrid_enable: bool = False, subgrid_bounds: stilt.spatial.Bounds | None = None, subgrid_levels: int | None = None, **extra_data: Any) → None[source]#

HYSPLIT’s config for one met, as written under mets: in config.yaml.

HYSPLIT reads ARL files. Give either download to download them with arlmet, or file_format and file_tres to find them in directory. With download, other keys are options for that archive (such as domain for nams). Any other unknown key is an error.

A run records which weather product its met is and how it was cropped (settings()), not where the files are kept or how they are named. Moving the files, or renaming them, changes no result.

Parameters#

Parameter

Description

Default

directory

Directory holding the ARL meteorology files. Downloads are saved here. In a project, a relative path starts from the project directory; ~ and $VARIABLES are expanded.

Required

subgrid_dir

Directory for the cropped files, shared by every simulation that uses this meteorology. Each crop box gets its own folder inside it. Required when cropping your own files; not used with download, which crops files as it downloads them. A relative path starts from the project directory.

None

download

Name of a NOAA ARL archive to download files from with arlmet, such as hrrr, nam12, gdas1, or gfs0p25. When set, file_format and file_tres are not needed. Options for the archive (such as domain: ak) go in the same entry.

None

download_from

Server to download from: s3, ftp, or http.

's3'

file_format

strftime pattern for the start of each file name, such as %Y%m%d_%H. Files whose names start with it are found anywhere under directory, except lock files, backup copies ending in ~, and names ending in .partial or .bad. Required when download is not set.

None

file_tres

Time covered by each file, as a pandas time string such as 6h. Required when download is not set.

None

subgrid_enable

Crop the meteorology to subgrid_bounds before running.

False

subgrid_bounds

Longitude/latitude box to crop the meteorology to. Particles that leave it stop, so make it wide enough for the whole run, not only the footprint grid.

None

subgrid_levels

Number of vertical levels to keep, counted from the surface. Unset keeps all.

None

Attributes#

download_options

Extra fields, passed as keyword arguments to the arlmet archive.

Methods#

crop()

Return the crop as {"bbox": [west, south, east, north], "levels": n}, or None without one.

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialize private attributes.

settings()

Return what a run records of this met: its weather product and its crop.

source()

Return the source id of this met's files, such as HRRR, as their headers carry it.