Coming From STILT-R#
PYSTILT does the same science as STILT-R, and its footprints match STILT-R’s
cell by cell. The one exception is forward runs with hnf_plume on, where
PYSTILT fixes how the plume grows (see STILT-R parity).
What changes is where the settings live. Instead of editing variables in
run_stilt.r, you write them in config.yaml or pass them to
stilt.Model. Receptors go in receptors.csv.
The workflow side by side#
Step |
STILT-R |
PYSTILT |
|---|---|---|
Start a project |
|
|
Set options |
edit variables in |
edit |
Define receptors |
build a |
|
Run |
|
|
Outputs |
|
|
run_stilt.r settings in PYSTILT#
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
same names, top level |
|
same names, top level |
HYSPLIT settings ( |
same names, top level |
wind and mixing-depth error settings ( |
same names, usually on a variant of their own (Transport Error) |
|
|
|
other keys under |
|
|
|
|
|
no equivalent |
|
not needed. |
|
a smaller |
|
|
|
the project folder |
|
not needed |
Other differences#
A project runs its receptors under named variants. A variant is a
meteorology source plus any settings that differ from the defaults (see
Configuration). One project can run the same receptors with
several meteorology products, a range of ziscale values, or a second
footprint grid. Each variant gets its own folder.
The transport error run is a variant too. STILT-R runs HYSPLIT a second time
with the wind-error settings and stores both sets of particles in one
_traj.rds. In PYSTILT that second run is its own variant, with its own
folder and log, and it can repeat several times
(Transport Error).
stilt run skips simulations whose outputs already exist. After a failure,
run it again and only the missing simulations run. Adding a variant runs
only the new variant.
PYSTILT will not change the settings of a variant that has already run.
STILT-R deletes out/by-id and starts over whenever run_trajec = TRUE.
PYSTILT records the settings each variant ran with and stops with an error if
they change under the same name. Give the changed settings a new variant
name, or run stilt rm --variant NAME to start that variant over (see
Configuration).
Receptors#
receptors.csv holds the same information as STILT-R’s receptors data
frame. STILT-R’s column names long, lati, and zagl work as they
are. Rename run_time to time:
time,long,lati,zagl
2015-07-05 00:00:00,-111.8472,40.7665,21
STILT-R makes a column receptor from a row with several zagl values. In
receptors.csv, a column or multipoint receptor is several rows that share
an r_idx value. See Receptors.
Outputs#
Trajectories are Parquet files instead of R .rds files. You can open them
in Python with pandas or stilt.Trajectories, and in R with
arrow::read_parquet. Footprints are NetCDF as before, with dimensions
(time, lat, lon).
A point or column receptor’s ID has the same form as STILT-R’s simulation
ID. Each variant is a folder below it, for example
201507050000_-111.8472_40.7665_21/hrrr.
Moving a project over#
Copy your
run_stilt.rsettings intoconfig.yamlusing the table above. Start with one meteorology source and novariants.Write your receptors to
receptors.csv.Run a few receptors that you already have STILT-R results for, and compare the footprints.
Run everything.