stilt.execution.worker.run_particles#

stilt.execution.worker.run_particles(sim, *, workdir, keep_workdir=False, timeout=None)[source]#

Run the transport model for a simulation and write its particles to the output directory.

The transport model the variant names runs in workdir (stilt.transport.run_model()), with the variant’s met. Its log is written to the output directory whether the run succeeds or fails. The working directory is then removed, unless the run failed or keep_workdir is set, in which case it is copied under the output directory’s scratch/ first.

Parameters:
  • sim (Simulation) – What to run.

  • workdir (Path) – Directory to run in, made here. Anything in it is removed first, so each run needs its own.

  • keep_workdir (bool) – Keep the working directory of a successful run too.

  • timeout (int | None) – Time limit for the transport model run, in seconds.

Returns:

The particles, also written to the output directory.

Return type:

DataFrame

Raises:

SimulationError – As the transport model raises it (with a reason), or with reason NO_PARTICLE_DATA when the model wrote no particles. MeteorologyError when the met files are missing.