runtraj.models.hysplit.HysplitModel.run#

HysplitModel.run(release, config, met, window, workdir=None, timeout=None)[source]#

Run HYSPLIT for one release in workdir and return its particles, its grids in the concentration mode, or its trajectories.

It finds the met files that cover window, up to the met step at or after its end, which HYSPLIT interpolates, cropped when the met is. Its output is hysplit.log in workdir, returned as the run’s log. Without workdir it runs in a temporary directory. The release heights are added by the caller, as for any model (runtraj.models.run_model()).

Raises:
  • SimulationError – With HYSPLIT’s log in log, and reason TIMEOUT when the run exceeded timeout seconds; the FailureReason of a known failure message in the log or WARNING file, such as the met running out (MET_COVERAGE); EXIT_STATUS when hycs_std was killed by a signal or exited with a non-zero status, whatever it had written; PARTICLE_LIMIT when maxpar stopped a release from several locations before the last ones got their particles; NO_PARTICLE_DATA when HYSPLIT wrote no particle file; or NO_CONCENTRATION_DATA when a concentration run wrote no file for a grid, or one with no sample, as a run shorter than its sampling interval, or fewer samples than the run holds, as a run that stopped early; NO_TRAJECTORIES_DATA when a trajectory run wrote no trajectory file, or one with no row; or MET_COVERAGE when it followed fewer trajectories than the release has locations, which is what hyts_std does with a location outside the met’s domain. A run whose particles stopped before n_hours well inside the met’s domain fails as MET_COVERAGE too, when outdt is 0: more than 5 grid cells from every side of the met grid. Particles that all left the met’s domain before the end of the run are kept.

  • MeteorologyError – Before HYSPLIT runs, when a met file the run needs is missing or damaged, or the files do not hold every time the run covers (Met.check()).

Return type:

ModelRun

Parameters:
  • release (runtraj.releases.Release)

  • config (HysplitConfig)

  • met (MetConfig)

  • window (tuple[datetime, datetime])

  • workdir (Path | None)

  • timeout (int | None)