runtraj.models.hysplit.MetConfig#

class runtraj.models.hysplit.MetConfig(*, directory: pathlib.Path, subgrid_dir: pathlib.Path | None = None, download: str | None = None, download_from: Literal['s3', 'ftp', 'http'] = 's3', subgrid_enable: bool = False, subgrid_bounds: runtraj.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. A met of files you have needs only their folder, so a string is the directory: hrrr: /path/to/hrrr. Each file’s own header says which times it holds, whatever it is named. With download, arlmet downloads them, and 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. 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'

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.

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.