stilt.run_trajectories#

stilt.run_trajectories(receptor, met, *, model='hysplit', workdir=None, timeout=None, **params)[source]#

Run the transport model for one receptor and return its particles.

This is what a project runs for each receptor, without a project: the particles are returned, not stored. STILT-R calls it calc_trajectory.

Parameters:
  • receptor (stilt.receptor.Receptor) – Where and when particles are released.

  • met (BaseModel | Mapping[str, Any]) – The meteorology, as one entry under mets: in config.yaml, checked by the model’s met config (stilt.transport.hysplit.MetConfig for HYSPLIT). A relative directory 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. None waits indefinitely.

  • **params (Any) – The transport model’s parameters, such as n_hours and numpar (stilt.transport.hysplit.HysplitConfig).

Returns:

The particle table, one row per particle per output step.

Return type:

DataFrame

Raises:
  • ValueError – If workdir is not empty, or a parameter is not one of the model’s.

  • SimulationError – If the run fails; reason says why.

  • MeteorologyError – If the met files the run needs are missing.

Examples

>>> receptor = stilt.PointReceptor(
...     time="2023-07-15 18:00", longitude=-111.848, latitude=40.766, altitude=10
... )
>>> met = {
...     "directory": "/data/hrrr",
...     "file_format": "%Y%m%d_%H",
...     "file_tres": "6h",
... }
>>> particles = stilt.run_trajectories(
...     receptor, met, n_hours=-24, numpar=200
... )