Core Objects#
The project, its releases, the simulations it runs, and their particles.
One release, without a project#
run_trajectories() runs the transport model for one release and
returns what it made: its particles, or the result of another mode
(HYSPLIT’s trajectory table or concentration grids). A project runs the same step for each of its
releases and stores the results.
particles = runtraj.run_trajectories(release, met, n_hours=-24, numpar=200)
Run the transport model for one release and return what it made, particles unless the settings say another type. |
Project interface#
Project is what you open a project with. It runs the transport
model, and each stage the project lists, and reads the results.
A project's particle runs: releases, settings, and the simulations they define. |
Release objects#
Base class of the release types. |
|
Release that releases particles from one point. |
|
Release that releases particles evenly along a vertical line. |
|
Release that releases particles from several points at once. |
|
Read releases from a CSV file. |
|
Write releases to a CSV file that |
|
Return releases as one table with a row per release point. |
|
Check a table with a row per release point and build its releases. |
|
Split a release id into its release time and location id. |
Simulation objects#
A Variant is one variant of a project, resolved: its configs, its
met, the transport model build, and the hashes that find its results.
project.variants holds them, and ProjectConfig.resolve() makes
them from a config. Simulation is one release under one variant,
which project.simulation(release_id, variant) returns.
One release run under one variant, as one realization of an ensemble or alone. |
|
One variant, resolved: its configs, its met, its transport model, and its hashes. |
Settings and their hashes#
runtraj.identity records what a run was made with, as its folder’s
_settings.yaml holds it, and hashes it. A stage records its own settings
(runtraj.stages.Stage.settings()), which are hashed with the
particles’ hash and the hash of each stage it reads. A stored record is
read back through the current config classes, so a setting added since, with
a default, still matches.
Return the settings that identify a run, in canonical form. |
|
Return the run settings a |
|
Return the transport model's config a run settings record holds. |
|
Return the hash of the results of the stage name with settings. |
|
Return the SHA-256 hex digest of settings. |
|
Return what a result file records besides its contents, as Parquet file metadata. |
|
The transport model build a run was made with. |
Particles#
A simulation’s particles are a pandas DataFrame. runtraj’s methods on them
are under .runtraj (ParticlesAccessor). The
functions below read and write particle files without a project.
Read a particle file. |
|
Return the release, run settings, and met files a particle file records. |
|
Write a particle table to a Parquet file that |
|
runtraj's methods on a particle table, as |
Simulation tables#
project.releases is a pandas DataFrame with one row per release, and
project.simulations one with one row per simulation. Select rows as in
pandas, then pass the selection to the project’s status(),
incomplete(), or particles().
sims = project.simulations
wbb = sims[(sims.variant == "hrrr") & (sims.site == "WBB")]
particles = project.particles(wbb)
Boxes#
A Bounds is documented under Configuration.
runtraj.spatial has the CRS helpers.
Return whether two CRS strings describe the same CRS, however they are spelled. |
|
Return whether |
|
Return the names of the horizontal dimensions, |