A stage file describes one event: its AOIs, time windows and the datasets to stage.
gaia stage --config stages every dataset in it into one Zarr store, one group per
dataset (stations/synoptic, rasters/prism, rasters/hrrr, stage4/daily, rasters/era5, rasters/nlcd, dem/cop30, soil/solus100, soil/statsgo, rasters/burn-severity, waveforms/seismic), in an
output folder.
Single-dataset commands (gaia stage prism -i … -s … -e …) build the same
configuration from their flags and write the same layout, with one group.
The design and its reasoning are in roadmap/02-stage-file.md.
gaia stage --config examples/skagit-2025.yaml --dry-run # validate and print, fetch nothing
gaia stage --config examples/skagit-2025.yaml -o /tmp/skagitThe file replaces the data-selection flags (-i, -s, -e and dataset options),
which can't be combined with --config, except with a preset. Only the
run controls combine with a file:
| flag | effect |
|---|---|
-o |
output folder; overrides the file's output |
--only prism,hrrr |
stage only these datasets from the file |
--dry-run |
validate, read the AOIs and print the resolved configuration; fetch nothing |
--overwrite |
write into a folder that isn't empty, replacing its store |
--skip-existing |
add to an existing store, skipping datasets whose group it already has |
A dataset that fails doesn't stop the run. The others are written, every failure is
listed at the end, and the command exits with an error. Rerun with --skip-existing to
retry only the datasets that failed. A dataset can also fail while it is written, when
its lazy data is read: io.save_datatree then removes the part of its group already
written (io.remove_group), and the later datasets are added to the store. Each dataset's size is logged, and one over
10 GB (io.MAX_BYTES, the in-memory size of what load() returns) fails before it
is written. Most load()s return lazy arrays, so this usually comes before any data
is read. The single-dataset commands also take
--dry-run, --overwrite and --skip-existing, so
gaia stage nlcd -i aoi.geojson -o out --skip-existing adds land cover to the store
in out/.
A preset is a built-in stage file without an AOI or window. Give those with -i, -s
and -e:
gaia stage --config conus-precip -i aoi.geojson -s 2025-12-01 -e 2025-12-20 -o out| preset | datasets |
|---|---|
conus-precip |
synoptic, prism, hrrr |
The presets are in src/gaia_cli/presets/. -s and -e
are literal UTC bounds for every dataset (a date-only -e includes the whole day),
read with the same one-day padding as any window.
name: peters-dome-2023 # required; names the store and STAC Item
time: 2023-09-14T02:06:49Z # event anchor for relative windows; optional
origin: {latitude: 63.1455, longitude: -151.1904} # optional; seismic distances
attrs: # copied to the store's root group
title: Peters Dome rock-ice avalanche, 2023-09-14
aois: # named AOIs
regional: {bbox: [-152.2, 62.75, -150.2, 63.55]}
local: {latitude: 63.1455, longitude: -151.1904, radius_km: 15}
aoi: regional # default AOI: a name, path, URL or inline AOI
window: 2023-06-01/2023-09-21 # default window
output: s3://gaia-scratch/gaia-cli/peters-dome # output folder; -o overrides it
datasets:
hrrr: {aoi: local, window: {before: 6h, after: 1d}, variable: temperature_2m}
prism: {variables: [ppt, tmin, tmax]}
nlcd: {year: 2021} # static: takes no window
dem/usgs10m: {} # the key names the productEach dataset uses its own aoi and window, otherwise the file's defaults. Its other
keys are the options of that dataset's load() function, with the same defaults as
the CLI flags:
Some datasets have variants, each its own top-level group. The key names the variant,
so one file can list several: dem/cop30 and dem/usgs10m write groups dem/cop30
and dem/usgs10m. --only dem selects every variant, and --only dem/usgs10m one.
| dataset | options |
|---|---|
synoptic |
variables (list, default [precip_accum]; see stations.md) |
prism |
variables (list of ppt, tmin, tmax, tmean; default [ppt]; see prism.md) |
hrrr |
variable (default precipitation_surface) |
era5 |
variables (list of ERA5 short names; default [tp, sf, t2m, swvl1, swvl2, sd]; see era5.md) |
stage4 |
none; the key names the accumulation: stage4/daily, stage4/sixhourly or stage4/hourly (a bare stage4 is stage4/daily; see stage4.md) |
nlcd |
year (default 2021); static, no window |
dem |
none; the key names the product: dem/cop30 or dem/usgs10m (a bare dem is dem/cop30; see dem.md); static, no window |
soil |
none; the key names the product: soil/solus100 or soil/statsgo (a bare soil is soil/solus100; see soil.md); static, no window |
burn-severity |
fire (part of the fire's name) and year, needed only when several fires intersect the AOI (see burn-severity.md); static, no window |
sentinel1-rtc |
polarizations (list of vv, vh, hh, hv; default [vv, vh]), orbit_state (any, ascending, descending; default any), relative_orbit (default 0, every track), match (none, relative_orbit; see Choosing scenes); see sentinel1-rtc.md |
sentinel2 |
bands (list of common names, default [blue, green, red, nir, swir16, scl]), max_cloud_cover (percent of the tile, default 100, no filter); see sentinel2.md |
seismic |
network, station, location (FDSN codes, default *) and channel (default "HH?,BH?", in order of preference: each station keeps the first band it has; see seismic.md); one group per sample rate, waveforms/seismic/<rate>hz |
infrasound |
the same as seismic, with channel default "BDF,HDF", chosen per sensor position so array elements are kept (see infrasound.md); waveforms/infrasound/<rate>hz |
origin isn't a dataset option: datasets that use it (seismic and infrasound, for distance_km and
back_azimuth) take the file's origin, else the AOI's centroid, and record which in
their attributes. Single-dataset commands have no origin flag, so they use the centroid.
-o (or the file's output) is a folder, local or s3://. Every run writes:
<output>/
<name>.zarr/ # the store, one group per dataset
<name>.json # STAC Item: `data` asset (the store) and `config` asset (stage.yaml)
stage.yaml # the resolved stage file
<name> is the file's name, so it may hold only letters, digits, ., _ and -.
Single-dataset commands and presets name the store after the folder instead:
gaia stage prism … -o skagit writes skagit/skagit.zarr. An -o ending in .zarr
is an error.
stage.yaml is written before any data is fetched. It lists every dataset staged,
each with its own AOI, window and options after defaults, so
gaia stage --config <output>/stage.yaml repeats the run, and with --skip-existing
it retries the datasets that failed. URL AOIs are kept as URLs. Local AOI files are
inlined as intersects Polygons in EPSG:4326, so the file works on other machines. Datasets skipped for
coverage aren't listed. With --skip-existing, datasets the existing file lists are
kept.
Each dataset's group is written as soon as it loads, and the store's metadata is consolidated and its STAC Item rewritten after every group. If a later dataset fails, or the run is interrupted, the groups already written are complete and readable.
| form | example |
|---|---|
| path or URL | aoi/basin.geojson (relative to the stage file), https://…/basin.json |
bounding box, [west, south, east, north] in EPSG:4326 |
{bbox: [-152.2, 62.75, -150.2, 63.55]} |
| GeoJSON geometry | {intersects: {type: Polygon, coordinates: [...]}} |
| circle, radius in km | {latitude: 63.1455, longitude: -151.1904, radius_km: 400} |
A stage file read from a URL (gaia stage --config https://…/stage.yaml) can't use
paths, relative or absolute: they would name files on the machine running it, not
next to the stage file. Its AOIs are URLs or inline.
Every AOI must be a single Polygon: a file with one Polygon feature, or an
intersects Polygon. MultiPolygons and files with several features aren't
supported yet. The same rule applies to -i and gaia align --aoi.
Every window is a half-open UTC interval [start, end). A date-only end includes that
whole day: 2025-12-01/2025-12-20 ends at 2025-12-21T00:00Z. Naive timestamps are
UTC, and offsets (2025-12-01T00:00-08:00) are converted.
| form | meaning |
|---|---|
"start/end", .. for an open end |
absolute interval |
{start, end} |
the same |
{before, after} |
[time - before, time + after]; a missing side is time |
{start, after}, {before, end} |
mixed absolute and relative |
{pre: {...}, post: {...}} |
named sub-windows (for scene-based datasets) |
select: all | first | last | nearest, count: N |
which scenes to keep (scene-based datasets) |
Timed datasets are read one day beyond each end of their window (seismic and
infrasound, whose samples have no periods to complete, read exactly their window), so a window
2025-12-01/2025-12-20 reads 2025-11-30 through 2025-12-21. Periods that straddle
the window's edges, such as PRISM's 12 UTC day, are then complete, and gaia align
has every source step it needs for each period in the window. --dry-run shows the
interval read as read:. The coverage check uses the window itself.
To compare products over the requested window, keep only their whole time steps inside
it. gaia_cli.align.common_window(tree, start, end) returns the longest interval made of
whole steps of every product (for a store holding PRISM, 12 UTC to 12 UTC), and
gaia_cli.align.select_window(ds, t0, t1) keeps a dataset's steps inside it:
from gaia_cli import align, io
tree = io.open_datatree("out/skagit.zarr")
t0, t1 = align.common_window(tree, "2025-12-01", "2025-12-16") # 12-01T12 to 12-16T12
prism = align.select_window(tree["rasters/prism"].to_dataset(), t0, t1)A date-only start is 00:00 UTC and a date-only end includes the whole day. This
matches how pystac-client expands dates for a STAC API search, which itself only
accepts full RFC 3339 timestamps.
Durations are a number and a unit (s, min, h, d, w), such as 17min or 30d,
or ISO 8601 (PT17M). Months and years aren't durations; use absolute dates.
Most datasets take one closed window, so pre/post and select are rejected for
them. Each dataset's own time convention (for example PRISM's 12 UTC day) applies
inside the window; see the dataset's doc.
Scene datasets (sentinel1-rtc, sentinel2, opera-rtc; SCENES = True in the module) take pre/post
windows and select/count, and are read over exactly the span of their windows, with
no padding. Each window keeps the scenes in [start, end) that its select picks:
all (the default), first, last, or nearest to time, count of them
(default 1). They are chosen from the STAC search results, before any pixels are read.
time: 2023-09-14T02:06:49Z
datasets:
sentinel1-rtc:
window:
pre: {before: 30d, select: last} # the last pass before `time`
post: {after: 30d, select: first} # the first pass after it
match: relative_orbit # on each track that has bothWith match: relative_orbit, each window chooses on each relative orbit separately, and
only tracks with scenes in every window are kept, so a pre and a post pass share their
viewing geometry; without it, pre and post may come from different tracks. Each
chosen pass records its window in a window coordinate (pre, post). The resolved
stage.yaml writes the windows with absolute bounds and their select and count.
Windows must still be closed.
Each dataset declares the area and time span it covers as a STAC Collection extent
(EXTENT in its module). Before fetching, the AOI's bounds and each window are checked
against it. A dataset that the AOI or window misses is skipped with a warning, and
--dry-run marks it with skipped: and the reason. If every dataset is skipped, as
for gaia stage prism with an Alaska AOI, the command exits with an error.
The check is coarse on purpose: a bounding-box intersection, not a polygon test. A CONUS bbox also covers parts of Canada and Mexico, and those requests fail later at the provider.
| dataset | spatial extent | time extent |
|---|---|---|
synoptic |
global (stations are mostly in the US, Alaska included) | open |
prism |
CONUS | 1981 onward |
hrrr |
CONUS | 2014-10-01 onward |
era5 |
global | 1940 onward (the store ends a few months back; checked when read) |
nlcd |
CONUS | static; years 1985–2024 |
dem |
global (usgs10m: US only, not checked) |
static |
soil |
CONUS | static |
burn-severity |
CONUS (USFS assessments) | static; fires from 2017 on |
seismic |
global (EarthScope serves networks worldwide) | open |
infrasound |
global (EarthScope) | open |
Unknown keys (with a suggested key), bad values, missing AOI files and windows that
need a time are all reported together, before any data is fetched. --dry-run also
reads each AOI once and prints the resolved configuration, including each AOI's bounds.