Result Types and Concentration#
A transport model makes one type of result per run, and every model that
makes a type follows its one schema (runtraj.results):
Type |
What it is |
File per release |
|---|---|---|
|
The particle table (The Particle Table), from HYSPLIT’s particles mode or another model that follows particles. |
Parquet, under |
|
Grids of concentration, from HYSPLIT’s |
NetCDF, under |
|
The trajectory table (Trajectories), from HYSPLIT’s |
Parquet, under |
A model says which type a config makes with result(config)
(TransportModel), and makes particles when it does
not say. runtraj.config.Variant.result is the variant’s type, and the
name of its tree in the output directory. project.status() has a column
for each type a variant makes, and each type has its own read:
Project.particles() and sim.particles,
Project.concentration() and sim.concentration,
Project.trajectories() and sim.trajectories. A stage reads
particles, so a variant that makes another type has no stages.
The result types, by name. |
|
One type of result: its name, its file's suffix, and how a file of it is checked, written, and read. |
|
Return the result type called name. |
|
Return the type of result model makes with config: its |
A concentration result#
One release’s result is an xarray.DataTree with a child per grid,
named as the grid is in config.yaml. Each grid is a Dataset over
CONCENTRATION_DIMS:
Name |
Units |
Meaning |
|---|---|---|
|
UTC |
When each sample starts. In a backward run each sample starts before the one above it. |
|
UTC |
When each sample ends, a coordinate along |
|
m |
The top of each level above ground, in whole meters. |
|
degrees |
The centers of the grid’s cells. |
one variable per pollutant |
set by the model |
What the model counts, which its |
|
a number, or UTC |
Only when the model counts each pollutant apart by where or when
it was released ( |
The file of one release is NetCDF 4, a group per grid, which
xarray.open_datatree() opens, as do ncdump and R’s ncdf4. Its
root attributes say what made it: release (the release id),
runtraj:settings and runtraj:met_files (JSON, as a particle file’s
metadata), runtraj:hash and runtraj:version, and, in an ensemble,
runtraj:realization. Writing and reading it needs netCDF4, which
pip install 'runtraj[concentration]' installs.
The dimensions of every grid's variables, in order. |
|
The dimensions a grid's variables may have before |
|
Raise unless result is a concentration result: a DataTree of grids. |
|
Give a grid's coordinates and variables their units and meanings, in place, and return it. |
|
Read a concentration file |
|
Write a concentration result to a NetCDF file that |
|
Raise when |