runtraj.run_trajectories#
- runtraj.run_trajectories(release, met, *, model='hysplit', workdir=None, timeout=None, **params)[source]#
Run the transport model for one release and return what it made, particles unless the settings say another type.
This is what a project runs for each release, without a project: the result is returned, not stored. Its type follows the settings, as a variant’s does (
runtraj.results): particles, or with HYSPLIT’smode="trajectory"the trajectory table, or withmode="concentration"the grids.- Parameters:
release (runtraj.releases.Release) – Where and when particles are released.
met (
BaseModel|Mapping[str,Any]) – The meteorology, as one entry undermets:inconfig.yaml, checked by the model’s met config (runtraj.models.hysplit.MetConfigfor HYSPLIT). A string is the folder of its files, and a relative folder starts from the working directory.model (
str) – The transport model.workdir (
str|Path|None) – Directory the model runs in, kept afterwards for a look at its files. It must be empty or not exist yet. Without it the model runs in a temporary directory that is removed.timeout (
int|None) – Time limit in seconds.Nonewaits indefinitely.**params (
Any) – The transport model’s parameters, such asn_hoursand HYSPLIT’snumpar(runtraj.models.hysplit.HysplitConfig).n_hoursis required; the others default to the model’s own values.
- Returns:
The particle table, one row per particle per output step, with
time(UTC), the release time plusage, as a table read from a particle file has.footis the model’s own (HYSPLIT’s, made withveght). A model that writes nofootreturns none. With settings that make another type, that type’s result: the trajectory table (runtraj.trajectories), or a tree of concentration grids (runtraj.concentration).- Return type:
- Raises:
ValueError – If workdir is not empty, or a parameter is not one of the model’s.
SimulationError – If the run fails;
reasonsays why.MeteorologyError – If the met files the run needs are missing.
Examples
>>> release = runtraj.PointRelease( ... time="2023-07-15 18:00", longitude=-111.848, latitude=40.766, altitude=10 ... ) >>> particles = runtraj.run_trajectories( ... release, ... "/data/hrrr", ... model="hysplit", ... n_hours=-24, ... numpar=200, # HYSPLIT's particle count ... ) >>> table = runtraj.run_trajectories( ... release, "/data/hrrr", n_hours=-24, mode="trajectory" ... )