This is the multi-page printable view of this section.
Specifications
- 1: Xue Zarr Profile
- 2: Xue Bundle Metadata and Codes
- 3: Xue Container Format
- 4: The registry document
- 5: The native encoder
- 6: The STAC catalog
- 7: Sources
- 8: Run metrics
- 9: The tropical cyclone product
- 10: The airport product
- 11: The radiosonde sounding product
- 12: The synop product
- 13: The aq product
- 14: The alerts product
- 15: The nexrad product
- 16: The fire product
- 17: Geostationary satellite imagery
- 18: River flow in a showcase case
- 19: The indicators product
- 20: The data API
The documents in this directory are the normative contract for what Xue
writes and what every reader must accept. They win over the code, over the
developer documentation (contribution/) and
over any comment. They are licensed under CC BY 4.0;
the code is MIT / Apache-2.0 and the published data keeps its sources'
terms (see the README). They are also
published at https://xue.ringsaturn.me/docs/spec/.
| Document | Specifies |
|---|---|
| zarr-profile.md | The Zarr v3 store a bundle is published as, the series companion, the polar store, the column store: what is published today, so read this first |
| bundle.md | What every bundle carries: the metadata JSON (schemaVersion 1–4), the codebooks and the residual arithmetic |
| format.md | The legacy .xue container (v1, v2) that runs published before the stores still carry |
| schemas/ | The JSON Schemas (draft 2020-12) normative for shape: the manifest, bundle metadata v3, a store’s group and array documents, the pointer and the point products’ files |
| stac.md | The STAC catalog: layout, run Items, source Collections, point products, the showcase |
| registry.md | The registry document: the variables, bundles and sources an encoder builds, the closed sets of rules it names |
| encoder.md | The native encoder and its parity rule with the reference encoder |
| sources.md | What each source publishes: variables, grids, axes, caveats |
| tc.md, airport.md, sounding.md, synop.md, aq.md, alerts.md, nexrad.md | The point and single-site radar products: pointer, index, files, schemaVersion |
| fire.md | The active fire product: FIRMS detections aggregated hourly, pointer, index, sensor files |
| river.md | River flow in a showcase case: the river/ directory, the network and gauge kinds |
| satellite.md | Geostationary imagery and its composites |
| indicators.md | The agriculture indicators: crop-area-weighted daily quantities per forecast run, appended to monthly files read by byte range |
| metrics.md | The run metrics: when each forecast run went live, measured from the publish workflows |
| api.md | The data API (experimental) |
From the viewer to its specification
| In the viewer | Shows | Specified in |
|---|---|---|
/gfs, /sflux, /ecmwf, /ifs, /aifs, /ifshres, /arpege, /cmageps, /cfs | Global forecasts | sources.md, zarr-profile.md |
/hrrr, /rrfs, /woofnam, /iconeu | Regional forecasts | sources.md |
/gefsaero, /cmadust, /silam | Aerosol, dust and air-quality forecasts | sources.md |
/mrms, /jma, /hkonowcast, /cwa | Radar and precipitation nowcasts, rolling windows | sources.md |
/himawari, /himawarijp, /goeseast, /goeswest, /meteosat | Geostationary imagery and its composites | satellite.md |
/aurora | The aurora forecast | sources.md |
/showcase | Historical cases, some with river flow or fires | stac.md, river.md, fire.md |
/typhoon, /tc/ | Tropical cyclone tracks, forecasts and track errors | tc.md |
/airports/ | One page per airport: METAR and TAF | airport.md |
?stations=snd,apt,syn,aq,fire,alerts on any map | Soundings, airports, surface and air-quality stations, fires, warnings | sounding.md, airport.md, synop.md, aq.md, fire.md, alerts.md |
?radar=<site> on /mrms | One WSR-88D site’s sweep | nexrad.md |
/compare | Every live model at one point | sources.md |
/workbench | A GFS run along a line or at a point: section, sounding, time-height | zarr-profile.md (the column store) |
/metrics | When each run went live | metrics.md |
/api | A console for the data API | api.md |
Versions
Every artifact carries its own version, none tied to a code release.
| Artifact | Written today | Read |
|---|---|---|
Bundle metadata (schemaVersion) | 3 | 1 to 3 |
Container (FixedHeader.version) | 2, only when a build asks (--xue) | 1 and 2 |
| Manifest | schema 5 | 5; unknown fields ignored |
| Live pointer | schema 1 | 1 |
Zarr store (zarr_format) | 3 | 3 |
STAC (stac_version) | 1.1.0 | — |
Point products (schemaVersion, one per product) | see each document | up to the one a reader implements |
Indicators (schemaVersion) | 2 | 2 |
Run metrics (schemaVersion) | 1 | 1 |
Compatibility
- A reader keeps every version it has ever read. Published runs, rounds and cases are never rebuilt, so a version once published stays readable.
- An optional new field (a widening) does not change a version: readers ignore fields they do not know. A widening reaches the readers (the shell, the API) before the first data that carries it.
- A change a current reader could misread is a new version number. Readers reject a version above the one they implement, so a reader that knows the new version is deployed before the first data in it, and the old version keeps being read.
- Nothing is removed from a specification. A retired artifact (the container) stays specified for the files that exist.
How these are built, tested and released is in
contribution/; why the format looks as it does,
in contribution/architecture-rationale.md.
Changes to these documents are listed in CHANGELOG.md.
1 - Xue Zarr Profile
This document specifies how Xue bundles are written as Zarr v3 stores, the
layout every live run, rolling-window round and showcase case is published
in and a STAC catalog lists. It is normative for what the store
writers (xuebuild/zarrstore.py, the native encoder’s
encode/zarrstore.rs, build-bin) write and for what a store must look
like to be one of these. What a bundle carries, its metadata JSON,
quantization codebooks and residual arithmetic, is
bundle.md; this profile says how those land in a store. A
second branch, the polar store, carries radar sweeps in
beam-and-gate coordinates for products that have no grid, a third, the
network store, one value per river reach per frame, and a
fourth, the column store, the codes of a run’s map stores
cut so that one cell’s whole profile over the whole axis is a few chunks.
A store is a function of its bundles’ metadata, their quantized codes, their
tiles, each variable’s predictor and each bundle’s dimension names (see
“Coordinates”), and of nothing else. A build writes it straight from the
codes it quantized. The frontend plays a store wherever a bundle’s manifest
entry names one (see “Reading”). Runs published before the switch to stores
carry .xue containers (format.md), a legacy layout every
decoder keeps reading: such a run plays from its containers, and
?backend=xue asks for the container where an entry names both.
Why a profile
A player streams a bundle by range reads: one spatial tile of six frames
at a time, a viewport as a few contiguous spans, one cell’s series as one
chunk per six frames, each chunk one Zstandard frame whose frames may be
wrapping differences against the frame before. Zarr spells that as a
uint8 array under a sharding_indexed codec, a zstd codec and,
optionally, an array-to-array delta codec. Writing the convention down lets
a store written by anyone else be played the same way, and lets xarray,
zarrs or zarrita read a Xue run without a decoder of their own. (The .xue
container’s v2 index (format.md) cuts the same chunks; the
store replaces it.)
Layout
Every bundle of one resolution tier of a run, a rolling window’s round or a
segment is one Zarr group, the shared store, xue_profile 2; one
variable is one array in it, named by the variable’s id (unique within a
source). The coordinates sit beside the variables, written once for the
store.
bundles and columns (the column store’s) are reserved
store stems: no bundle id may be either. A store
is a handful of objects per array (two per variable, two per coordinate)
plus one group document, whatever the length of its axis and however many
bundles it holds. A bucket bills every object written: a store cut one shard
per time chunk cost a GFS run some five thousand objects where the container
cost sixty, and one store per bundle still spent most of a run’s objects on
group documents and coordinate chunks repeated in every store (a GFS run
1,571 objects, 190 of them shards; a satellite round 253, 25 of them
shards). A shard the size of the array is one object read by range, as the
container was, and its index is the whole index, read once.
A reduced-resolution rendition is its own shared store,
bundles.<tier>.zarr, written from the tier’s decimated codes exactly as
the full one is from the full codes. The ladder is per source
(SourceSpec.variant_factors): every source has the half
(bundles.half.zarr, the grid decimated by two), and the satellite disks
add the quarter (bundles.quarter.zarr; 3000 → 1500 → 750 cells a side,
the tile 64 → 32 → 16), each decimated from the full plane. The eighth
(bundles.eighth.zarr, decimation by eight) is still a valid tier that no
source builds: a reader takes the tiers a bundle has from its manifest
entry, so a store published with one still plays. Every rung is every
f-th row and
column, except that the 3.9 µm window (ir039) keeps the largest code
within f/2 cells of each site, so a one-cell hot spot is not dropped
(docs/satellite.md, “The 3.9 µm window”).
Profile 1, the one-bundle store, is the previous revision and stays
readable forever: one bundle per group, <bundle>.zarr and
<bundle>.<tier>.zarr (tmp2m.zarr, tmp2m.half.zarr), its metadata in
the group’s attributes.xue, the same arrays without xue.bundle and the
three primary coordinates of that bundle alone. Runs, rounds and showcase
cases published before shared stores are profile 1 and are never rebuilt;
a series store is still profile 1 (see “Series store”). Everything below
applies to both profiles except where it names one.
Array metadata
Every variable array is uint8 of shape [frameCount, height, width]
(time, then the grid in the metadata grid’s row-major, north-to-south,
west-to-east order) and carries exactly one codec, sharding_indexed. The
one exception is a series store’s widened variable, which is uint16
(Series store); everything below holds for it with the
differences that section lists. A column store’s surface array cut from such
a variable is uint16 too (Column store).
- Time chunk. The inner chunk holds six frames on a regular grid: time
chunk
tcovers frames[6t, 6t + 6). The container cuts its groups inside segments of constant step and restarts them where the step changes (GFS: a one-frame group at f120), so a store chunk may straddle two of the container’s groups. The two layouts coincide up to the first change of step. - Inner chunk: one time chunk of the bundle’s tile,
[6, tileHeight, tileWidth]. Within a shard the inner chunks are ordered row-major over the shard’s chunk grid: time chunk by time chunk, and within each the bundle’s tiles in the bundle’s row-major order,tileRows × tileColumnsof them, so one time chunk is one contiguous run of the object, as one group is in the container. - Outer chunk (shard): the whole array, the axis rounded up to whole time
chunks and the grid rounded up to whole tiles, because the sharding codec
requires whole inner chunks along each axis:
[6 × timeChunks, tileRows × tileHeight, tileColumns × tileWidth](GFS at 161 frames:[162, 728, 1440]). The chunk grid may run past the array’s shape; the cells beyond it, and the frames beyond the axis in the last time chunk, are stored asfill_value. A reader takes the shard’s frame count from the array’s own chunk shape and must accept any multiple of the time chunk: stores written before this revision are cut one shard per time chunk (chunk_shape[0] = 6, objectsc/<t>/0/0), and those stay readable. fill_valueis the variable’snodataCode. Padding, and any read past the grid, is explicitly nodata rather than a plausible low code.- Inner codec chain. The default is the standard
[bytes, zstd]with level 15 and a content checksum, which any Zarr client decodes with nothing registered. The delta chain (the writers’deltaoption, which the series store always takes) puts{"name": "xue.delta", "configuration": {"axis": 0}}in front ofbyteson every variable the bundle predicts from the previous frame, and never on a RAW one (precipitation, reflectivity). - Shard index. One
(offset, nbytes)pair of little-endianuint64per inner chunk of the shard’s chunk grid, in row-major order (time chunk, then tile), followed by the CRC-32C of those pairs as four little-endian bytes:16 × timeChunks × tileCount + 4bytes (GFS, 27 × 420 chunks: 181,444). Offsets are from the start of the shard.index_locationisendby default (a client fetches the index as an HTTP suffix range without knowing the object’s length, and zarrita reads only that form) and may bestart. A reader must accept both. A pair of2^64 − 1marks a chunk that was never written; the exporter writes every chunk, the padding time chunk past the axis included (a few bytes offill_valueeach). chunk_key_encodingisdefaultwith the/separator, so the shard is the objectc/0/0/0.
The xue.delta codec
Array-to-array. Along axis the first slice is stored whole and every later
slice as its wrapping difference against the slice before it, modulo 256 on
a uint8 array and modulo 65536 on a uint16 one; decoding is the running
sum in the same width. On uint8 that is the residual arithmetic of
bundle.md, “Residuals”, the .xue container’s PREVIOUS
predictor moved into the codec chain: an inner chunk under [xue.delta, bytes, zstd] compresses to
the same bytes as the bundle’s chunk over the same frames and the same
unclipped tile. It is not numcodecs’ Delta, which differences the
flattened buffer. xuebuild/zarrcodec.py implements it for zarr-python
(register()); it is only needed to read a store written with the delta
chain.
Group document
The shape of a grid store’s group document, either profile, is
schemas/store-group.schema.json, and
of every array document (each array’s zarr.json, repeated in the
consolidated block) schemas/store-array.schema.json;
the polar, network and column branches’ groups are
schemas/polar-group.schema.json,
schemas/network-group.schema.json and
schemas/column-group.schema.json.
They are normative for shape, and embed the bundle metadata schema
(bundle.md, “Metadata JSON”) wherever a document carries a
bundle’s metadata or a variable of it. This section and the ones below say
what the fields mean and what a reader checks across them: the profile it
implements, exactly one branch’s block, the bundle it opens by id, key
order and the CRC. tests/test_schemas.py holds the committed stores
(tests/fixtures/indicators/store/, tests/fixtures/river/network/,
tests/fixtures/column/) and stores it builds without GDAL (the shell’s synthetic run, a window cut
into segments, a polar round and window) to them. The shell checks a group
with the generated validator over what it reads, the envelope and the
bundle asked for, so a shared store opens every bundle a reader can parse
whatever another bundle carries.
A shared store’s zarr.json:
xue_bundlesmaps each bundle id to that bundle’s metadata JSON verbatim (bundle.md, “Metadata JSON”), so the parsers that read a bundle’s metadata read a store’s. Its keys are in manifest bundle order (the source’s publication order). A group whosexue_bundlesis missing, empty or not an object is invalid. There is noattributes.xueon a shared group: a profile-1 reader refuses the group (it refuses anxue_profileit does not implement), a profile-2 reader selects its bundle by id.xue_profileis this document’s version:2for a shared store,1for a one-bundle store. A reader refuses any other value.consolidated_metadatais the Zarr v3 inline form zarr-python reads. Every array document of the store is repeated verbatim, so a client on an origin that cannot be listed (a plain HTTP bucket, where every store is served from) still discovers the arrays:xr.open_zarr(url)works with noconsolidated=argument and no directory listing. Its keys are in this order: every variable array, bundle by bundle inxue_bundlesorder and within a bundle in itsvariablesorder; then the primary coordinatestime,latitude,longitude,y,x,crs, those some bundle uses; then every other coordinate array in the order its first bundle names it (time_<bundle id>,latitude_<family>,longitude_<family>,y_<family>,x_<family>within one bundle).- Key order is part of the bytes. The document is serialized as every
document of the profile is: JSON with two-space indentation, one member
or element per line,
": "after a key, non-ASCII characters as raw UTF-8, and a trailing newline — Python’sjson.dumps(document, indent=2, ensure_ascii=False) + "\n"(zarrstore._dump_json), mirrored by the native encoder’s writer for the array and group documents alike. - It is written last, after every array, and its CRC-32 is the store’s
crc32— the?v=every object of the store is fetched under — and thecrc32of every manifest entry that names the store. It covers every array’s metadata too.
A one-bundle store’s zarr.json (profile 1) carries "attributes": {"xue": {…the bundle's metadata…}, "xue_profile": 1} and the same consolidated
metadata over its own arrays (the variable arrays, then time, latitude,
longitude, or time, y, x, crs on a projected grid). A store written before consolidated metadata lacks it and
opens with consolidated=False from a listable store only; one written
before that also carries an xue_index attribute naming a whole-store index
object, index.bin, which a reader ignores, since the shard’s own index is
the whole index.
A reader that opens arrays by name (the frontend, zarr’s
open_group(url)["tmp2m"]) never needs the consolidated block.
Array attributes
Each variable array’s zarr.json:
xue.bundleis the id of the bundle the array belongs to, so an array opened alone knows which entry ofxue_bundlesdescribes it. It leads the block in a shared store and is absent from a one-bundle store.xue.variableis that variable’s entry from the metadata’svariableslist, copied, for a reader that opens one array alone.xue.predictorispreviousorrawand is informational: decoding follows the codec chain.- Every store writer writes
xue.variableandxue.predictor, and a reader accepts an array without them: the schema names them without requiring them. _FillValueis thenodataCodefor every variable.scale_factorandadd_offsetare written for a linear codebook only, so a CF-aware client dequantizes it (value =code × scale + offset); thelog1pcodebook has no CF spelling and is described byxue.variable.quantizationalone.- Dimensions are declared in the array metadata’s
dimension_names, the Zarr v3 field:["time", "latitude", "longitude"],["time", "y", "x"]on a projected grid, or the bundle’s own names (below). Every array of one bundle carries the same three. - On a projected grid every variable array also has
grid_mapping: "crs", its last attribute, naming the scalar array of Coordinates, and on no other grid does one.
Coordinates
The coordinate arrays are one-dimensional, one chunk each under [bytes]
(little-endian), named by the dimension they label: the frame’s offset from
the bundle’s runTime in seconds (int32, units: "seconds since <runTime>", calendar: "proleptic_gregorian", standard_name: "time",
fill 0), the cell centre latitudes and longitudes (float64,
degrees_north / degrees_east, fill NaN) from the bundle’s grid. They
are for xarray and its kind; a player reads the metadata.
On a grid with a gaussian block the latitude coordinate holds the true
Gaussian latitudes of its rows, not the regular fields’ even ones. Each is
computed alone, by this iteration in this order of operations, so that every
writer lands on the same double (a library root finder differs by up to 1.8e-12°
near the poles). With N = 2n and i the row on the whole Gaussian grid from
the north:
For n = 95 the first rows are 89.27671287810583, 88.33975425118209,
87.3972623773714; for n = 768, 89.91032453466268, 89.79415738840316,
89.67730421235662. tests/test_native_grids.py and rust/xue/src/projection.rs
hold these goldens.
On a grid with a projection block there is no latitude or longitude axis.
The coordinates are y and x, in place of latitude and longitude:
float64, fill NaN, units: "m", standard_name: "projection_y_coordinate" and "projection_x_coordinate", holding y0 + row × dy and x0 + column × dx. Two-dimensional latitude and longitude arrays are
not written; a client computes them from the crs array.
That array, crs, is zero-dimensional: shape: [], chunk_grid with
chunk_shape: [], data_type: "int32", fill_value: 0, codecs: [{"name": "bytes", "configuration": {"endian": "little"}}], dimension_names: []. It has a zarr.json and no chunk, and it is written once per store. It
exists for its attributes, the CF grid mapping, which xarray and rioxarray read:
| Attribute | Value |
|---|---|
grid_mapping_name | lambert_conformal_conic |
latitude_of_projection_origin | latitudeOfOrigin |
longitude_of_central_meridian | centralMeridian |
standard_parallel | [standardParallel1, standardParallel2] |
earth_radius | radius |
crs_wkt | the same projection as WKT2, in the one spelling reproject.LambertConformal.wkt writes, each number as its shortest round trip, so that writers agree on the bytes |
The attributes come in this order. Whatever the grid, a dimension’s coordinate array follows these rules.
- The primary coordinates
time,latitudeandlongitude, oryandxon a source published on a projection, are the run’s axis and the source’s primary grid at the store’s tier. They are written once per store. - A bundle whose time axis is cut by a rule of its own takes the dimension
time_<bundle id>, and the store carries a coordinate array of that name with that bundle’s axis (same encoding astime). The rules are the three by which the encoder cuts a bundle’s axis: a published scalar whose series has no analysis frame (discover.analysis_optional_ids: a de-accumulated, de-averaged or window-differenced rate, an interval maximum such asgust, a field the source writes only from a later hour, such as CMA GRAPES GEPS’s 24-hour precipitation probabilities from +24 h, whose axis starts there), a published scalar read from a field the source writes only every so many hours (the source’svariableStepHours: ECMWF’s 24-hour precipitation probabilities, one window ending every 12 hours from +24 h on a three- and six-hourly run, whose axis is the run’s thinned to those hours), and a static field (the terrain, one frame at the analysis). A reader takes a bundle’s frames at the times its own axis lists and has no frame of it between them. - A bundle on a grid family of its own takes
latitude_<family>andlongitude_<family>,<family>being exactly the stringdiscover.bundle_grid_familyreturns for it: the id of the companion file family its inputs are read from (pgb, the CFSv2 pressure levels on their 1° grid, solatitude_pgb). Every bundle of one family shares the pair, as the primary grid’s bundles sharelatitude/longitude. A family id matches^[a-z][a-z0-9]*$. - The decision is the rule, not a comparison of axes, so it is a function of
the source registry and the bundle id alone
(
discover.store_dimensions): a rate getstime_prateeven on a build whose axis happens to start past the analysis. A fanned-out job building a subset of the bundles therefore writes the same objects a whole build does, and every job writes the primary coordinates it needs, the same bytes each time. A multi-variable bundle’s arrays share one set of names. - Two bundles naming one coordinate carry the same document and bytes for it; a writer refuses to merge them otherwise.
A bundle’s dimension names are time or time_<its bundle id>, then
latitude and longitude, or latitude_<family> and longitude_<family>
with one family id matching ^[a-z][a-z0-9]*$. On a grid with a projection
block, and only there, the last two are y and x, or y_<family> and
x_<family>. Any other name is invalid, and so is a bundle whose names
disagree with its grid block. The array crs belongs to no dimension: a
bundle uses it by its variables’ grid_mapping, and every projected bundle
of a store shares it, since a family differs in grid and not in projection.
Manifest
The manifest’s shape, schema v5, is
schemas/manifest.schema.json, which is
normative. The shell checks it with the generated validator before the
rules a schema cannot say; the three hand validators
(xuebuild/manifest.py, encode/manifest.rs, web/src/data/manifest.ts)
hold the rules below, the registered dataset and the core set, and
tests/test_schemas.py holds the writers’ manifests to the schema. A
manifest entry’s zarr descriptor is
unchanged in shape: {path, byteLength, crc32}, or the segmented form
(see “Segmented stores”).
pathnames the shared store of the entry’s tier:bundles.zarron the bundle,bundles.half.zarron its half variant, and so on. Every entry of a tier carries the same path. The validators (xuebuild/manifest.py,rust/xue/src/encode/manifest.rs,web/src/data/manifest.ts) exempt exactly these paths from the duplicate-path rule: a map store’s path, or a segment’s, whose final path component is exactlybundles.zarrorbundles.<tier>.zarr,<tier>a non-empty run of lowercase ASCII letters other thanseries(any such tier, not onlyhalf,quarterandeighth). Every other path — a container, a series store (sobundles.series.zarrtoo), a poster, a one-bundle store — stays unique in the manifest.byteLengthis the bundle’s share: the objects of its variable arrays (eachzarr.jsonand shard) and of the coordinate arrays it uses (eachzarr.jsonand chunk). The group document is not counted. It is what a viewer downloads for that bundle alone, which is what the delivery sizes and a tier’sbandwidthare computed from.crc32is the CRC-32 of the store’s group document, identical on every entry naming the store.
A run that ships a column store names it in the manifest’s
optional top-level columns, beside bundles: {path, byteLength, crc32},
the store’s root relative to the manifest, the sum of every object in it and
the CRC-32 of its group document. path is a relative path with no ..
component whose final component is exactly columns.zarr, and it is unique
in the manifest like any other. The manifest schema stays 5: a reader that
does not know the field reads the run without it. A showcase case and a
round of a rolling window have none.
Fan-out and assembly. A publish built one bundle group per job
(build-bin --bundles) writes, in each job, its bundles’ arrays and
coordinates into the run’s bundles[.<tier>].zarr/ and a partial group
document bundles[.<tier>].zarr/zarr.part.<first bundle id>.json — the
group document above over that job’s bundles alone, its first bundle (in
manifest order) naming it — and no zarr.json. The job’s partial manifest
carries the part’s CRC-32 as crc32. Parts are local: the uploads exclude
them. assemble-run merges the parts of each store into its group
document, in manifest order, writes it, and stamps its CRC-32 on every
entry naming the store; a bundle in two parts, a part’s bundle the manifest
does not name with that store, or a bundle no part carries is an error. A
whole build writes its part and its group document the same way, and
removes the part; tests/test_assemble.py holds split = whole.
Top-ups. A top-up builds only the bundles the live run lacks, and merges
their parts onto the live group document, fetched from the bucket: a
part’s bundle replaces the live one, the live bundles keep their metadata
and array documents. The new group document is written over the live one’s
path under a new CRC-32, which every entry naming the store — the live ones
too — then carries, so nothing is served under an unchanged ?v=. The
arrays already on the bucket are not touched. The live manifest’s columns
is kept only when no bundle the top-up built is a member of the source’s
column store and the source still lists one; otherwise it is dropped and
the column store is built anew from the run as topped up.
Reading
What a player needs from a store, in the order it needs it. The frontend’s
own reader (web/src/decode/zarr/) is one implementation; the rules are the
profile’s.
- The group. A reader opens a bundle by (store, bundle id): the
store path from the bundle’s manifest entry, and the entry’s
variable. Fetchzarr.jsonat the store’s root under the entry’s?v=. Onxue_profile2,attributes.xue_bundles[<bundle id>]is the bundle metadata verbatim; onxue_profile1,attributes.xueis: the grid, the time axis, the variable set with their codebooks and GRIB2 parameter blocks. It is parsed by the rules ofbundle.md, “Metadata JSON”, wherever it comes from. A reader must refuse a group with anxue_profileit does not implement, a profile-1 group withoutxue, a profile-2 group whosexue_bundlesis missing, empty or not an object, and a profile-2 group without the bundle asked for. Grid and axis checks are against that bundle’s metadata, never the store’s other bundles. A cache keyed by store path (the group, the coordinates, a shard index) serves every bundle of the tier. - Each array. Fetch
<id>/zarr.jsonfor every variable the bundle’s metadata lists (the array’s name is the variable’sid;numericIdis the handle a player’s own protocol uses), exactly as for a one-bundle store. Validate before trusting:uint8(oruint16, on a series store only), three dimensions, a regular chunk grid, exactly onesharding_indexedcodec, an inner chain of[bytes, zstd]or[xue.delta{axis: 0}, bytes, zstd]whosebytesis little-endian ({"endian": "little"}, which auint8array may leave out;bigis refused), index codecs[bytes, crc32c]little-endian,index_locationstartorend,fill_valuethe variable’snodataCode, every code of its codebook within thedata_type’s range (255 or 65535), and an outer chunk equal to[shardFrames, tileRows × tileHeight, tileColumns × tileWidth]withshardFramesa positive multiple of the time chunk (the whole axis rounded up on a store this revision writes, six on one written before). Every array of one bundle is cut the same way. The tiling this yields (tileWidth,tileHeight,tileColumns,tileRows) is the same shape the container reports, and a viewport maps to a rectangle of inner chunks the same way. - Locating a frame. A frame’s index on the axis is its position in
frameOffsets(or its distance fromfirstFrameOffsetinframeSteps), its time chunk isfloor(index / timeChunk), and its frame within the chunkindex mod timeChunk. The time chunk is fixed at six on a regular grid and may straddle two of the container’s groups (GFS: from the change of step at 120 h on); a reader never consults the container’s grouping. The time chunk lives in shardfloor(timeChunk × timeChunk / shardFrames)(shard 0 on a store this revision writes) as the objectc/<shard>/0/0, and its tiles are thetileCountconsecutive index entries from position((timeChunk × timeChunk) mod shardFrames) / timeChunk × tileCount, tiletin row-major order,tileColumnsper row. - The shard index. Read the shard’s index once, on the first chunk wanted
from it:
16 × chunksPerShard + 4bytes at the end of the shard (index_location: "end", fetched as the HTTP suffix rangebytes=-Nwithout knowing the object’s length) or at its start (bytes=0-(N−1)). Verify the trailing CRC-32C over the pairs before using any offset; a pair of2^64 − 1is a chunk the shard never held, which reads asfill_valuethroughout. Hold the index for the session: on a store this revision writes it is the array’s whole index, so every later frame, viewport and series locates its chunks without another dependent request. It is the container’s structural prefix in Zarr’s terms. - Inner chunks. Fetch
[offset, offset + nbytes)of the shard. Decompress the Zstandard frame to exactlytimeChunk × tileHeight × tileWidthelements of thedata_type— bytes onuint8, twice as many bytes, little-endian, onuint16(refuse a frame without a content checksum, a checksum that does not match, or an output of any other length) and, under the delta chain, replay the running sum along the frame axis, modulo 256 or 65536. This is the container’s chunk path;decodeChunkin the WASM decoder does exactly it for bytes that did not come out of a.xueindex. - Trimming the padding. An inner chunk is stored whole. Its rows past
height, its columns pastwidth(the last tile row and column) and, in the last time chunk, its frames pastframeCountare padding: copy onlymin(tileHeight, height − row)rows ofmin(tileWidth, width − column)cells for the frames that lie on the axis. - Coalescing ranges. A shard’s inner chunks are contiguous in tile order, so a tile row is one contiguous span of the object. A reader that issues one range per inner chunk pays one round trip per tile: a 6 × 4 tile viewport costs 24 requests where the container costs 4. The profile’s recommendation is to gather the ranges of one shard that a read needs, sort them by offset, merge neighbours whose gap is small (the frontend uses 64 KB), and fetch each run as one range; the over-read of a merged gap costs less than the round trip it saves. With that, a global view is one range per time chunk, a viewport one range per tile row per time chunk, and a point series one chunk per time chunk, plus one index read per shard the reader has not seen, which on a store this revision writes is one per array, at open.
A series costs opening plus timeChunks requests, the container’s own
shape (its prefix plus one chunk per group), independent of the frame
count.
Series store
A series store is the same bundle’s quantized codes cut for the other access pattern: one cell’s whole series. It is a one-bundle store (profile 1) except for the geometry of its arrays, so every rule above applies unchanged; it is never shared, one bundle per store.
- The store’s root is
<bundle>.series.zarr, and its group document carries the bundle’s metadata inattributes.xue, each variable’squantizationthe codes this store holds (below),xue_profile1. Both stores name the same run of the same bundle; a manifest entry carries the map store aszarrand the series store asseries, each a{path, byteLength, crc32}descriptor. The series descriptor is full-resolution only and absent wherever the pipeline does not derive one. A reader dequantizes a series with this store’s metadata, never the map store’s: the two may hold one variable under different codebooks. - Widened variables. A variable whose registry entry carries a
seriesQuantization(registry.md) is written into every series store under that codebook, as sixteen-bit codes, in place of the profile’s byte codebook; every other variable keeps the map store’s codes byte for byte. Its entry of the group’svariables, its array’sattributes.xue.variable, CFscale_factor/add_offsetand_FillValue, and the array’sfill_valueare all that codebook’s. The codes are quantized from the same field as the map store’s byte codes, in the same pass, never from the byte codes. Only series stores widen: map stores, tiers, containers and column stores keep their byte codes. - An array’s
data_typeisuint16exactly when its variable’squantization.nodataCodeis above 255, anduint8otherwise. A reader takes the width fromdata_typeand requiresfill_valueto be thenodataCodeand every code of the codebook to fit the type. Auint16array’s innerbytescodec is{"name": "bytes", "configuration": {"endian": "little"}}; auint8array keeps{"name": "bytes"}, so every byte store’s bytes are what they were. A reader acceptsendianabsent onuint8only, orlittle, and refusesbig. - Every variable array is
uint8oruint16of shape[frameCount, height, width]and carries exactly onesharding_indexedcodec, withchunk_shape = [frameCount, blockHeight, blockWidth]— the whole axis of one spatial block — and the outer chunk (shard) the whole array rounded up to whole blocks:[frameCount, ceil(height/blockHeight) * blockHeight, ceil(width/blockWidth) * blockWidth]. The array’s ownchunk_shapeis the authority for the block, as it is the authority for the time chunk above. - The inner codec chain is the variable’s, exactly as the map store:
[xue.delta{axis: 0}, bytes, zstd]on a PREVIOUS variable and[bytes, zstd]on a RAW one. The delta runs over the whole axis, so an inner chunk is the variable’s whole temporal residual cube for one block. Unlike the map store, which leavesxue.deltaoff so a generic Zarr client needs nothing registered, the series store defaults to it: it is the layout’s own predictor, and its only readers already decode it. On auint16array the delta is element-wise modulo 65536:stored[0] = code[0],stored[t] = code[t] − code[t−1] (mod 65536)along the inner chunk’s time axis. Precipitation stays RAW, widened or not. fill_valueis the variable’snodataCode; the rows and columns past the grid are written as it, before the delta. There is no frame padding: the axis is the time chunk.- An inner chunk’s payload is the Zstandard frame (level 15, content
checksum) of the padded, delta-coded
[frameCount, blockHeight, blockWidth]block in row-major order: one byte per code onuint8, two little-endian bytes onuint16. - The three coordinate arrays are the primary ones, over the bundle’s own axis.
The block is a per-source registry value; 8 x 8 is what the reference
pipeline writes. Which bundles ship a series store at all is the source
registry’s series_bundle_ids — opt-in per source, so a rollout can watch
one dataset’s storage and read counts before the next: the GFS
0.25-degree run for tmp2m, dpt2m, prate, wind10m and prmsl, and
sflux for tmp2m, prate, dswrf and wind10m. A variable that carries a
seriesQuantization (bundle.md, “Series codebooks”) is
widened wherever it ships a series store; every variable those bundles hold
carries one. Measured
on gfs.2026090918 (161 frames, 0.25° global), an 8 x 8 byte-coded series
store is 37.2 MB against the bundle’s 37.0 MB for tmp2m (101.4 MB against
100.8 for the two-variable wind10m), its shard index is 262 KB per array
(16 bytes per inner chunk), and one cell’s whole series is a 1.9 KB median
chunk.
Reading one cell’s series: one inner chunk of the block containing the cell, which holds every frame, plus the shard index once per store. A bilinear read of four neighbouring cells is one chunk where they share a block and two to four where they do not. A series store is read for series only: a frame read through it would fetch one tiny chunk per block, which is not what it is cut for.
Segmented stores
A rolling window (radar, satellite, the aurora nowcast) is rebuilt every few minutes, but between two rounds only its newest frames change. Its map stores are therefore published cut along time: each resolution tier’s shared store is cut into shared segments, every one an ordinary shared store under this profile, and each bundle’s segments’ axes concatenate into the bundle’s.
A segment holds the frames of one clock interval: an hour for a feed whose frames are less than an hour apart, six hours (from 00, 06, 12 and 18 UTC) for an hourly or slower one. The window’s newest segment is partial, as is the oldest when the window does not start on a segment boundary; every other one is whole and comes out the same, byte for byte, in every round that holds it.
The interval is the store’s: decided from every bundle’s frames together, so the bundles of one tier are cut at the same boundaries. A segment holds every bundle of the tier that has a frame in its interval (a bundle with none there is absent from it), in
xue_bundlesorder.In a segment each bundle is the bundle over its own frames there:
xue_bundles[<id>]is the bundle’s metadata withrunTimethe bundle’s first frame in the segment and thetimeblock recomputed over its frames by the rules ofbundle.md, “Time Axis” (the coarsestunitSecondsthat fits,frameStepwhen uniform,frameOffsetswhere a slot is missing). Everything else in the metadata, its dimension names, its codec choices and the cutting of every array are the bundle’s.Segments live beside the run directories, at
<model>.segments/<YYYYMMDDHHMM>/<digest>/bundles[.<tier>].zarr: the segment’s start in UTC, then eight hex digits of a SHA-256 over what the whole shared segment is a function of. The digest’s input is, bundle by bundle in the segment’sxue_bundlesorder: the bundle id’s UTF-8 bytes and a newline (0x0a); its three dimension names as the JSON array["time", "latitude", "longitude"](comma-space separated); its segment metadata as its canonical JSON bytes (binformat.metadata_json_bytes); the JSON array[<delta>, "<index location>"]([false, "end"]); then for each variable id in sorted order, its UTF-8 bytes followed by its codes, frame by frame. The same contents always land under the same path, and different contents never do, so a round names a segment an earlier round published instead of writing it again, and a client’s cache of it stays valid from round to round. Like every other published object, a segment is never rewritten under the same path.In the manifest, a segmented
zarrdescriptor carriessegments, a non-empty list of{path, byteLength, crc32}store descriptors in ascending time order, andbyteLength, their sum. It carries nopathorcrc32of its own. A segment’s path is relative to the manifest and may climb out of the round’s directory with at most two leading..components (a round sits at<model>.<run>/<HHMM>/), and nowhere else:A
seriesdescriptor is never segmented. Every bundle of a shared segment names the same path andcrc32(the segment’s group document’s) with its ownbyteLength, its share as above; the shared-path exemption applies to a segment’s path by the same final-component test.A reader opens every segment by (segment, bundle id), refuses a list whose segments differ, for that bundle, in anything but
runTimeandtimeor whose frames are not strictly ascending across segments, and plays the concatenated axis: frameiof the bundle is the frame at its absolute time in the segment that holds it.
Cutting is a publishing step over finished stores (build-bin --round --segments, xuebuild/segments.py): it reads the codes back and writes
each segment with the reference writer, whichever encoder built the round,
and it skips every segment the live round already names for every bundle it
holds. A round of the previous layout (one store per bundle) is cut into
one-bundle segments, <bundle>[.<tier>].zarr, whose digest is the same
input as above for its one bundle without the id and dimension prefix. The
window’s posters and its window.json stay in the round’s directory.
Polar store
A polar store carries radar sweeps in the radar’s own coordinates — one
row per beam, one column per range gate — instead of a latitude-longitude
grid. It is the profile’s second branch and the one a single-site radar
product writes (nexrad.md); it has no .xue counterpart and
is never derived from a bundle. Everything in “Array metadata” and
“Reading” applies except where this section says otherwise: the shard, the
index, the codecs and the reading of an inner chunk are the same; the
dimensions, the chunking and the attributes are its own.
A store is one product over one or more rounds, the intervals a product delivers its sweeps in. A polar store is never shared. A round store holds one round,
<round directory>/<product>.zarr(nexrad.202610050805/n0b.zarr); a window store holds every round of a closed window, one store per product for the whole of it (a showcase case’s,nexrad.md§1). The group’s attributes carry axue_polarblock in place ofxueandxue_profile; itsversionis this branch’s version,1. A reader tells the branches apart by which one is present and refuses a group carrying both or neither, or aversionit does not implement.One data array, named by the product (
n0b),uint8of shape[site, scan, azimuth, range]withdimension_namesexactly those four.siteindexes the radars that scanned in the store’s rounds,scanthe sweeps of one site in time order,azimuththe beam andrangethe gate.Chunking. The inner chunk is one site’s sweeps of one round:
[1, depth, azimuth, range], wheredepthis the largest number of sweeps any site has in any one of the store’s rounds. Inner chunk[s, r, 0, 0]is sitesin the store’s roundr, soscanruns over the whole store, round after round,rounds × depthlong, and scan slotr × depth + kis the site’sk-th sweep of roundr. The outer chunk (shard) is the whole array, soc/0/0/0/0is the only data object and its index holds one pair per site and round, in that order; a site with no sweep in a round has the never-written pair there. A site’s round with fewer sweeps is padded todepthwithfill_value; whether a sweep exists is said byscan_time, never by the codes. A round store is the one-round case: its index holds one pair per site.Inner codec chain
[bytes, zstd](level 15, content checksum). There is noxue.delta: consecutive sweeps are minutes apart and a difference against the previous one is larger than the sweep itself. Index codecs,index_locationand the never-written pair are as above.fill_valueis0.Codes. A sweep’s codes are its source’s own, unchanged: a linear codebook over a contiguous run of codes plus reserved codes that carry a state rather than a value. The data array’s attributes declare both, in their own
xue_polarblock:value =
code × scale + offsetforminimumCode ≤ code ≤ maximumCode; a reserved code has no value and a reader must not dequantize, filter or interpolate across it as one.signConventionis present on a radial velocity and ispositive_away(motion away from the radar is positive).scale_factor/add_offsetlet a CF client dequantize;flag_valuestells it which codes are not values. There is no_FillValue: code 0 is data (no echo), not missing.Geometry. Beam
jcovers azimuths[azimuthStart + j × azimuthStep, azimuthStart + (j + 1) × azimuthStep)in degrees clockwise from true north; gateicovers slant ranges[rangeStart + i × rangeStep, rangeStart + (i + 1) × rangeStep)in kilometres from the antenna. A source whose beams do not start on this grid is binned by beam centre.Coordinates, beside the data array, each one chunk under
[bytes](little-endian), as a grid store’s coordinates are:array dtype shape meaning azimuthfloat32[azimuth]beam centre, degrees true rangefloat32[range]gate centre, km slant range site_latitude,site_longitudefloat64[site]antenna, WGS84 degrees site_heightfloat32[site]antenna, metres above mean sea level scan_timeint64[site, scan]sweep start, Unix seconds UTC; -1for a padding sweepelevationfloat32[site, scan]sweep elevation angle, degrees; NaNfor paddingThe group’s block is
{"version": 1, "product": "n0b", "round": "2026-10-05T08:05:00Z", "sites": ["TLX", "TBW", …]}: the product, the round’s UTC minute, and the sites in index order by the source’s own identifiers. A window store carries"rounds": ["2023-03-24T23:05:00Z", …]in place ofround: its rounds’ UTC minutes in chunk order, oldest first. A block carrying both or neither is refused.Mapping a gate to the ground is the reader’s: the profile fixes the coordinates, not the projection. The reference reader uses the standard-refraction (4/3 effective earth radius) beam model from the site’s WGS84 position.
Reading one site’s round: the group, the array’s
zarr.json, then the shard index (suffix range) and the site’s inner chunk of that round; a product that publishes the chunk spans (nexrad.md§4) lets a reader skip the index and read the chunk directly, one range per site per round in either kind of store.
Network store
A network store carries a quantity that lives on the reaches of a
river network — one value per reach per frame — instead of on a grid. It
is the profile’s third branch and the one a river case writes
(river.md); it has no .xue counterpart and is never
derived from a bundle. The reaches’ geometry is not in the store: it is a
GeoParquet file beside it, cut so that one index serves both. Everything
in “Array metadata” and “Reading” applies except where this section says
otherwise: the shard, the index, the codecs and the reading of an inner
chunk are the same; the dimensions, the chunking and the attributes are
its own.
A store holds one track: one product over one run of frames, an analysis window or one forecast cycle. A network store is never shared. The group’s attributes carry a
xue_networkblock in place ofxueandxue_profile; itsversionis this branch’s version,1. A reader tells the branches apart by which block is present and refuses a group carrying more than one ofxue(orxue_bundles),xue_polar,xue_networkandxue_columns, or aversionit does not implement.The block:
runTimeis the cycle of a forecast and the first frame of an analysis window.timefollowsbundle.md, “Time Axis”, exactly: offsets fromrunTimeon the coarsest unit that fits,frameStepwhen uniform,frameOffsetsotherwise.geometrynames the GeoParquet by a path relative to the directory holding the store, its length and the CRC-32 of its bytes, its row count (featureCount) and its row group length (rowGroupRows).variableslists the one variable,streamflow, with its codebook.One data array,
streamflow,uint8of shape[frameCount, featureCount]withdimension_names["time", "feature"], carrying exactly onesharding_indexedcodec. Featurefis rowfof the GeoParquet.Chunking. The inner chunk is
[6, rowGroupRows]: six frames of one row group’s reaches, time chunktcovering frames[6t, 6t + 6)as in a grid store. The outer chunk (shard) is the whole array rounded up to whole inner chunks,[6 × ceil(frameCount / 6), rowGroupRows × ceil(featureCount / rowGroupRows)], soc/0/0is the only data object; its index holds one pair per inner chunk in row-major order, time chunk by time chunk and within each the row groups in order, followed by the CRC-32C of the pairs. Frames past the axis and features past the last row are stored asfill_value. One frame is one contiguous run of the shard (every row group of one time chunk), and one reach’s series is one chunk per time chunk.Inner codec chain
[xue.delta{axis: 0}, bytes, zstd](level 15, content checksum): consecutive hours of one reach differ by a code or two. A reader must accept[bytes, zstd]as well. Index codecs[bytes little-endian, crc32c],index_locationend, and the never-written pair are as above.fill_valueis the codebook’snodataCode, 255.Codes. The
log1pcodebook ofbundle.mdwithtrace0.01,scale1.0 andmaximum100000 (m³/s): code 0 is a flow below 0.01 m³/s, codes 1–253 the logarithmic grid, about 4.7 % apart, 254 a flow above the maximum, and 255 no value — a reach the model does not route, such as one inside a lake, or a time it has none. The data array’s attributes repeat the variable asxue_network.variableand carry_FillValue255; there is no CF packing, as for anylog1pvariable.Side arrays, beside the data array, each one chunk under
[bytes](little-endian), as a grid store’s coordinates are:array dtype shape meaning feature_idint64[feature]the reach’s identifier in its source (NWM feature_id)timeint64[time]the frame’s valid time, Unix seconds UTC baseflowfloat32[feature]the reach’s usual flow before the event, m³/s; NaNwhere unknownThe group carries consolidated metadata, written last, and the store’s
crc32is the CRC-32 of its group document, as for a grid store.
The GeoParquet. The reaches are a GeoParquet 1.1 file: column
geometry, WKB LineString in WGS84 longitude and latitude (no crs
key, GeoParquet’s OGC:CRS84 default); a covering.bbox column bbox, a
struct of xmin, ymin, xmax, ymax in float32 rounded outward so
the box always contains the line; and feature_id (int64), order
(int8, the stream order) and gage (string, nullable: the gauge on the
reach, if any), in the order feature_id, order, gage, geometry,
bbox. Rows are sorted along a Hilbert curve by the length-weighted
centroid of each line (a 2^16 grid over the network’s extent), and cut
into row groups of exactly rowGroupRows rows (4096), the last one
shorter, zstd-compressed. Row group g holds rows [g × rowGroupRows, (g + 1) × rowGroupRows), the reaches of the store’s feature chunk g, so
a reader that wants one area reads the row groups whose bbox statistics
meet it and then exactly the matching inner chunks, and a reader that has
a row from a click knows the chunk without a lookup.
Measured on the Guadalupe 2025 case (10,940 reaches of NWM v3.0, Hilbert
order): the GeoParquet is 1,114,663 bytes with a 6,579-byte footer and row
groups of 415,954, 394,267 and 297,851 bytes. The 73-frame hourly
analysis shard is 145,650 bytes under the delta chain and 163,086 under
[bytes, zstd]; the 18-frame forecast shard 33,631 and 38,768. The side
arrays weigh 132 KB per store, most of the store at these sizes: whole
stores are 286,352 and 173,890 bytes.
Reading one frame: the group, the array’s zarr.json, the shard index
(suffix range), then one range covering the frame’s time chunk. Reading
one reach’s series: the same index, then one chunk per time chunk at the
reach’s row group.
Column store
A column store carries a forecast run’s isobaric families and the
surface fields a profile stands on, cut so that one cell’s column, every
level over the whole axis, is one chunk per quantity. It is the profile’s
fourth branch. It is cut from the codes of the run’s published stores and
holds exactly those codes: nothing in it is quantized again. A uint8 array
is cut from the map stores, so a value read from it is the value the map
shows for that cell; a uint16 surface array is cut from its bundle’s series
store (“Series store”), so a value read from it is the one a pinned point
reads there. A run
without one is complete; a reader then takes a column from the map stores,
one bundle at a time. Everything in “Array metadata” and “Reading” applies
except where this section says otherwise.
- One store per run,
<model>.<run>/columns.zarr, full resolution only. It is never shared, never segmented and has no reduced tiers. The manifest names it incolumns(see “Manifest”). - The group’s attributes carry an
xue_columnsblock in place ofxueandxue_profile; itsversionis this branch’s version,1. A reader tells the branches apart by which block is present and refuses a group carrying more than one, or aversionit does not implement.
Arrays. An array is one quantity. A levelled array
holds it on several isobaric surfaces, shape [frameCount, levelCount, height, width], dimension_names ["time", "level", "latitude", "longitude"]. A surface array holds one field that has no level, shape
[frameCount, height, width], dimension_names ["time", "latitude", "longitude"]. An array on a time axis other than the store’s has the
dimension time_<array> in place of time, and a levelled array whose
levels are not the first levelled array’s has level_<array> in place of
level, <array> being its id. Version 1 is for regular and Gaussian
grids; a run on a projected grid has no column store.
data_typeisuint8, except on a surface array whose variable its bundle’s series store widens to sixteen-bit codes and whose bundle the run ships a series store of: that array is cut from the series store and isuint16, as the series store’s array is. A levelled array is alwaysuint8. As in a grid store,data_typeisuint16exactly when the members’nodataCodeexceeds 255, and a reader refuses an array whose type is not the one its members’ codebook needs, auint16levelled array, and a code of the codebook or afill_valuethe type does not hold.Each array carries exactly one codec,
sharding_indexed.Inner chunk:
[frameCount, levelCount, blockHeight, blockWidth](surface[frameCount, blockHeight, blockWidth]): the whole axis and every level of one block of cells. The writer’s block is 8 x 8; a reader takes it from the array document.Outer chunk (shard):
[frameCount, levelCount, shardHeight, shardWidth](surface[frameCount, shardHeight, shardWidth]).shardHeightandshardWidthare whole multiples of the block andshardWidthis at least the grid’s width, so the shards are bands of rows. The writer’sshardHeightis 96, twelve blocks, and itsshardWidththe width rounded up to whole blocks. The band keeps an object small enough (a few hundred MB at most) for a CDN that will not cache one over 512 MB, and its index at 34,564 bytes on a 0.25-degree global grid where one index over the whole array would be 262 KB.Shard
sholds rows[s × shardHeight, (s + 1) × shardHeight)and is the objectc/0/0/<s>/0(surfacec/0/<s>/0),sfrom0toceil(height / shardHeight) − 1. The last band’s chunk may run past the grid, as the outer chunk of a grid store may.Inner chunks of a shard are in row-major order over its blocks: block
(r, c)of a shard is index entryr × (shardWidth / blockWidth) + c. A block partly past the grid is stored whole, its cells past the grid asfill_value. A block wholly past the grid is never written: its index pair is2^64 − 1twice. Any other block is written, whatever it holds. A reader reads a never-written block asfill_value.Shard index:
16 × chunksPerShard + 4bytes with the layout and the CRC-32C of a grid store’s,chunksPerShardbeing(shardHeight / blockHeight) × (shardWidth / blockWidth). Offsets are from the start of the shard.index_locationis"start", so the index is the plain rangebytes=0-(N−1), which a browser sends without the CORS preflight a suffix range costs. A reader accepts"end"too.Inner codec chain:
[xue.delta{axis: 0}, bytes, zstd](level 6, content checksum) on an array whose variables are all predicted from the previous frame,[bytes, zstd]on one whose variables are all RAW, and on a one-frame array.bytesis{"name": "bytes"}on auint8array and{"name": "bytes", "configuration": {"endian": "little"}}on auint16one; a reader accepts the order unsaid onuint8only and refusesbig. Onuint16the delta is modulo 65536. The level is 6 where the other stores’ is 15 for the cut time: a run’s whole column store is compressed on one machine after the run is live. Measured on an M3 Max, level 6 is 7 times faster than 15 for 8 % more bytes on an ECMWF temperature, and 4 times faster for 1.4 % more on a GFS relative humidity. A reader does not depend on the level. The predictor is the variable’s, the one the series store uses; an array mixing the two is an error in the writer. The delta runs along time only: a further difference along the levels made the arrays 20 % larger. A reader follows the codec chain.fill_valueis the variables’nodataCode, which is the same for every variable of one array (an error in the writer otherwise).
Group document. The block:
model,product,runTime,profileandgridare those of the bundles’ metadata, which every member shares;timeis thetimeblock of the first array’s bundles (bundle.md, “Time Axis”). An array whose bundles’ block differs carries its owntime. All members of one array share one axis.arrayslists the arrays; the writer lists levelled arrays first. Anidmatches^[a-z][a-z0-9]*$, is unique and is none oftime,level,latitudeandlongitude. A surface array’s id is its variable’s.levelsis present on a levelled array and only there: positive integers in hPa, strictly descending.membersis index for index with it. A surface array has exactly one member.- A member names the bundle its codes come from, which is the id a reader
asks by, and carries that bundle’s
variableobject verbatim (“Metadata JSON”), codebook included: on auint16array the series store’s variable, its sixteen-bitquantizationwith it. The codebooks of one array’s levels may differ in offset and scale. A variable id occurs once in a store.numericIdinside a member is the bundle’s own and means nothing here. Two arrays may name one bundle: a wind bundle’s two components are the arraysugrdandvgrd. shardsholds the CRC-32 of each of the array’s shard objects, in order. It makes the group document, and so the store’scrc32, depend on every byte of the store: two stores of one run that differ in any object differ in their?v=. The writer writes it; a reader needs it for nothing.consolidated_metadatais present, inline, and holds every array document verbatim: the data arrays in the order ofarrays, thentime,level(where a levelled array exists),latitude,longitude, then eachtime_<array>andlevel_<array>in the order ofarrays. A reader takes an array’s document from it and fetches no<array>/zarr.json; it holds each data array’s document to the block (type, shape, dimension names, onesharding_indexedcodec, chunk shapes, chain, index codecs,fill_value) before using it. The document is serialized as every document of the profile is and is written last; its CRC-32 is the store’scrc32.
Array attributes. xue_columns, {"array": "<id>"}; long_name and
units where every member has the same label and the same unit;
scale_factor and add_offset only where every member has the same linear
codebook (a levelled array whose levels differ has no CF spelling, and a
client dequantizes it by the members); _FillValue. In that order.
Coordinates. time, latitude and longitude are a grid store’s
(“Coordinates”), the true Gaussian rows included; time_<array> is the same
encoding over that array’s axis. level (and level_<array>) is int32
hPa in the array’s order, one chunk under [bytes] (little-endian), fill
0, attributes standard_name: "air_pressure", units: "hPa", positive: "down".
Reading one cell’s column. Read the group document once per run. For
each array, s = floor(row / shardHeight); fetch that shard’s index once
and verify its CRC-32C; the cell’s block is entry floor((row − s × shardHeight) / blockHeight) × (shardWidth / blockWidth) + floor(column / blockWidth). Fetch [offset, offset + nbytes), decompress it to exactly
frameCount × levelCount × blockHeight × blockWidth codes (bytes, or
little-endian u16 on a uint16 array), replay the running sum along time
under the delta chain, and take the cell at (row mod blockHeight, column mod blockWidth): frameCount × levelCount codes.
A value is the member’s codebook applied to its level’s codes. Neighbouring
cells of a block need no further request.
The size against the map store depends on the axis. On one GFS run’s fifteen
levels, hourly over most of the axis, the five levelled arrays measured 2.99
GB at level 15 against the map store’s 2.97 GB, one cell’s blocks about 0.18
MB in five reads; blocks of 4 x 4 and 16 x 16 cells were 8 % and 3 % larger.
On ECMWF’s three-hourly axis the tmp array measured 32 % over the map
store’s arrays. The delta is smaller than RAW on the GFS run and was 6 % larger
on that array; an array still takes the one chain its variables’ predictor
says. Other fields and sources were not measured.
Writing. Two writers, the reference (xuebuild/columns.py,
write_column_store) and the wheel’s (xue.write_columns), take one plan
document, read the rest from the map stores it names and write the same
bytes for one libzstd version, whatever number of processes or threads cut
the shards. build-columns builds the plan from the source’s
column_arrays, the registry and the run’s manifest, runs either writer and
attaches the store to the run. A surface array’s member names its bundle’s
series store (the manifest entry’s series path) where that store widens
the variable (it has a series codebook, docs/registry.md
seriesQuantization, and its bundle is one of the source’s series bundles)
and the manifest names one; every other member names the map store. The
plan:
store is a map store of either profile, or a bundle’s series store,
relative to the run’s directory; of it a writer opens zarr.json, whose
consolidated metadata holds the array documents, and <variable>/c/0/0/0.
A series store’s array is read as any grid store’s is: its tiles are its
blocks and its one time chunk the whole axis. levels is present on a levelled
array only. A writer refuses a plan whose columnsPlan is not the integer 1, an unknown
key or predictor, no array, an array id or a variable twice, an id the block
would refuse, levels that are not strictly descending positive integers
of at most 2147483647, one per member, or a surface array whose one member is not its id; members
whose model, product, runTime, profile or grid differ; members of
one array whose time or nodataCode differs; a projected grid; a map array
whose shape is not its bundle’s [frameCount, height, width], or that is
more than one shard; a nodataCode the array’s data_type does not hold,
or a data_type that is not the one its codebook needs; a levelled array
with a uint16 member; and an output
directory that exists. A cut that fails removes its output. Values are equal
here when they are the same JSON: 1 and 1.0 differ, key order does not
matter. An array that mixes predicted and RAW variables has no plan, nor has
a store whose members’ published isobaric surfaces are not its levels, and
build-columns attaches no store with an object over 512 MB.
Besides the codes, the bytes are fixed by these choices.
- The block’s keys, in order:
version,model,product,runTime,profile,time,grid,arrays; an array’s:id,time(if its own),levels(if levelled),members,shards; a member’s:bundle,variable.time,gridandvariableare the bundle metadata’s objects with their keys in their order and their numbers as the map store’s group document has them: an integer stays one, and a float is its shortest round trip with a fractional part. The two writers’ JSON libraries spell a float below 1e-4 or from 1e16 in magnitude (zero aside) differently, so no such number may occur in a codebook; the registry admits none.profileis copied with the other three. The arrays are in the plan’s order and the store’stimeis the first one’s. - The group document’s keys:
zarr_format,node_type,attributes(holdingxue_columnsalone),consolidated_metadata(kind,must_understand,metadata), as in a grid store. - A data array’s document is a grid store’s in every key and its order
(
zarr_format,node_type,shape,data_type,chunk_grid,chunk_key_encoding,fill_value,codecs,attributes,dimension_names; in the sharding configurationchunk_shape,codecs,index_codecs,index_location), with the attributes of “Array attributes” in that order.scale_factorandadd_offsetare thescaleandoffsetof the onequantizationobject, of typelinear, that every member carries identically. A coordinate’s document is a grid store’s coordinate document. - A shard is its index, then the payloads back to back in index order, the
first at offset
16 × chunksPerShard + 4, with nothing between or after them. A payload is one Zstandard frame over one whole block in C order (frame, level, row, column), little-endian on auint16array, compressed alone, level 6, content checksum and content size on. Under the delta chain the block is differenced along frames with its padding cells included, which arefill_valuein every frame. Every block the grid reaches is written, one that is allfill_valuetoo; the blocks of a band past the grid’s last row are the index entries after the written ones and are2^64 − 1twice. - A cell of a map array’s chunk that was never written is
fill_value.
Equivalence with the container
A build asked for .xue containers as well (format.md)
writes them and the stores from the same codes, so the two carry identical
codes by construction. tests/test_zarr.py holds a NumPy-only
read-back of every frame to the codes a store was written from, and the
container parity test (tests/test_native.py) builds both deliveries and
reads the container back through the wheel’s decoder. Compressed bytes are
identical where the layouts coincide (a store chunk covering exactly one of
the bundle’s groups on a tile the grid does not clip) under the delta chain
for a predicted variable and under either chain for a RAW one.
Part of the Xue specification, licensed under CC BY 4.0.
2 - Xue Bundle Metadata and Codes
A Xue bundle is one or more variables of one forecast run or observation
window, quantized to single-byte codes on the source’s native grid (a
series store’s widened variables to sixteen-bit ones, “Series codebooks”). This
document is normative for what every bundle carries whatever writes it down:
the metadata JSON and its schema versions, the quantization codebooks, and
the modulo-256 residual arithmetic. The published layout is a Zarr v3 store
(zarr-profile.md); the .xue container
(format.md) is the legacy layout every decoder keeps
reading. Both carry the codes and the metadata specified here unchanged.
The Python encoder (xuebuild/metadata.py, xuebuild/quantize.py,
xuebuild/temporal.py) is the reference; the native encoder and the Rust
decoder (rust/xue) are held to it by cross-language golden and parity
tests.
Conventions
- Metadata is UTF-8 JSON.
- All quantization rounding is round-half-up:
round(x) = floor(x + 0.5). Every rounded quantity in this format is non-negative, so this equals round-half-away-from-zero. Implementations must not use round-half-even (the behavior of Python’s built-inroundand the IEEE 754 default); a mismatch changes codes for values landing exactly on a half step.
Metadata JSON
The shape of a schemaVersion 3 or 4 document is
schemas/bundle-metadata.schema.json,
which is normative: a document that does not match it is not version 3 or 4
metadata. The sections below give the meaning of each field and the rules
across fields that a schema cannot say, which every reader checks after
the shape: the lowest version that fits, the one encoding of a time axis,
unique numericIds, and the halves of a GRIB2 value that are null
together. Versions 1 and 2 have no schema; their rules are this section’s
prose alone. tests/test_schemas.py holds the frozen container corpus
(tests/fixtures/v1/), the synthetic run’s containers, posters and stores,
and the committed stores to it; the shell checks a version 3 document with
the validator generated from it (web/src/schema/generated/), and the Rust
decoder’s tests tie the fields it reads to the names the schema gives.
Example (a single-variable GFS temperature bundle):
A bundle may declare more than one variable; the two 10 m wind components
ship together in one two-variable wind10m bundle. Every variable’s
quantization block must be one of the codebook types below.
numericId is a handle, unique within the bundle and meaningless outside
it: the variable’s position in a store’s group document, its variableId
in a container’s index (format.md, “variableId is
file-local”). The encoders here number the variables 1…n in the order they
are listed.
Metadata Schema Version
schemaVersion is the lowest metadata schema a reader must implement to
parse the file. It versions the metadata JSON only; the layout that carries
it is versioned on its own (a store’s xue_profile, a container’s
FixedHeader version).
schemaVersion | Introduces | Recognized by |
|---|---|---|
| 1 | — | a uniform whole-hour time axis declaring stepHours |
| 2 | Explicitly listed forecast hours | a whole-hour time axis listing hours |
| 3 | Per-variable GRIB2 identity, and a time axis in units it names | a parameter block on every variable (optionally with band / producer / aerosol / ensemble beside it), and a time block declaring unitSeconds |
| 4 | A grid on a map projection | a grid.projection block in place of the four regular grid fields; variables and time block as in version 3 |
An encoder must emit the lowest version that can express the file: the
highest version any single feature of the metadata requires, and no higher.
For the versions defined so far that is 4 when the grid carries
projection, otherwise 3 when the variables carry parameter, otherwise 2
when the axis lists hours, otherwise 1. A schemaVersion 3 file with a
uniform axis is still version 3, since the parameter block sets its floor, and
a parameter block is invalid below version 3. A file on a regular grid
never declares version 4, and a reader that does not implement version 4
refuses a projected file rather than misplacing it.
Decoders enforce both sides of that rule: they must reject a schema version they do not implement, and must reject a declared version higher than the lowest the metadata needs (see Error Handling). Rejecting unknown versions makes an older decoder reject a file it would otherwise misread; rejecting overdeclared versions gives any given metadata exactly one valid encoding. Every already published bundle stays valid and byte-identical under both rules.
Schema version 3 is what the reference encoder writes; versions 1 and 2 remain readable and are published by nothing. Because older decoders reject a version they do not implement, a decoder implementing a new version must be deployed before the first file at that version is published.
Variable Identity
From schemaVersion 3, every variable declares what it is in GRIB2’s own
terms, so a reader can recognize a field without matching on id strings.
The block is required on every variable of a version 3 file and invalid
below it.
The parameter block is a variable’s identity. Neither variableId (a
file-local handle) nor the id string carries it; the parameter triple and
the fixed surface do, and two files describe the same field exactly when
their blocks agree.
| Field | GRIB2 origin | Rule |
|---|---|---|
discipline | Section 0, octet 7 | 0–255 |
parameterCategory | Section 4, code table 4.1 | 0–255 |
parameterNumber | Section 4, code table 4.2 | 0–255 |
typeOfFirstFixedSurface | Section 4, code table 4.5 | 0–255 |
scaleFactorOfFirstFixedSurface | Section 4 | −127…127, or null |
scaledValueOfFirstFixedSurface | Section 4 | 0…4294967294, or null |
typeOfStatisticalProcessing | Section 4, code table 4.10 | 0–255, optional |
The surface value is scaledValueOfFirstFixedSurface × 10^−scaleFactorOfFirstFixedSurface
in that surface’s own unit. A surface that carries no value (“entire
atmosphere”, type 10, or a source that encodes the value as missing) writes
both halves as null, which is how GRIB2 encodes it; one half alone is
invalid. Both keys are always present.
typeOfStatisticalProcessing is absent for an instantaneous field and
present when the values are a statistic over the step. It distinguishes a
prate bundle whose source carried an instantaneous rate (GFS pgrb2) from
one derived by de-accumulating, de-averaging or differencing a window’s
total (ECMWF, GFS sflux, WOOF-NAM), which are otherwise the same parameter.
No other keys are allowed; a version 3 decoder must reject an unknown one, so any later addition is a new schema version. GRIB2’s local-use ranges (parameter numbers and surface types 192–254) need no special treatment: a local number is an ordinary number, and several variables below use one.
The identity written is the registered one, whatever record the encoder
read. Centres write the same quantity differently (ECMWF encodes its mean
sea level pressure as plain pressure on the mean sea level surface, its gust
as an interval maximum on the 10 m surface, its skin temperature as a
parameter of its own with no surface value), and the encoder’s registry
accepts such a record as an alias (another parameter number on the same
surface) or an alternate (a whole other identity: surface, value,
statistical process, unit) of the variable, so that GFS and ECMWF publish
one chart under one parameter block. The table notes each such
acceptance; none of them is ever written.
The identities this pipeline produces are below. This is not an admission
list: a decoder validates the shape of a parameter block, never its
contents against this table, and a file naming a parameter not listed here
is a well-formed file. The table says which fields a chart-aware reader (one
with a palette, a contour interval or a legend for the quantity) can
recognize; anything else it can still decode.
id | Parameter | Surface | Notes |
|---|---|---|---|
tmp2m | 0 / 0 / 0 | 103, 2 m | |
prate | 0 / 1 / 7 | 1, 0 | typeOfStatisticalProcessing: 0 when derived (ECMWF, sflux) |
ugrd10m | 0 / 2 / 2 | 103, 10 m | |
vgrd10m | 0 / 2 / 3 | 103, 10 m | |
ugrd100m / vgrd100m | 0 / 2 / 2, 0 / 2 / 3 | 103, 100 m | 100 m wind components, the turbine hub height; the wind100m bundle |
dswrf | 0 / 4 / 192 | 1, 0 | NCEP local parameter |
cref | 0 / 16 / 5 | 10, no value | Composite reflectivity, entire atmosphere; observed (the radar mosaic) or forecast (HRRR’s REFC, NCEP-local 0 / 16 / 196, accepted on input and never written) |
rqi | 209 / 8 / 0 | 102, 0 m | Radar quality index of the MRMS mosaic, 0–1, unitless. MRMS-local (discipline 209): no WMO parameter carries it, so the local identity is the one written |
gust | 0 / 2 / 22 | 1, 0 | Instantaneous surface wind gust (GFS). ECMWF’s 10fg / 10fg3, the same parameter on the 10 m surface (103, 10 m) as the maximum over the interval ending at the frame, product template 4.8, is accepted on input under this identity and never written; on ECMWF the series starts at the first step |
tcdc | 0 / 6 / 1 | 10, no value | Total cloud cover, entire atmosphere; the instantaneous record, not the interval average. ECMWF’s tcc, the ECMWF-local 0 / 6 / 192 on the ground surface as a 0–1 fraction, is accepted on input, scaled to percent, and never written |
cape | 0 / 7 / 6 | 1, 0 | Surface-based CAPE (not the mixed-layer variants on surface type 108). ECMWF’s mucape, the same parameter departing from surface type 17, the most unstable parcel’s level, is accepted on input and never written |
cin | 0 / 7 / 7 | 1, 0 | Surface-based convective inhibition in J/kg, never positive (not the mixed-layer variants on surface type 108) |
lcdc / mcdc / hcdc | 0 / 6 / 3, 0 / 6 / 4, 0 / 6 / 5 | 214 / 224 / 234, no value | Low / middle / high cloud cover, each its own parameter on its own layer surface; the instantaneous records |
vis | 0 / 19 / 0 | 1, 0 | Surface visibility, quantized in km |
dpt2m | 0 / 0 / 6 | 103, 2 m | 2 m dew point |
aptmp2m | 0 / 0 / 21 | 103, 2 m | NCEP’s 2 m apparent temperature |
pwat | 0 / 1 / 3 | 200, no value | Precipitable water, the column mass in kg/m² (a millimetre of water); NCEP writes it on its local “entire atmosphere (considered as a single layer)” surface, type 200, which carries no value like the WMO type 10 |
hpbl | 0 / 3 / 196 | 1, 0 | Planetary boundary layer height in metres, NCEP’s local number (the WMO table’s 0 / 3 / 18 is not what pgrb2 carries) |
orog | 0 / 3 / 5 | 1, 0 | Orography in metres, a static one-frame bundle. ECMWF open data’s surface geopotential, 0 / 3 / 4 on the same surface, is accepted on input and divided by g; DWD’s and Météo-France’s geometric height, 0 / 3 / 6 in metres, is accepted as it is |
ptype | 0 / 1 / 19 | 1, 0 | Precipitation type: one categorical field the encoder derives from the four flags below, in WMO code table 4.201’s own values (1 rain, 3 freezing rain, 5 snow, 8 ice pellets, 0 none). Never fetched; the flags are inputs only and reach no bundle |
crain / cfrzr / cicep / csnow | 0 / 1 / 192–195 | 1, 0 | The four 0/1 categorical precipitation-type flags pgrb2 carries (rain, freezing rain, ice pellets, snow; NCEP-local numbers), input-only, combined into ptype |
tmpsfc | 0 / 0 / 0 | 1, 0 | Surface (skin) temperature, the SST over water. ECMWF’s skt, its own parameter 0 / 0 / 17 with no surface value, is accepted on input and never written |
icec | 10 / 2 / 0 | 1, 0 | Sea ice cover, a 0–1 proportion quantized in percent (GFS only) |
icetk | 10 / 2 / 1 | 1, 0 | Sea ice thickness; ECMWF’s sithick carries no surface value and a bitmap over land (GDAL’s 9999, the bottom of the codebook), and is accepted on input |
htsgw | 10 / 0 / 3 | 1, no value | Significant height of combined wind waves and swell (GFS-Wave, ECMWF swh); WAVEWATCH III writes the surface value as 1 and ECMWF none, so none is declared and any is accepted |
perpw | 10 / 0 / 11 | 1, no value | Primary wave mean period (GFS-Wave); ECMWF’s peak period pp1d, 10 / 0 / 34, is the nearest neighbour and accepted on input under this identity |
dirpw | 10 / 0 / 10 | 1, no value | Primary wave direction, degrees true the waves come from (GFS-Wave); ECMWF’s mean wave direction mwd, 10 / 0 / 14, is accepted the same way; a record’s 360 is reduced to 0 |
wvhgt / wvper / wvdir | 10 / 0 / 5, 10 / 0 / 6, 10 / 0 / 4 | 1, no value | Significant height, mean period and direction (degrees true the waves come from) of the wind waves (GFS-Wave); the direction is input-only, reduced like dirpw, and reaches a bundle only inside uwindwave / vwindwave |
swhgt / swper / swdir | 10 / 0 / 8, 10 / 0 / 9, 10 / 0 / 7 | 241, 1 | Significant height, mean period and direction of the first (strongest) swell partition (GFS-Wave). Type 241 is NCEP’s local “ordered sequence of data” surface, its value the partition’s rank; only rank 1 is matched. The direction is input-only and reaches a bundle only inside uswell / vswell |
tsoil<n> | 2 / 0 / 2 | 106, the layer’s upper bound in m | Soil temperature in layer n (1–4) counted from the surface, in °C. The registered surface is GFS’s (Noah layers 0–0.1, 0.1–0.4, 0.4–1 and 1–2 m, so 0, 0.1, 0.4 and 1); ECMWF’s sot, the WMO 2 / 3 / 18 on its soil level surface (151) with layer n at value n − 1 (IFS layers 0–7, 7–28, 28–100 and 100–289 cm), is accepted on input and never written. The id is the layer’s index, not its depth: which depths a layer spans is the source’s (sources.md). Water carries no soil: the record’s bitmap there becomes the bottom of the codebook, code 0, one step below every real value (GFS, which writes the ice’s temperature over sea ice; the IFS writes the model’s value over the sea) |
soilw<n> | 2 / 0 / 192 | 106, the layer’s upper bound in m | Volumetric soil moisture in layer n, total (liquid and frozen) water in m³/m³, NCEP’s local SOILW (not the liquid part, SOILL). ECMWF’s vsw, the WMO 2 / 0 / 25 on its soil level surface as for tsoil<n>, is accepted on input and never written. Water is code 0 as for tsoil<n> (GFS, which also masks the sea ice and writes 1 over the ice sheets, and AIFS; the IFS writes 0 over the sea) |
uwave / vwave | 10 / 0 / 250, 10 / 0 / 251 | 1, no value | Wave vector components in metres: the significant wave height laid along the direction the waves travel, derived by the encoder from htsgw and dirpw as the wind’s (-h sin θ, -h cos θ); Xue-local parameter numbers |
uwindwave / vwindwave | 10 / 0 / 252, 10 / 0 / 253 | 1, no value | Wind-wave vector components, derived from wvhgt and wvdir the way uwave / vwave are; Xue-local parameter numbers |
uswell / vswell | 10 / 0 / 254, 10 / 0 / 255 | 241, 1 | Swell vector components of the first partition, derived from swhgt and swdir the same way, on their inputs’ surface; Xue-local parameter numbers |
prmsl | 0 / 3 / 1 | 101, no value | Mean sea level pressure, the quantity ECMWF calls msl and encodes as 0 / 3 / 0 on this surface, and HRRR writes as its MAPS reduction MSLMA, 0 / 3 / 198; both accepted on input, never written (not NCEP’s MSLET, 0 / 3 / 192) |
hgt<level> | 0 / 3 / 5 | 100, <level> hPa in Pa | Geopotential height, one variable per isobaric surface |
tmp<level> | 0 / 0 / 0 | 100, <level> hPa in Pa | Temperature on the isobaric surface |
rh<level> | 0 / 1 / 1 | 100, <level> hPa in Pa | Relative humidity on the isobaric surface |
spfh<level> | 0 / 1 / 0 | 100, <level> hPa in Pa | Specific humidity on the isobaric surface, quantized in g/kg |
ugrd<level> / vgrd<level> | 0 / 2 / 2, 0 / 2 / 3 | 100, <level> hPa in Pa | Wind components on the isobaric surface |
uqflx<level> / vqflx<level> | 0 / 1 / 250, 0 / 1 / 251 | 100, <level> hPa in Pa | Water vapour flux components, q·V/g in g·cm⁻¹·hPa⁻¹·s⁻¹; Xue-local parameter numbers |
vvel<level> | 0 / 2 / 8 | 100, <level> hPa in Pa | Vertical velocity ω in Pa/s on the isobaric surface |
relv<level> | 0 / 2 / 12 | 100, <level> hPa in Pa | Relative vorticity in 10⁻⁵ s⁻¹ (the record’s s⁻¹ times 10⁵). Registered on 925, 700, 500 and 250 hPa only |
thetae<level> | 0 / 0 / 3 | 100, <level> hPa in Pa | Equivalent potential temperature in K, derived by the encoder (Bolton 1980) from the temperature and specific humidity on the surface; GRIB2’s EPOT number |
cat<level> | 0 / 19 / 29 | 100, <level> hPa in Pa | Clear-air turbulence as an eddy dissipation rate in m^(2/3)/s: the Ellrod TI1 index (vertical wind shear times total deformation) derived by the encoder from the wind and height on the surface and the ones bracketing it, projected per source onto the climatological EDR distribution (below); GRIB2’s CAT EDR number. Registered on 300, 250 and 200 hPa only |
aod | 0 / 20 / 102 | 10, no value | Aerosol optical thickness at 550 nm, total aerosol (GEFS-Aerosols), dimensionless. An aerosol product (template 4.48): the aerosol block beside the parameter (below) is part of the identity — type 62000, particles smaller than 20 µm, 545–565 nm — and tells it from the other six wavelengths and five species the same parameter carries in one file |
aoddust / aodsalt / aodsulf / aodorg / aodbc | 0 / 20 / 102 | 10, no value | The same optical thickness for dust, sea salt, sulphate, particulate organic matter and black carbon: the same parameter and intervals, aerosolType 62001 / 62008 / 62006 / 62010 / 62009 |
pm25 | 0 / 13 / 193 | 1, 0 | PM2.5 surface concentration in µg/m³, NCEP’s local PMTF number; aerosol type 62000, particles smaller than 2.5 µm, no wavelength interval |
pm10 / pm10dust | 0 / 13 / 192 | 1, 0 | PM10 surface concentration in µg/m³ (NCEP’s local PMTC), total aerosol and dust alone: one parameter, aerosolType 62000 / 62001, particles smaller than 10 µm, no wavelength interval |
dustsfc | 0 / 20 / 0 | 1, 0 | Surface dust concentration in µg/m³ (CMA-CW/DUST), the mass density of dust of every particle size the model carries: aerosolType 62001, no size interval and no wavelength interval (both type 255, limits null), which tells it from pm10dust |
The twenty-one registered isobaric surfaces are 1000, 975, 950, 925, 900,
850, 800, 750, 700, 650, 600, 550, 500, 450, 400, 350, 300, 250, 200, 150
and 100 hPa, and every isobaric family but cat and relv is registered on all
twenty-one; hgt, tmp, ugrd and vgrd go on to the stratospheric
70, 50, 30, 20 and 10 hPa. Which of them a source
publishes is the source’s own list. relv is registered on 925, 700, 500
and 250 hPa. cat is registered on 300, 250 and 200 hPa: its vertical shear is
taken across 250–300 hPa for cat300, 200–300 for cat250 and 200–250 for
cat200, the deformation on the surface itself.
The cat<level> derivation, in float64, in this order (both encoders):
centred differences on the uncropped global plane, before any crop window
is cut, with R = 6371000 m, dx = R·cos φ·Δλ per row and dy = R·Δφ,
the columns wrapping on a global grid; DST = ∂u/∂x − ∂v/∂y,
DSH = ∂v/∂x + ∂u/∂y, DEF = √(DST² + DSH²); VWS = |V_above − V_below| / max(z_above − z_below, 1 m); TI1 = VWS·DEF; then
EDR = exp(a + b·ln max(TI1, 10⁻¹²)) with b = 0.5067 / σ_L,
a = −2.572 − b·μ_L, the climatological ln EDR mean and standard deviation
of Sharman & Pearson (2017) and the source’s own ln TI1 fit
(SourceSpec.cat_calibration); then every EDR < 0.10 (ICAO’s nil
turbulence) becomes 0, 0.10 itself keeping its code. The first and last
rows and every row past 85° latitude are written as 0, the codebook floor.
Within a family the variables differ only in the surface value, written in
the surface’s own unit, pascals: hgt500 carries
scaleFactorOfFirstFixedSurface: 0, scaledValueOfFirstFixedSurface: 50000.
The water vapour flux is not a GRIB2 field: the encoder derives it on each surface as the specific humidity (g/kg) times the wind component (m/s) over standard gravity (9.80665 m/s²), in g·cm⁻¹·hPa⁻¹·s⁻¹. GRIB2 has no standard parameter for a per-level horizontal vapour flux, so the two components take local-use numbers 250 and 251 in the moisture category, which no centre this pipeline reads from uses.
The precipitation type is derived the same way: the encoder reads pgrb2’s
four 0/1 categorical flags — crain, cfrzr, cicep and csnow, its
local numbers 0 / 1 / 192–195 on the ground surface — and writes one
categorical field under WMO code table 4.201’s own values (0 none, 1 rain,
3 freezing rain, 5 snow, 8 ice pellets). The four are mutually exclusive in
the model’s own output, so a chart of ptype never has to resolve a real
disagreement; where two were set anyway, the order rain, freezing rain,
ice pellets, snow decides, each later flag overriding, and both encoders
share that order so the plane stays byte-identical. The four flags are
input-only and reach no bundle.
Band, Producer and Aerosol
A parameter block names a quantity on a surface, which is a satellite
image’s whole identity only together with the channel it was taken in:
brightness temperature at the top of the atmosphere (0 / 4 / 4 on surface
8) is one parameter for every infrared channel of every imager, and a
composite computed from several channels has no GRIB2 parameter at all. Nor
is it an aerosol product’s whole identity: aerosol optical thickness
(0 / 20 / 102 on the entire atmosphere) is one parameter for every species
at every wavelength, and GRIB2 puts what tells them apart in the product
definition template rather than the parameter. Three optional blocks may
sit beside parameter on a variable, at the same level as it and never
inside it, to carry what the parameter does not:
band: the spectral band and the instrument that measured it, in the fields of GRIB2 product definition templates 4.31 and 4.32 for one contributing band (the templates’ band count is 1 and is not written);producer: the algorithm that derived the field from other variables;aerosol: the aerosol type and the size and wavelength intervals of an aerosol product, in the fields of GRIB2 product definition template 4.48 (of which 4.44 and 4.46 are subsets).
band field | GRIB2 origin | Rule |
|---|---|---|
satelliteSeries | Template 4.31, Common Code Table C-5 | 0–65535 |
satelliteNumber | Template 4.31, Common Code Table C-5 | 0–65535 |
instrumentType | Template 4.31, Common Code Table C-8 | 0–65535 |
scaleFactorOfCentralWaveNumber | Template 4.31 | −127…127 |
scaledValueOfCentralWaveNumber | Template 4.31 | 0…4294967294 |
The central wave number is
scaledValueOfCentralWaveNumber × 10^−scaleFactorOfCentralWaveNumber in
m⁻¹. All five keys are required when the block is present and no other key
is allowed. parameter stays the identity a reader keys on; band says
which channel of which instrument measured it, and a chart-aware reader
classifies a channel by its central wave number (an infrared window, a
water vapour band), not by the spacecraft: the satellite succeeding at an
orbital slot changes satelliteNumber and nothing else.
producer field | Rule |
|---|---|
id | ^[a-z][a-z0-9]*$, the algorithm’s name |
version | a non-empty string, the algorithm’s version as it names it |
Both keys are required when the block is present and no other key is
allowed. A produced field’s parameter uses GRIB2’s local-use ranges
(category 192 and above in the discipline that fits); a reader that charts
such fields tells them apart by producer.id and the parameter number
together, since local numbers mean nothing across producers.
aerosol field | GRIB2 origin | Rule |
|---|---|---|
aerosolType | Template 4.48 octets 12–13, code table 4.233 | 0–65535 |
typeOfSizeInterval | Octet 14, code table 4.91 | 0–255 |
scaleFactorOfFirstSize / scaledValueOfFirstSize | Octets 15 / 16–19 | −127…127 / 0…4294967294, or both null |
scaleFactorOfSecondSize / scaledValueOfSecondSize | Octets 20 / 21–24 | as above |
typeOfWavelengthInterval | Octet 25, code table 4.91 | 0–255 |
scaleFactorOfFirstWavelength / scaledValueOfFirstWavelength | Octets 26 / 27–30 | as above |
scaleFactorOfSecondWavelength / scaledValueOfSecondWavelength | Octets 31 / 32–35 | as above |
All eleven keys are required when the block is present and no other key is
allowed. A limit is scaledValue × 10^−scaleFactor metres, and each of the
four is a pair whose two halves are both integers or both null, the way
the parameter’s fixed surface value is. An interval whose type is 255
(missing) carries no limits: its two pairs are null, whatever a record
wrote in the octets (NCEP writes zeros there for a particulate matter
record, and they never reach the file); an interval of any other type
carries all four limits as integers. parameter stays the identity a
reader keys on together with this block: two aerosol variables are the same
field exactly when both blocks agree, and a reader that charts such fields
recognizes a species by aerosolType and a band by the wavelength interval.
A record is accepted under a registered aerosol variable only when its
template carries this whole identity — the encoder compares every field —
and an aerosol variable takes no aliases or alternates.
Each block is optional and any may appear without the others; a file that
carries none is unchanged from before they were defined. All three are
valid only from schemaVersion 3, like parameter, and none raises the
version a file must declare: a version 3 reader that predates them reads
the keys it knows on a variable object and ignores the rest, which is what
lets them widen version 3 rather than open a version 4. A block that is
present must be well formed; a reader that implements this section rejects
a malformed one (see Error Handling). A block is present or absent, never
null, so a variable has exactly one encoding.
Ensemble
A parameter block names a quantity; a field computed from an ensemble of
forecasts of that quantity is not the quantity itself but a statistic of it
— the members’ mean, their spread, a percentile of their distribution, or
the share of members past a threshold — and GRIB2 says which in the product
definition template (4.2 and 4.12 for a derived forecast, 4.6 and 4.10 for a
percentile, 4.5 and 4.9 for a probability), not in the parameter. The
optional ensemble block, beside parameter like the three above, carries
it. A variable without the block is a single forecast (or an observation).
The block has exactly one of three shapes; which keys it carries says which:
ensemble field | GRIB2 origin | Rule |
|---|---|---|
derivedForecast | Templates 4.2 / 4.12, code table 4.7 | 0–255 (0 is the unweighted mean of all members, 4 their spread) |
percentileValue | Templates 4.6 / 4.10 | 0–100 |
probabilityType | Templates 4.5 / 4.9, code table 4.9 | 0–5 |
scaleFactorOfLowerLimit / scaledValueOfLowerLimit | Templates 4.5 / 4.9 | −127…127 / 0…4294967294, or both null |
scaleFactorOfUpperLimit / scaledValueOfUpperLimit | Templates 4.5 / 4.9 | as above |
A derived forecast carries derivedForecast alone and a percentile
percentileValue alone. A probability carries all five of its keys, and
which limits are integers is fixed by its type, whatever a record wrote in
the octets the type does not use (CMA writes the threshold into both):
types 0 (below the lower limit), 3 (above the lower limit) and 5 (equal to
the lower limit) carry the lower limit and a null upper one; types 1
(above the upper limit) and 4 (below the upper limit) the upper limit and a
null lower one; type 2 (between the limits) both. A limit is
scaledValue × 10^−scaleFactor in the GRIB2 unit of the quantity the
parameter names (kg m⁻² for a precipitation total, m s⁻¹ for a speed),
never the variable’s unit; each limit is a pair whose two halves are both
integers or both null, as for the fixed surface value.
A probability’s unit is % and its values the percentage of members past
the limit; its parameter is the quantity the limit is on, a total over an
interval carrying typeOfStatisticalProcessing 1. A percentile, a mean and
a spread keep the quantity’s unit. parameter stays the identity a reader
keys on together with this block: two variables are the same field exactly
when both agree, so a reader that charts the quantity can draw an ensemble
member’s percentile or mean beside a single forecast of it, and tells a
spread or a probability from the quantity by the block.
ensemble is optional, valid only from schemaVersion 3, and does not raise
the version a file must declare, on the same terms as band, producer and
aerosol above. A version 3 reader that predates it would draw a spread or
a probability as the quantity itself, so a shell that charts it is deployed
before the first file carrying one is published (see
contribution/delivery.md).
The ensemble fields this pipeline publishes (CMA GRAPES GEPS, cmageps;
the spreads and probabilities of the ECMWF ensemble beside the
deterministic run, ecmwf) are below. CMA’s central fields keep the ids of
the single-forecast fields they stand in for (tmp2m, prate, prmsl, …)
and carry the block that says which statistic they are:
{"percentileValue": 50}, or {"derivedForecast": 0} for the 500 hPa
height and the sea-level pressure, where the mean is the only statistic CMA
exchanges. A field’s identity is the one in the table whichever centre
wrote it: ECMWF writes its spread as derivedForecast 2 (the standard
deviation with respect to the ensemble mean), its sea-level pressure spread
as pressure (0 / 3 / 0) and its precipitation probabilities on the
precipitation rate (0 / 1 / 52) with the limit unscaled, and is published
under the identities below, as its deterministic msl is under prmsl’s.
id | Parameter, surface | ensemble | Notes |
|---|---|---|---|
<id>q25 / <id>q75 for tmp2m, prate, gust, tcdc, cape, tmp850 | as <id> | percentileValue 25 / 75 | The quartiles of the members’ distribution, in the quantity’s unit and codebook; prateq25 / prateq75 are the six-hour totals’ quartiles divided by six, as prate is the median’s |
prmslsd / hgt500sd / tmp850sd | as prmsl / hgt500 / tmp850 | derivedForecast 4 | The members’ spread, in hPa / m / °C (tmp850sd from ECMWF only) |
apcp24gt1, apcp24gt5, apcp24gt10, apcp24gt25, apcp24gt50, apcp24gt100 | 0 / 1 / 8, 1, 0, typeOfStatisticalProcessing 1 | probabilityType 3, the lower limit 1 / 5 / 10 / 25 / 50 / 100 kg m⁻² | The percentage of members whose precipitation over the 24 hours ending at the frame exceeds the limit; from the 24th hour, at every frame on cmageps and every 12 hours on ecmwf |
Time Axis
The axis is a list of integer frame offsets from runTime, each worth
unitSeconds seconds. The frame at offset o is valid at
runTime + o × unitSeconds; a frame’s position on the axis is its index
in a store’s time dimension, and o is what a container index’s
frameOffset field carries.
From schemaVersion 3 the block is:
unitSeconds: seconds per offset unit. It must be a whole divisor of 3600, and it must be the coarsest unit that expresses every offset exactly, so an axis has one encoding. Formally,gcd(3600 / unitSeconds, offset₀, offset₁, …)must be 1. Every forecast source is hourly and declares 3600, which leaves its offsets equal to its forecast hours; the radar mosaic declares 360. A long axis is no different in kind: the CFSv2 seasonal run reaches hour 6552 in 1092 six-hourly frames, still in hourly units withframeStep: 6, well inside the[0, 65534]range an offset has.firstFrameOffsetandframeCount: always present.- Exactly one of
frameStep(the axis is uniform, and frameiis atfirstFrameOffset + i × frameStep) andframeOffsets(the axis does not hold one step throughout and is listed outright). A forecast run lists its offsets because the source changes cadence partway; an observation series lists them because the archive has gaps where a publication was missed.
No other field may appear in the block.
A mixed axis, hourly then three-hourly:
The production GFS 240-hour axis is the same shape at full length: the
161-element list 0, 1, …, 119, 120, 123, 126, …, 237, 240.
A frameOffsets array must have exactly frameCount elements, must be
strictly increasing, must begin with firstFrameOffset, and every element
must be in [0, 65534]: the frameOffset field is a u16 and 65535 is the
dependencyOffset sentinel. The same upper bound applies to a uniform
axis’s last offset, firstFrameOffset + (frameCount − 1) × frameStep. A
frameOffsets array whose steps are all equal is invalid, since a uniform
axis has exactly one encoding, frameStep; this also rules out arrays of
fewer than three elements. Declaring both frameStep and frameOffsets,
or neither, makes the file invalid.
Schema versions 1 and 2 describe the same thing in whole hours only:
firstForecastHour plus one of stepHours (uniform, version 1) and hours
(listed, version 2), with unitSeconds implicitly 3600. Those files remain
valid and are read unchanged. The two shapes never mix: a version 1 or 2
block carrying any version 3 field, or a version 3 block carrying any of the
hour-named fields, is invalid.
A segment is a maximal run of frames with a constant step. For frames
h[0] < h[1] < … < h[n-1] with steps d[i] = h[i+1] - h[i], a segment
boundary falls between h[i] and h[i+1] exactly where d[i] != d[i-1]:
the last frame of the old cadence closes the earlier segment and the first
frame of the new cadence opens the next. A uniform axis is one segment. The
GFS 240-hour axis is two: 121 hourly frames f000–f120, then 40 three-hourly
frames f123–f240.
Segments are derived, never stored. They bound temporal grouping (see Temporal Prediction), and they are where the physical meaning of a derived field changes: past a step increase, a precipitation rate obtained by de-accumulating or de-averaging its source records is a mean over a longer window, so the field is smoother and its peaks lower on the far side of the boundary. That is a property of the source data; a renderer that labels units should not present the two segments as the same measurement.
A field that does not vary in time — a model’s own terrain height — is an
ordinary bundle whose axis holds a single frame: frameCount 1 with
frameStep 1 on the declared unit. Nothing in a bundle marks it as
static; a producer that knows one (Xue’s registry does, the variable
descriptor’s static flag is the fetcher’s and the converter’s, not the
file’s) simply fetches and encodes the plane once rather than at every lead
time. A reader draws it like any one-frame field, and a viewer that offers
playback has nothing to scrub.
The encoder rotates longitude columns so the first column is -180,
preserving north-to-south row order. Grids that natively start at Greenwich
(the GFS surface-flux Gaussian grid) are rolled by the encoder into the same
-180-first layout. A renderer applies inverse Web Mercator, converts
longitude and latitude to grid coordinates, and samples this layout
directly.
The grid’s layout, rowOrder and columnOrder (row-major,
north-to-south, west-to-east, each the only value allowed) spell this
order out; every encoder writes them, and a reader accepts a document
without them, since the schema names them without requiring them.
Regional Grids
A grid need not cover the world. The grid block says what a file covers,
and a regional file is an ordinary file whose origin and extent name a
window rather than the globe; the layout and every codebook are
unchanged. The reference pipeline publishes such files for its
historical showcase cases, cut out of a global run.
Two rules follow for readers, both of which a global grid satisfies trivially:
wrapLongitudeis true only whenwidth x longitudeStepis 360 degrees. A reader must take the horizontal wrap from this field, not from the model: sampling filters may wrap across the antimeridian only when it is true, and must clamp otherwise.- The grid coordinate of a longitude is
(longitude - firstLongitude) mod 360 / longitudeStep. Taking the offset modulo 360 keeps a window that crosses the antimeridian contiguous: such a window declares afirstLongitudenear +180 and runs past it. Coordinates outside[0, width)or[0, height)are outside the file; a renderer must draw nothing there rather than clamp.
The four regular fields are a regular grid’s. A grid carries them or a
projection block (Projected Sources), never both and
never neither.
Gaussian rows
A regular Gaussian grid is regular in longitude only: its latitudes are the
roots of a Legendre polynomial. The regular fields describe it as evenly spaced
as GDAL reports it (within 0.014 of a row of the roots on GFS-SFLUX, whose step
spans its first row to its last; on CFSv2, at GDAL’s 180°/190 from the first
root, drifting to half a row by the southern edge), the optional gaussian block
beside them says what its rows really are, and it raises no version floor:
nis the number of latitudes per hemisphere (1 to 32768); rowrof the file is rowfirstRow + r × rowStrideof the Gaussian grid’s2n, counted from the north. A crop raisesfirstRow, a reduced-resolution tierrowStride. The last row must lie on the Gaussian grid. The block has exactly these three integer fields and needs schemaVersion 3.- A renderer keeps sampling by the regular fields, and a reader that ignores
the block draws what it always drew. The true latitudes are for what names a place: a point read’s
nearest row and the cell centre it reports, and a store’s
latitudecoordinate. Past the edge of a crop a point belongs to the edge row for half a row’s spacing; the first and last rows of the whole Gaussian grid own the polar caps. - The latitudes are computed, never stored:
docs/zarr-profile.md, “Coordinates”, gives the iteration.
Projected Sources
A model computed on a map projection is published on its own grid. The grid
block declares the projection in place of the regular fields, and the file is
schemaVersion 4:
kindis a closed set, todaylambert-conformalalone. A reader refuses a kind it does not implement; a new kind is a new value, not a new field.x0andy0are the centre of the first cell, the north-west one, in projected metres. Cell (row,column) has its centre atx0 + column × dx,y0 + row × dy.dxis positive,dynegative, andwrapLongitudefalse. Since GDAL’s geotransform names the first cell’s outer corner and different GDAL builds differ in its last digits, an encoder rounds the corner to three decimal places and adds half a step:x0 = round(gt0, 3) + dx / 2,y0 = round(gt3, 3) + dy / 2.- A crop adds
column × dxandrow × dytox0andy0. A reduced-resolution tier doublesdxanddyand keepsx0andy0, withwidth = (width + 1) // 2and likewiseheight. - The formulas are the spherical Lambert conformal conic’s (Snyder 1987, §15):
with two equal standard parallels the cone constant is
n = sin φ1, otherwisen = ln(cos φ1 / cos φ2) / ln(tan(π/4 + φ2/2) / tan(π/4 + φ1/2)). A longitude is taken to within 180° ofcentralMeridianbefore it is projected. Both standard parallels andlatitudeOfOriginlie strictly between the poles, and the two parallels must not sum to zero, which leaves no cone. - A grid coordinate is
(x − x0) / dx,(y − y0) / dy, with the rule for outside coordinates of Regional Grids. Cells are not regular in longitude or latitude: a reader that maps between them and geography goes through the projection. - Vector components are east and north, on this grid as on every other. A model
writes its winds along the grid’s axes (GRIB2 resolution and component flags
0x08), and an encoder turns each pair before quantizing it:u_e = cos α × u + sin α × v,v_e = −sin α × u + cos α × v, withαthe cone constant times the longitude’s distance fromcentralMeridian. The speed is the model’s. docs/encoder.md, “Native grids”, gives the arithmetic.
Older files do something else, and a reader keeps reading them. Up to
schemaVersion 3 a projected model was resampled by the encoder onto a regular
latitude/longitude grid before anything else read it, and the file is an
ordinary regional file of that grid. Its target is fixed: the regular grid of
the source’s declared step whose origin is a whole multiple of the step and
which covers the extremes of longitude and latitude the source’s boundary cell
centers reach; each target cell center is projected with the source’s own
forward formulas and the source plane is bilinearly interpolated there. A conic
domain is a trapezoid on that rectangle. The corners it never covered are
neither gaps nor a reserved code (the format has neither) but the nearest source
cell continued outwards (the sampling coordinate is clamped to the source grid),
so the plane is complete and no filter or contour meets an edge. Those cells are
not a forecast: a reader that knows the source’s projection clips to its
footprint, and one that does not draws the extension. A reader tells the two apart by the
grid block alone, never by the source: one model publishes both.
model and product identify the source dataset. Every encoder writes
product, and a reader accepts a document without it: the schema names
the field without requiring it. Registered pairs:
model | product | Grid | Steps published | Notes |
|---|---|---|---|---|
GFS | pgrb2.0p25 | 1440 × 721, 0.25° | 1 h to f120, 3 h to f240 | All series include the analysis frame (f000). prate is an instantaneous rate at every step |
ECMWF | ifs-0p25 | 1440 × 721, 0.25° | 3 h to 144 h, 6 h to 240 h | prate is de-accumulated from the run-total tp, so its series has no analysis frame and starts at firstFrameOffset: 3; so does gust, whose record (the maximum over the interval ending at the frame) is empty at the analysis. Its wave fields come from the cycle’s wave stream |
GFS-SFLUX | sfluxgrb | 3072 × 1536 Gaussian, ~13 km | 1 h to f120, 3 h to f240 | prate is de-averaged from window-cumulative records and starts at firstFrameOffset: 1; the only source shipping dswrf |
HRRR | wrfsfc | 1799 × 1059, 3 km Lambert conformal, regional (see “Projected Sources” above) | 1 h to f18 | A new cycle every hour. Runs published before schemaVersion 4 are on a regular 2441 × 1051 grid at 0.03° (134.10 W – 60.90 W, 52.62 N – 21.12 N), resampled by the encoder. Its prmsl is the MAPS reduction and its cref the model’s forecast reflectivity |
RRFS | 2dfld.3km.conus | 1799 × 1059, 3 km Lambert conformal, regional: HRRR’s grid | 1 h to f84 | The 00/06/12/18Z cycles. Isobaric records come from the prslev file of each hour. Carries the near-surface smoke and dust of RRFS-SD |
WOOF-NAM | awphys | 614 × 428, 12.19 km Lambert conformal, regional: NCEP grid 218 | 1 h to f84 | The 00/06/12/18Z cycles of WOOF-NAM by Recast, not a NOAA forecast. prate is differenced from totals that restart every 12 hours, so its series has no analysis frame and starts at firstFrameOffset: 1; the core is tmp2m alone |
CFSv2 | time-grib-01 | 384 × 190 Gaussian, 0.9375° (T126) | 6 h from f6 to f6552 | The seasonal source: ensemble member 01 of the 00Z and 12Z cycles, thirty-nine weeks of a nine-month run. Its series begin at the first step, so every bundle starts at firstFrameOffset: 6 — the cycle’s analysis is in another file family and is not published. prate, dswrf and tcdc are means over the six hours ending at the frame (typeOfStatisticalProcessing: 0) although the records carry the instantaneous template |
CMA-RADAR | l3-mst-cref | tile grid, 360/(256·2^z) degrees | 6 min, as published | Observations, not a forecast: runTime is the first observation and offsets count from it. The only one whose unitSeconds is not 3600; the axis lists its offsets wherever a publication was missed |
How far a run is published is a pipeline choice; the steps above are what
each source makes available. A uniform series declares a frameStep; a
series that runs to 240 hours crosses a step change on every forecast source
above and lists its offsets; an observation series lists them wherever the
archive has a gap.
CMA-RADAR is a series of observed analyses, and the metadata describes it
with no change: runTime is the first observation in the series and each
frame’s frameOffset counts six-minute units from it. A reader that labels
the axis should take that from the dataset identity rather than assume every
file is a forecast.
Time axes may differ between bundles of one run, in both step and extent.
The layout is identical for every model; only the metadata identity, the
grid, and the time axis differ. Readers must derive the frame
list from time and the grid from grid, never from the model name, and
must not assume two bundles of one run share an axis.
Quantization Codebooks
Linear ("type": "linear")
Codes 0 through maximumCode are valid; nodataCode marks missing data;
codes between maximumCode + 1 and nodataCode - 1 are reserved. The
maximum in-range quantization error is scale / 2.
Registered linear codebooks (the quality profile; balanced uses the same
values unless noted):
| Variable | offset | scale | maximumCode | nodataCode | Error budget |
|---|---|---|---|---|---|
tmp2m | −60 °C | 0.5 | 220 | 255 | 0.25 °C |
ugrd10m / vgrd10m / ugrd100m / vgrd100m | −63.5 m/s | 0.5 | 254 | 255 | 0.25 m/s |
dswrf | 0 W/m² | 5 | 254 | 255 | 2.5 W/m² |
cref | 0 dBZ | 0.5 | 160 | 255 | 0.25 dB |
rqi | −0.1 | 0.1 | 11 | 255 | none: MRMS publishes tenths; code 0 is outside radar coverage, code 1 an index of 0 (every profile) |
gust | 0 m/s | 0.5 | 254 | 255 | 0.25 m/s |
tcdc | 0 % | 0.5 | 200 | 255 | 0.25 % |
cape | 0 J/kg | 25 | 254 | 255 | 12.5 J/kg |
cin | −1016 J/kg | 4 | 254 | 255 | 2 J/kg |
lcdc / mcdc / hcdc | 0 % | 0.5 | 200 | 255 | 0.25 % |
pwat | 0 kg/m² | 0.5 | 254 | 255 | 0.25 kg/m² |
hpbl | 0 m | 20 | 254 | 255 | 10 m |
orog | −430 m | 37 | 254 | 255 | 18.5 m |
ptype | 0 | 1 | 8 | 255 | — |
vis | 0 km | 0.1 | 254 | 255 | 0.05 km |
dpt2m | −70 °C | 0.5 | 220 | 255 | 0.25 °C |
aptmp2m | −90 °C | 1 | 150 | 255 | 0.5 °C |
tmpsfc | −60 °C | 0.5 | 254 | 255 | 0.25 °C |
icec | 0 % | 0.5 | 200 | 255 | 0.25 % |
icetk | 0 m | 0.02 | 254 | 255 | 0.01 m |
htsgw | 0 m | 0.1 | 254 | 255 | 0.05 m |
perpw | 0 s | 0.1 | 254 | 255 | 0.05 s |
wvhgt / swhgt | 0 m | 0.1 | 254 | 255 | 0.05 m |
wvper / swper | 0 s | 0.1 | 254 | 255 | 0.05 s |
dirpw | 0° | 1.5 | 239 | 255 | 0.75° |
wvdir / swdir | 0° | 1.5 | 239 | 255 | 0.75° |
uwave / vwave | −25.4 m | 0.2 | 254 | 255 | 0.1 m |
uwindwave / vwindwave, uswell / vswell | −25.4 m | 0.2 | 254 | 255 | 0.1 m |
tsoil<n> | −61 °C | 0.5 | 254 | 255 | 0.25 °C; code 0 is no soil |
soilw<n> | −0.01 m³/m³ | 0.005 | 202 | 255 | 0.0025 m³/m³; code 0 is no soil |
prmsl | 870.5 hPa | 1 | 254 | 255 | 0.5 hPa |
hgt1000 | −905 m | 10 | 254 | 255 | 5 m |
hgt925 | −249 m | 6 | 254 | 255 | 3 m |
hgt850 | 423 m | 6 | 254 | 255 | 3 m |
hgt700 | 1911 m | 6 | 254 | 255 | 3 m |
hgt500 | 4252 m | 8 | 254 | 255 | 4 m |
hgt300 | 7505 m | 10 | 254 | 255 | 5 m |
hgt250 | 8598 m | 12 | 254 | 255 | 6 m |
hgt200 | 10086 m | 12 | 254 | 255 | 6 m |
tmp1000 | −60 °C | 0.5 | 240 | 255 | 0.25 °C |
tmp925 | −65 °C | 0.5 | 230 | 255 | 0.25 °C |
tmp850 | −70 °C | 0.5 | 230 | 255 | 0.25 °C |
tmp700 | −75 °C | 0.5 | 220 | 255 | 0.25 °C |
tmp500 | −85 °C | 0.5 | 200 | 255 | 0.25 °C |
tmp300 | −95 °C | 0.5 | 190 | 255 | 0.25 °C |
tmp250 | −100 °C | 0.5 | 190 | 255 | 0.25 °C |
tmp200 | −100 °C | 0.5 | 180 | 255 | 0.25 °C |
rh<level> | 0 % | 0.5 | 200 | 255 | 0.25 % |
spfh1000 / spfh925 | 0 g/kg | 0.2 | 254 | 255 | 0.1 g/kg |
spfh850 / spfh700 | 0 g/kg | 0.1 | 254 | 255 | 0.05 g/kg |
spfh500 | 0 g/kg | 0.02 | 254 | 255 | 0.01 g/kg |
spfh300 | 0 g/kg | 0.01 | 254 | 255 | 0.005 g/kg |
spfh250 / spfh200 | 0 g/kg | 0.005 | 254 | 255 | 0.0025 g/kg |
ugrd<level> / vgrd<level> | −127 m/s | 1 | 254 | 255 | 0.5 m/s |
uqflx<level> / vqflx<level> | −63.5 g·cm⁻¹·hPa⁻¹·s⁻¹ | 0.5 | 254 | 255 | 0.25 |
vvel<level> | −6.35 Pa/s | 0.05 | 254 | 255 | 0.025 Pa/s |
thetae1000 | 235 K | 0.5 | 254 | 255 | 0.25 K |
thetae925 | 232 K | 0.5 | 254 | 255 | 0.25 K |
thetae850 | 230 K | 0.5 | 254 | 255 | 0.25 K |
thetae700 | 235 K | 0.5 | 254 | 255 | 0.25 K |
thetae500 | 250 K | 0.5 | 254 | 255 | 0.25 K |
thetae300 | 285 K | 0.5 | 254 | 255 | 0.25 K |
thetae250 | 295 K | 0.5 | 254 | 255 | 0.25 K |
thetae200 | 305 K | 0.5 | 254 | 255 | 0.25 K |
cat<level> | 0 m^(2/3)/s | 0.005 | 127 | 255 | 0.0025 m^(2/3)/s |
The compact profile doubles each scale (temperature 1.0 → maximumCode
110, wind 1.0 → 127, dswrf 10 → 127, cref 1.0 → 80, gust 1.0 → 127, every
cloud cover 1.0 → 100, cape 50 → 127, cin 8 → 127, vis 0.2 → 127, dpt2m 1.0
→ 110, aptmp2m 2 → 75, pwat 1.0 → 127, hpbl 40 → 127, orog 74 → 127, tmpsfc 1.0 → 127, icec
1.0 → 100, icetk 0.04 → 127, htsgw, perpw and the wind-wave and swell heights and periods 0.2 → 127, tsoil 1.0 → 127,
soilw 0.01 → 101, and every
pressure-family and isobaric codebook → half its maximumCode over the same
range; cat<level> 0.01 over 0–0.64 → 64). Two codebooks do not keep the same range: dirpw’s compact codebook (and wvdir’s and swdir’s)
stops at 357° (3 → 119), because 360 / 3
codes would put 360°, which is 0°, back on the grid; and the wave vectors'
stop at ±25.2 m (0.4 → 126) so that 0 stays on the grid, since land is
(0, 0) in the pair and the middle code of both. The categorical ptype
takes one book in every profile: its integer class codes have no resolution
to trade, and the codes between the four types GFS reports are never
written. balanced takes the compact
icec beside the compact humidity and cloud cover, and the quality book for
every other one-sided field (the inhibition, the precipitable water, the
boundary layer height), as it does for the aerosol fields.
The wave fields are the first whose records do not cover the grid: GFS-Wave
carries a bitmap, and land comes out of GDAL as its nodata value (9999).
The encoder maps those points to code 0 (0 m, 0 s, 0°) before quantization,
as the radar mosaic’s fill is handled (see “Complete planes” below); the nodataCode is still never written.
The soil layers’ records do not cover it either (GFS masks the open water,
and the sea ice for the moisture; AIFS the sea for the moisture). Their
codebooks start one step below the least real value — −61 °C, −0.01 m³/m³ —
so the masked points, filled with that bottom, are code 0 and no real value
is: a reader tells “no soil” from a value without a bitmap, and 0 °C and
0 m³/m³ are codes of their own in both profiles.
The isobaric temperature takes its range per level: the low end holds the
Antarctic winter at every surface, the high end the below-ground
extrapolation the lowest surfaces take under high terrain, and no single
127-degree window covers both 850 hPa in summer and 200 hPa in winter.
Specific humidity spans two orders of magnitude between the surface and the
upper troposphere, so its step follows the level. Relative humidity is the
noisiest field published, so the balanced profile
takes its compact codebook (1 %, maximumCode 100), and the cloud covers
follow it; those are the departures from quality in that profile besides
precipitation. The equivalent potential temperature takes a 127 K window per
level at the temperature’s step, placed so the tropical end fits (850 hPa
runs to 357 K); only the 850 hPa window is verified against an analysis,
the others follow the potential temperature’s rise with height. None of the
isobaric fills is contoured, so none carries the half-code rule below.
The pressure family’s offsets are chosen so that every standard contour
value lands exactly half a code off: (contour − offset) / scale has
fractional part 0.5, for the level’s own interval (4 hPa for prmsl, 30 m
up to 700 hPa, 40 m at 500, 120 m above) and for the emphasised lines
(every 20 hPa on prmsl; 5840 and 5880 gpm on hgt500). This is an
encoder rule, in the same sense as a container’s segment grouping: a
decoder must not assume it, and nothing in a bundle records it. It exists because a
contour drawn where the code is flat covers a whole plateau instead of a
line. The coverage is fixed per variable for all time rather than fitted per
run; byte-identical re-encoding, a stable legend, and comparable point
series across runs depend on it.
cref code 0 is both “no echo” and “outside the radar network’s coverage”.
A reader that must tell them apart reads the mosaic’s rqi beside it,
whose code 0 is outside coverage and whose code 1 is covered with an index
of 0.
A ground mosaic is a regional product on a rectangular grid, and a bundle
carries no bitmap, so the bottom of the codebook is what a
renderer paints as nothing. It is an ordinary in-range code rather than a
reserved one: a renderer that interpolates codes before its palette lookup
would otherwise colour the gap between a reserved code and its neighbour
with a class the data never reached.
Values outside the range clamp to the range ends before quantization.
Logarithmic ("type": "log1p", precipitation)
Precipitation is sparse and long-tailed, so it uses a logarithmic codebook
with parameters trace, scale, maximum:
- Code
zeroCode(0): dry, belowtrace. - Codes
minimumCode(1) throughmaximumCode: positive logarithmic values. - Code
overflowCode(maximumCode + 1): abovemaximum. - Code
nodataCode: missing data.
For trace <= p <= maximum, with span = maximumCode - 1:
Decode with:
Code maximumCode decodes to exactly maximum. The overflow code decodes
one codebook step above the maximum (the same formula evaluated at
q = maximumCode + 1), extending the logarithmic grid by one step so
decoded values remain strictly increasing across all non-nodata codes, and
overflow pixels stay distinguishable from the top in-range code in both a
palette and scalar inspection.
Registered precipitation codebooks (trace = 0.01 mm/h,
scale = 0.05 mm/h, maximum = 128 mm/h in both):
| Profile | maximumCode | overflowCode | nodataCode |
|---|---|---|---|
quality (256-level) | 253 | 254 | 255 |
balanced / compact (128-level) | 125 | 126 | 127 |
The 128-level codebook still uses full R8 bytes; the smaller symbol alphabet improves entropy coding, and the GPU needs no bit unpacking.
Series codebooks
A series store (zarr-profile.md, “Series store”) holds
some variables as sixteen-bit codes, in place of the profile’s byte
codebook: a cell’s series is read as a line, where a byte step shows as a
staircase. Each is a linear codebook (the formulas above), one per variable
whatever the profile, carried in the registry as the variable’s
seriesQuantization (registry.md) and, inside a series
store, as that variable’s quantization. Every variable below carries one
(quantize.SERIES_CODEBOOKS); any other variable of a series store keeps its
byte codes:
| Variable | offset | scale | maximumCode | nodataCode | Error budget |
|---|---|---|---|---|---|
tmp2m / dpt2m | −90 °C | 0.1 | 1500 | 65535 | 0.05 °C |
prmsl | 850 hPa | 0.1 | 2500 | 65535 | 0.05 hPa |
ugrd10m / vgrd10m | −100 m/s | 0.1 | 2000 | 65535 | 0.05 m/s |
prate | 0 mm/h | 0.01 | 65500 | 65535 | 0.005 mm/h |
dswrf | 0 W/m² | 1 | 1500 | 65535 | 0.5 W/m² |
The rate is linear here, where its byte codebook is logarithmic. A codebook
whose nodataCode is above 255 is a sixteen-bit one: its codes are held as
uint16 and fit only a uint16 array. Every code key of a quantization
block (minimumCode, maximumCode, zeroCode, overflowCode,
nodataCode) is an integer from 0 to 65535; that every code fits a byte is
checked where the codes sit, by the reader of a uint8 array or of a
container, which carry byte codes only. A series code is quantized from the
same value as the variable’s byte code, in the same pass, never from the
byte code.
Residuals
A predicted variable stores each frame after the first of its run of
frames as a residual against an earlier one (a store’s xue.delta codec,
a container’s predictors).
Residuals are defined unconditionally as one-byte modulo-256 wrapping differences:
Wrapping subtraction and addition are lossless for every byte pair, so there is no residual range check, no signed interpretation, and no RAW fallback for out-of-range differences. Sixteen-bit codes (a series store’s widened variables) wrap the same way modulo 65536.
Complete planes
A bundle requires complete input planes: every point of every plane carries a code. The forecast grids satisfy that outright, and a source whose product does not cover its whole grid (the radar mosaic) resolves it before quantization by mapping absent points to the bottom of the variable’s codebook, a value rather than a gap. A future missing-data implementation should add a separate bitmap so residual bytes never conflict with the nodata code.
Bundle naming
One bundle per variable per run (tmp2m, prate, dswrf, cref), a
vector’s components together (wind10m), and reduced-resolution renditions
<bundle>.half, <bundle>.quarter and <bundle>.eighth (decimated by 2,
4 and 8; which rungs a source ships is a registry value, every source at
least the half, none the eighth today, though published ones stay valid),
structurally identical bundles whose metadata declares the decimated grid.
A shared store holds every bundle of one tier (bundles.zarr,
bundles.half.zarr; zarr-profile.md, “Layout”); a
one-bundle store is <name>.zarr, a container <name>.xue.
Part of the Xue specification, licensed under CC BY 4.0.
3 - Xue Container Format
This document is the normative specification of the Xue container (.xue),
a single indexed file holding one bundle: the metadata and quantized codes
of bundle.md, framed so a browser can decode a run frame by
frame from HTTP range reads.
The container is a legacy layout. Every live run, round and showcase case
is published as a Zarr v3 store (zarr-profile.md)
alone, and a build writes the store straight from its codes; an encoder
writes a container only when asked (--xue, container=True). Every
decoder keeps reading it, since runs and cases published as containers are
never rebuilt: for a reader nothing here is deprecated.
Two container versions exist, and they differ in what a payload is:
- v1 is plane-major: one payload is one whole plane of one frame. Sections marked (v1) describe it. Nothing writes it any more; every decoder must keep reading it.
- v2 is tiled: one payload is a chunk, one spatial tile of one temporal group for one variable, so a reader can fetch the region it is showing and read one cell’s whole series at one chunk per group. Both encoders write it. See Container v2.
Both share the fixed header and the payload rules below; the metadata,
the codebooks and the residual arithmetic are bundle.md’s.
A decoder rejects a container version it does not implement, so a
v2-capable shell must be deployed before the first v2 run is published.
The Python encoder (xuebuild/binformat.py) and the Rust decoder
(rust/xue) are the two reference implementations, held byte-identical by
cross-language golden tests.
Design Summary
The format targets a product that animates a complete global forecast (steps of one to six hours out to 240 hours, changing step partway through the range) with continuous playback and timeline scrubbing. For one 121-frame GFS run, per-frame raster PMTiles for two variables measured 3,205.87 MB against 137.73 MB of source GRIB. Xue stores each variable as quantized single-byte planes on the native grid (projection and coloring happen on the GPU) with bounded temporal prediction and per-payload Zstandard compression; the same two variables fit in 65–71 MB for that run depending on profile. Size grows roughly linearly with frame count; coarser-step frames have larger inter-frame differences and compress slightly worse. Every frame is individually addressable, and the index makes HTTP-range streaming possible: a client fetches the structural prefix (a few KB) and then range-requests one temporal group or one chunk at a time.
Design decisions:
- Quantized uint8 planes. Each decoded frame is a contiguous single-channel
plane that uploads directly to a WebGL2
R8texture. Codebooks are visualization-oriented (0.25 °C temperature error budget, a logarithmic precipitation codebook that preserves light-rain resolution). - An axis that names its own unit and may change step. GFS is hourly to f120 and three-hourly beyond, ECMWF three-hourly to 144 hours and six-hourly beyond, and the radar mosaic publishes every six minutes. The axis declares the seconds one step unit is worth and either a uniform step or its offsets outright, so it is always exact.
- Bounded temporal groups. Smooth fields are coded in six-frame groups with one-byte residuals; groups are formed inside a segment of constant step, so no group straddles a change of cadence. In v1 a group is a middle RAW anchor plus residuals against it, capping random access at two plane decodes; in v2 a group is packed whole into each tile’s chunk and the residuals chain against the previous frame, which is smaller and, since the chunk decompresses as a unit, no more expensive to seek into. Precipitation regions move with weather systems and temporal differencing increases their compressed size, so precipitation is stacked RAW in both versions.
- One independent Zstandard frame per payload (a plane in v1, a chunk in v2) for direct indexing, sequential reads, and localized failure isolation.
- Space is addressable in v2. A payload covers one tile of the grid, so a zoomed-in viewport fetches only the tiles it shows, and one cell’s whole series costs one chunk per group. Tiles are cut in grid space, not Web Mercator; reprojection stays in the fragment shader.
- Strict parsing. All offsets and lengths are validated with checked arithmetic before any allocation; sections must be strictly adjacent with zero padding; every reconstructed plane carries a CRC-32.
Conventions
- All binary integers are little-endian.
- All offsets are absolute (relative to the beginning of the file).
- Structural sections are aligned to 8 bytes;
align8(x)roundsxup to the next multiple of 8. Padding bytes must be zero. - Metadata is UTF-8 JSON; the index uses fixed-width binary entries.
- Quantization follows
bundle.md, “Conventions”.
Container Layout
Both versions have the same five sections in the same order; the index and what the payloads are differ. This is v1; see Container v2 for the tiled index.
FixedHeader
The magic value is the 8-byte sequence XUE\0\0\0\0\0 (ASCII XUE
followed by five NUL bytes).
| Offset | Length | Type | Field | Rule |
|---|---|---|---|---|
| 0 | 8 | bytes | magic | XUE\0\0\0\0\0 |
| 8 | 2 | u16 | version | 1 for v1 |
| 10 | 2 | u16 | headerSize | Fixed at 80 |
| 12 | 4 | u32 | flags | Fixed at 0 for v1 |
| 16 | 8 | u64 | fileSize | Must equal the actual file length |
| 24 | 8 | u64 | metadataOffset | Fixed at 80 for v1 |
| 32 | 8 | u64 | metadataLength | JSON byte count, excluding padding |
| 40 | 8 | u64 | indexOffset | 8-byte aligned |
| 48 | 8 | u64 | indexLength | Includes IndexHeader and every entry |
| 56 | 8 | u64 | dataOffset | 8-byte aligned |
| 64 | 8 | u64 | dictionaryOffset | 8-byte aligned, 0 when no dictionary |
| 72 | 8 | u64 | dictionaryLength | Dictionary byte count, 0 when no dictionary |
Before allocating memory, the parser must validate checked addition and
multiplication, monotonic offsets, and containment of every range within
fileSize.
Sections are strictly adjacent, separated only by zero padding for 8-byte alignment. The parser must verify:
metadataOffset = 80.indexOffset = align8(metadataOffset + metadataLength).- When
dictionaryLengthis 0,dictionaryOffsetmust be 0 anddataOffset = align8(indexOffset + indexLength). - When
dictionaryLengthis nonzero,dictionaryOffset = align8(indexOffset + indexLength)anddataOffset = align8(dictionaryOffset + dictionaryLength). - Payloads are stored contiguously in physical order starting at
dataOffset, with no per-payload alignment and no unindexed gaps. fileSize = align8(end of the last payload), and every padding byte is zero.
Unindexed gaps, overlaps, and nonzero padding bytes make the file invalid.
Metadata JSON
The UTF-8 metadata JSON of bundle.md, “Metadata JSON”,
verbatim.
IndexHeader (v1)
| Offset | Length | Type | Field | Rule |
|---|---|---|---|---|
| 0 | 4 | bytes | magic | ASCII IDX1 |
| 4 | 2 | u16 | entrySize | Fixed at 40 for v1 |
| 6 | 2 | u16 | version | Fixed at 1 for v1 |
| 8 | 4 | u32 | entryCount | Must equal (variables × frames per variable) declared in metadata |
| 12 | 4 | u32 | reserved | Must be 0 |
PlaneEntry (v1)
Index entries are sorted by (variableId, frameOffset). Each entry is 40
bytes:
| Offset | Length | Type | Field | Rule |
|---|---|---|---|---|
| 0 | 1 | u8 | variableId | A handle into this file’s metadata; see below |
| 1 | 1 | u8 | predictor | See enum below |
| 2 | 1 | u8 | compression | 0 NONE, 1 ZSTD, 2 ZSTD_DICT |
| 3 | 1 | u8 | flags | See flags below |
| 4 | 2 | u16 | frameOffset | This plane’s offset on the metadata time axis |
| 6 | 2 | u16 | dependencyOffset | 65535 when no dependency exists |
| 8 | 2 | u16 | groupId | Temporal group ID; equals frameOffset for RAW-only series |
| 10 | 2 | u16 | reserved0 | Must be 0 |
| 12 | 4 | u32 | compressedLength | Payload byte count |
| 16 | 8 | u64 | dataOffset | Absolute payload offset |
| 24 | 4 | u32 | decodedLength | Must equal grid.width × grid.height |
| 28 | 4 | u32 | crc32 | CRC-32 of the reconstructed quantized plane |
| 32 | 1 | u8 | minimumCode | Actual minimum code in the final plane |
| 33 | 1 | u8 | maximumCode | Actual maximum code in the final plane |
| 34 | 6 | bytes | reserved1 | Every byte must be 0 |
Predictor enum:
| Value | Name | Meaning |
|---|---|---|
| 0 | RAW | Decompressed payload is the complete quantized plane |
| 1 | ANCHOR | Payload is a residual relative to dependencyOffset |
| 2 | PREVIOUS | Payload is a residual relative to the preceding frame on this variable’s time axis |
| 3 | ZERO | No payload, output a zero-filled plane, reserved for local block formats |
Flags:
- Bit 0: Zstandard frame includes a checksum.
- All other bits must be 0.
Residuals always use modulo-256 wrapping semantics, so no flag describes
residual interpretation. Overflow presence is derivable from maximumCode,
so no flag duplicates it.
The crc32 field uses CRC-32/IEEE (polynomial 0x04C11DB7, reflected
implementation 0xEDB88320, initial value and final XOR 0xFFFFFFFF,
identical to zlib’s crc32), computed over the reconstructed quantized
plane. The Zstandard checksum validates the compressed payload; the CRC32
validates predictor reconstruction.
variableId is file-local
variableId is a handle, not a name: it ties an index entry to one variable
descriptor in this file’s metadata. It must be 1–255 and unique within the
file, and every id an index entry names must appear in the file’s
variables; there is no global table to check it against, and a decoder
must not carry one. What a variable is lives in the metadata: its
parameter block (see bundle.md, “Variable Identity”) and its
id string.
The encoders in this repository assign ids positionally: 1…n by the variable’s order in the bundle’s variable list, which is also the order the v2 chunk layout uses. A single-variable bundle is always id 1, and a vector bundle is 1 for the U component and 2 for the V component.
Historical assignment: encoders before this rule drew ids from a global
registry, and files already published carry those numbers: 1 tmp2m,
2 prate, 3 ugrd10m, 4 vgrd10m, 5 dswrf, 6 cref, 7 prmsl,
8–15 hgt1000 … hgt200, 16–23 tmp1000 … tmp200,
24–31 rh1000 … rh200, 32–39 spfh1000 … spfh200,
40–47 ugrd1000 … ugrd200, 48–55 vgrd1000 … vgrd200,
56–63 uqflx1000 … uqflx200, 64–71 vqflx1000 … vqflx200 (each
isobaric family in the level order 1000, 925, 850, 700, 500, 300, 250, 200).
No decoder required those numbers, so every such file stays valid.
Payload Rules (v1)
- Every non-ZERO entry maps to one independent Zstandard frame.
- ZSTD_DICT frames decompress with the embedded dictionary, which the
decoder loads once at open time. A ZSTD_DICT entry is invalid when
dictionaryLengthis 0. No production build embeds a dictionary: trained dictionaries showed no gain on full ~1 MB planes. The section and mode are reserved for smaller payloads. - The decompressed payload length must equal
decodedLength. - RAW decompresses directly to the quantized plane.
- ANCHOR decompresses to a one-byte residual, then adds the dependency plane.
- PREVIOUS decompresses to a one-byte residual, then adds the plane of the
preceding frame on the time axis:
frameOffsets[i - 1], orframeOffset - frameStepon a uniform axis (notframeOffset - 1, which does not exist on an axis whose step is not one unit). A PREVIOUS entry on the first frame of the axis is invalid, and every PREVIOUS entry must carry exactly that preceding offset independencyOffset: like ANCHOR, the dependency is explicit in the index, never the sentinel, never derived, so the same file has only one encoding. No reference bundle uses PREVIOUS in v1; the reference encoder emits only RAW and ANCHOR there. - The decoder must reject a frame when length, checksum, or dependency validation fails.
- The decoder must not allocate an output larger than
width × heightor a configured safety limit based on untrusted file values.
Quantization Codebooks
The codebooks of bundle.md, “Quantization Codebooks”.
Temporal Prediction
The predictors are shared by both container versions. Which of them a file may use, and what a residual is computed against, is defined by the index: v1 allows all four per plane (PlaneEntry (v1)), v2 allows RAW and PREVIOUS per variable and chains inside a chunk (Container v2).
The residual arithmetic is bundle.md, “Residuals”.
Per-variable rules in v1:
- Linear-codebook fields (
tmp2m,ugrd10m,vgrd10m,dswrf, the surface diagnostics, the ocean fields, the isobaric fills and the pressure familyprmsl/hgt<level>) use temporal prediction. Each segment of the time axis splits independently into groups of 6 frames, so a group never spans a change of step. Within each group ofnframes, the frame at zero-based indexfloor(n / 2)is the anchor: it uses predictor RAW, and every other frame in the group uses ANCHOR residuals against it. A trailing single-frame group is its own anchor and uses RAW. Random access to any frame costs at most two plane decodes (anchor + target).groupIdcounts groups sequentially across the whole variable and does not restart at a segment boundary. - Precipitation (
prate) uses independent RAW planes for every frame, withgroupIdmirroringframeOffset. Precipitation regions move with weather systems; fixed-grid differencing creates both entering and leaving edges and measurably increases compressed size.
Grouping per segment rather than across the whole timeline keeps every ANCHOR residual a difference between frames one step apart. A group straddling the GFS 120-hour transition would difference frames three hours apart against an anchor chosen among frames one hour apart: still lossless, since residuals wrap modulo 256, but a larger residual and a worse-compressing one. Splitting costs at most one extra RAW anchor per segment boundary per variable.
Segment-aligned grouping is an encoder rule, not a decode-time invariant. A decoder validates the dependency structure recorded in the index (see Error Handling) and never needs to derive segments; a group that straddled a boundary would still reconstruct exactly and is not rejected.
Every plane is complete; see bundle.md, “Complete planes”.
Physical Payload Order (v1)
Payloads are ordered by variable and temporal group, with each group’s anchor payload first inside its group:
The anchor’s actual frame offset remains in the index; sequential playback does not depend on physical payload order. Keeping a temporal group’s payloads contiguous means one HTTP range request fetches one decodable group.
In the two-variable wind bundle the payloads interleave per temporal group
(a ugrd10m group followed by the same vgrd10m group), so streaming one
wind frame touches two adjacent byte spans.
Interleaving all forecast times per grid point would turn single-plane reads into wide file gathers, so Xue v1 keeps complete planes contiguous; temporal continuity is represented by residuals instead.
Streaming
This section describes v1; Streaming (v2) covers the tiled container, which streams the same way with narrower spans.
The format needs no side files to stream. The structural prefix
[0, dataOffset) (header, metadata, index, optional dictionary; a few KB in
production) validates like a whole file minus the byte-content checks past
the prefix. An explicit offsets array costs roughly five bytes per frame,
under 1 KB for a 240-hour axis, so the prefix stays small enough to fetch in
one range request. A streaming reader then range-fetches payload spans on
demand; the per-group contiguity above means the bytes for one frame form
one or two contiguous spans. Integrity comes from the per-plane CRC-32 and
the Zstandard frame checksums, so a whole-file checksum is only meaningful
for full downloads.
Error Handling
These rules apply to both versions except where they name a v1 structure; Error handling, additions for v2 adds the tiled index’s own.
A decoder must reject:
- Unknown container versions, and metadata
schemaVersionvalues the decoder does not implement. - Nonzero reserved fields in a known version.
- Unknown predictor, compression, or flags values, and a
variableIdthat is not one of the file’s own metadatavariables(“unknown” here means absent from this file, not absent from any registry; there is none). - ZSTD_DICT entries when
dictionaryLengthis 0. - Entries overlapping the header, metadata, index, or dictionary.
- Overlapping payload ranges (ZERO entries may have zero length).
- Unindexed gaps between sections or payloads, and nonzero padding bytes.
- Duplicate
(variableId, frameOffset)pairs. - A
timeblock declaring bothframeStepandframeOffsets, or neither; aframeOffsetsarray that is not strictly increasing, whose length differs fromframeCount, whose first element differs fromfirstFrameOffset, whose steps are all equal, or that contains an offset above 65534; a uniform axis whose last offsetfirstFrameOffset + (frameCount − 1) × frameStepexceeds 65534; aunitSecondsthat is not a whole divisor of 3600 or is finer than the offsets need; a field the time block does not define; a version 1 or 2 block carrying a version 3 field, or the reverse. The same rules apply to a version 1 or 2 axis under its own field names. - A
parameterblock in a file below schemaVersion 3, or a variable without one in a schemaVersion 3 file; a parameter code outside 0–255; a fixed surface with exactly one of its scale factor and scaled valuenull; a key the block does not define. - A
band,produceroraerosolblock in a file below schemaVersion 3; a block that is not an object (nullincluded); abandblock missing one of its five fields, carrying a value outside its range, or carrying a key it does not define; aproducerblock missingidorversion, whoseiddoes not match^[a-z][a-z0-9]*$, whoseversionis not a non-empty string, or carrying a key it does not define; anaerosolblock missing one of its eleven fields or carrying a key it does not define, a type outside its range, a limit with exactly one of its scale factor and scaled valuenull, anulllimit under an interval type other than 255, or a non-nulllimit under type 255. - An
ensembleblock in a file below schemaVersion 3; one that is not an object (nullincluded); one whose keys are not exactly one of the three shapes (derivedForecastalone,percentileValuealone, orprobabilityTypewith its four limit fields); a value outside its range; a limit with exactly one of its scale factor and scaled valuenull; a limit that isnullwhere its probability type uses it, or notnullwhere the type does not. - A
grid.projectionthat is not an object (nullincluded), whosekindis not one the decoder implements, missing one of its ten fields, carrying a key it does not define, with a field of the wrong type or not finite, aradiusthat is not positive, a standard parallel orlatitudeOfOriginat or past a pole, standard parallels that sum to zero, acentralMeridianoutside ±180, adxthat is not positive or adythat is not negative. A grid carryingprojectionand any of the four regular fields orgaussian, evennull, or whosewrapLongitudeis anything butfalse. - A
grid.gaussianthat is not an object (nullincluded), in a file of any version but 3, missing one of its three fields or carrying a key it does not define, with annoutside 1–32768, a negativefirstRow, arowStridebelow 1, or a last rowfirstRow + (height − 1) × rowStrideat or past2n. - A declared
schemaVersionother than the lowest able to express the metadata: a schemaVersion 2 file that declaresstepHours, a schemaVersion 1 or 2 file whose variables carryparameteror whose time block names a unit, a schemaVersion 4 file withoutgrid.projection, or a file below schemaVersion 4 with one. - An incomplete frame sequence for any declared variable. The expected
sequence is
frameOffsetswhen present, andfirstFrameOffset + i * frameStepotherwise; a decoder must never reconstruct it arithmetically whenframeOffsetsis present. - ANCHOR or PREVIOUS dependencies that leave the variable or temporal
group, cyclic dependencies, or chains deeper than the group length; a
PREVIOUS entry whose
dependencyOffsetis not exactly the preceding frame on the axis (the 65535 sentinel included). - Any integer computation that would overflow (use checked arithmetic).
- A plane whose CRC-32 or Zstandard checksum fails.
Container v2
Container v2 changes what a payload is: a chunk, one spatial tile of one temporal group for one variable, instead of one whole plane of one frame. A file holds the same set of quantized codes as its v1 counterpart, cut into tiles and packed group by group, so a reader can fetch the region it is looking at, and read one cell’s series by fetching one chunk per group. An encoder writes one version or the other for a whole file; there is no mixing.
The fixed header, the metadata JSON (schema versions 1–3, variable identity, the time axis, regional grids), the quantization codebooks and the modulo-256 residual arithmetic are shared with v1 and are not repeated here.
Tiling is a storage property, not a dataset property: the grid, the time axis, the variable identities and the codebooks are unchanged, so the metadata JSON is byte-for-byte what a v1 file of the same data would carry and the tiling appears only in the binary index.
FixedHeader (v2)
Identical to v1 in layout and rules, with version = 2. flags stays 0.
Section adjacency, alignment and zero padding are validated exactly as in
v1; indexLength covers the IndexHeader and all three tables.
Tiles
The grid declared in the metadata is cut into tiles of
tileWidth × tileHeight cells, starting at the grid’s first cell (the
north-west corner in the published layout) and laid out row-major:
Tiles in the last column and the last row are clipped to the grid; the width
of a clipped tile is width − (tileColumns − 1) × tileWidth, and likewise
for its height. A file must declare 1 ≤ tileWidth ≤ width and
1 ≤ tileHeight ≤ height, so a file with one tile declares its grid size
exactly. tileColumns, tileRows and tileCount are derived from the
metadata grid and never stored, so the geometry has one encoding.
Tiles are cells, never degrees: the geographic footprint of a tile follows
from the grid block, and the horizontal wrap of a global grid is a
property of the grid, not of any tile; the last tile column does not wrap
into the first.
Temporal groups
A group is a run of consecutive frames on the time axis. The groups of a
file partition the axis in order: the first group starts at frame index 0,
each group starts where the previous one ends, and the last group ends at
frameCount. Every variable in the file uses the same groups (a file has
one axis). A group’s frames are stored inside every chunk of that group in
axis order.
Grouping is chosen by the encoder (see Encoder rules); a decoder validates the partition and nothing else about it.
IndexHeader (v2)
| Offset | Length | Type | Field | Rule |
|---|---|---|---|---|
| 0 | 4 | bytes | magic | ASCII IDX2 |
| 4 | 2 | u16 | version | 2 |
| 6 | 2 | u16 | headerSize | 32 |
| 8 | 2 | u16 | tileWidth | 1 ≤ tileWidth ≤ grid.width |
| 10 | 2 | u16 | tileHeight | 1 ≤ tileHeight ≤ grid.height |
| 12 | 2 | u16 | groupCount | ≥ 1 |
| 14 | 1 | u8 | variableCount | ≥ 1, equals the number of metadata variables |
| 15 | 1 | u8 | compression | 1 ZSTD or 2 ZSTD_DICT, for every chunk |
| 16 | 4 | u32 | chunkCount | Must equal groupCount × tileCount × variableCount |
| 20 | 4 | u32 | reserved | 0 |
| 24 | 8 | u64 | reserved | 0 |
VariableEntry
One per variable, sorted by ascending variableId; the set must equal the
metadata’s variables.
| Offset | Length | Type | Field | Rule |
|---|---|---|---|---|
| 0 | 1 | u8 | variableId | A handle into this file’s metadata (unchanged from v1) |
| 1 | 1 | u8 | predictor | 0 RAW or 2 PREVIOUS |
| 2 | 2 | u16 | reserved | 0 |
The predictor applies to every chunk of the variable. ANCHOR (1) and ZERO (3) are not valid in v2: a chunk is decompressed whole, so an anchor adds no random access and would only give one chunk a second valid encoding.
GroupEntry
One per group, in axis order.
| Offset | Length | Type | Field | Rule |
|---|---|---|---|---|
| 0 | 2 | u16 | firstFrame | Index into the axis (not a frame offset); 0 for the first group, the previous group’s firstFrame + frameCount otherwise |
| 2 | 1 | u8 | frameCount | 1–255; the last group must end exactly at the axis’s frameCount |
| 3 | 1 | u8 | reserved | 0 |
ChunkEntry and chunk order
One per chunk, in physical order:
| Offset | Length | Type | Field | Rule |
|---|---|---|---|---|
| 0 | 4 | u32 | compressedLength | ≥ 1 |
| 4 | 4 | u32 | crc32 | CRC-32/IEEE of the reconstructed chunk |
A chunk’s offset is not stored. Payloads are contiguous in position order
starting at dataOffset: the offset of chunk 0 is dataOffset and the
offset of chunk p + 1 is the offset of chunk p plus its
compressedLength. fileSize = align8(end of the last chunk), and every
padding byte is zero. All of this is checked arithmetic against fileSize
before any allocation. Since the order is fixed by this specification and
the chunks are strictly adjacent, a stored offset would be redundant and
would more than double the index.
This order serves the three access patterns: a whole group is one contiguous span (a global view fetches what v1 fetched); the tiles a viewport needs form one contiguous span per tile row per group; and one cell’s series is one chunk per group, with the two components of a wind bundle adjacent.
Chunk contents
Every chunk is one independent Zstandard frame that must carry a content checksum, decompressing to exactly
bytes (the tile’s clipped height and width), laid out frame-major: the
group’s frames in axis order, each as the tile’s rows top to bottom, each
row west to east, the same orientation as the plane. With ZSTD_DICT the
embedded dictionary applies, and a ZSTD_DICT file with dictionaryLength = 0
is invalid.
The reconstructed chunk is derived from the decompressed bytes by the variable’s predictor:
- RAW: the bytes are the codes.
- PREVIOUS: the first frame’s bytes are its codes; every later frame’s
bytes are the modulo-256 residual against the reconstructed previous
frame of the same chunk, which is the preceding frame on the axis because
groups are contiguous.
residual = (current − previous) mod 256,current = (residual + previous) mod 256.
crc32 covers the reconstructed chunk in the same frame-major layout. A
decoder must reject a chunk whose Zstandard checksum, decompressed length or
CRC-32 fails, and must not allocate more than decodedLength (or a
configured safety limit) from file values.
Decoding a frame and a series
A frame of a variable is assembled from the chunks of its group for the
tiles wanted: each chunk contributes the frame’s tile.height × tile.width
block at the tile’s grid position. A reader may assemble a partial plane
from a subset of tiles; which tiles it holds is then part of the frame’s
state, and a renderer must not draw cells no tile has covered.
One cell’s series is the cell’s byte from the frame block of the tile containing it, in every group’s chunk of that tile. The cost of a series is one chunk per group of one tile, independent of the number of frames.
Streaming (v2)
The structural prefix [0, dataOffset) validates as in v1. A streaming
reader derives every chunk’s byte span from the index and range-fetches
spans on demand; the spans a viewport needs are contiguous per tile row and
may be coalesced across small gaps at the reader’s discretion. Integrity is
per chunk (Zstandard checksum plus CRC-32).
The index is larger than v1’s: the chunk count is the group count times the tile count times the variable count, at 8 bytes each (94 KB for a 420-tile, 28-group GFS bundle). That is one extra range request before the first frame.
Error handling, additions for v2
A decoder must reject, in addition to the v1 rules that still apply (unknown container versions, section geometry, padding, dictionary presence, overflow):
- An IndexHeader whose magic, version or headerSize differ, or whose reserved words are nonzero.
tileWidthortileHeightof zero or larger than the grid.- A
variableCountor variable set that differs from the metadata’s own (everyvariableIdhere must be avariableIdthere, and the two sets must be equal); unsorted or duplicatevariableIds; a predictor other than RAW or PREVIOUS; nonzero reserved fields. - Groups that do not partition the axis: a first group not starting at 0, a
gap or overlap between consecutive groups, a
frameCountof 0, or a last group not ending at the axis’sframeCount. - A
chunkCountother thangroupCount × tileCount × variableCount, or anindexLengthother than the header plus the three tables. - A
compressedLengthof 0, or chunk spans that exceedfileSizeor leavefileSize ≠ align8(end of the last chunk). - A Zstandard frame without a content checksum, or one whose decompressed
length differs from
decodedLength. - A reconstructed chunk whose CRC-32 fails.
Encoder rules (v2)
Normative for byte identity between the two encoders:
- Every variable’s grouping is
GROUP_LENGTH = 6frames, formed inside segments of constant step exactly as v1’s temporal grouping, applied once per file to the shared axis. A trailing short group is its own group. - Predictor: RAW for
prate,crefand the categoricalptype; PREVIOUS for every linear-codebook field. - Tile size is a per-source registry value; a reduced-resolution variant
decimated by
f(2, 4 or 8: everyf-th row and column of the canonical plane, from row and column 0; the 3.9 µm window’s sites carry the largest code withinf / 2cells,satellite.md) uses(ceil(tileWidth / f), ceil(tileHeight / f)), so a tile with the same number covers the same ground in every tier. A regional (cropped) file tiles its own grid from its own origin with the source’s tile size. - The tile is then clamped to the grid:
min(tileWidth, width)andmin(tileHeight, height). The format requires1 <= tile <= gridso that a single-tile file states its grid size exactly, and a regional crop is routinely smaller than its source’s tile (a six-degree showcase window is 24 x 24 cells against the 0.25-degree grid’s 48 x 52). Clamping makes such a file one tile. - Compression is ZSTD at the production level with the content checksum; no dictionary.
File Naming
A container is named after its bundle (bundle.md, “Bundle
naming”) with .xue: tmp2m.xue, wind10m.xue, tmp2m.half.xue. A run’s
manifest.json names each bundle’s container (path, byte length and
whole-file CRC-32) where one was written, beside or instead of its store;
the manifest and the latest.json pointer are delivery concerns defined by
the reference implementations (xuebuild/manifest.py,
web/src/data/manifest.ts), not by this container spec.
Retired artifacts readers still accept
The H.264 companion is retired: no encoder writes it and the viewer no
longer decodes it. A run or case published with it carries, beside a
scalar bundle, <variable>.h264 (a raw Annex B stream), its per-frame
index <variable>.h264.index.json and a debug playlist
<variable>.h264.m3u8, and its manifest entry carries a video block
(streamPath, indexPath, byteLength, crc32, codec, width,
height, gop, frameCount, metadataJson). Every manifest validator
admits an entry with that block and leaves it unread, whatever its shape;
the STAC Item of such a run still lists the two files as assets
(stac.md).
Part of the Xue specification, licensed under CC BY 4.0.
4 - The registry document
What an encoder needs to know about the variables, bundles and sources it
builds, as one JSON document. The Python tables in xuebuild/ author it
(xue registry prints it); the native encoder reads it in place of a
table of its own, so a table change is a document change and needs no
release. The committed snapshot rust/xue/registry.json is held to
the tables by a test.
The document is not a published artifact and not part of the format. What
reaches a store is the variable block of docs/bundle.md, which the
label, unit, parameter, producer, aerosol, ensemble and
quantization keys of a variable entry are, key for key: an encoder copies them into
attributes.xue, it never computes them. seriesQuantization reaches a
series store the same way, as that store’s quantization. Everything else
in an entry is how to obtain the field and what to do with it.
Shape
Bundle ids are the ^[a-z][a-z0-9]*$ strings the manifest admits; a
variable that is read and never published may carry _ (prate_ave). Keys are
camelCase. Every key of an entry is written, even when empty, except where
a key is marked optional below: an absent optional key means “none”.
registrySchema is the version of this document’s own shape. A reader
implements a set of schemas and refuses a document outside it before any
input is read. Adding a key an existing reader can ignore keeps the number;
changing what a reader must do with an existing key raises it.
Variables
| Key | Meaning |
|---|---|
label, unit, parameter, producer, aerosol, ensemble | Exactly the metadata blocks of docs/bundle.md. producer carries the id alone; the version is stamped on the series the producer wrote and read off it at build time. ensemble is the variable’s own statistic (a quartile, a spread, a probability); a shared variable whose record a source reads as an ensemble’s centre has none, and the source names the block it writes (ensembles, below). |
quantization | One codebook block per profile, each exactly as the metadata writes it. The type is one of the closed set below. A variable without this key is read and never published (tp, the categorical precipitation flags). |
seriesQuantization | Optional. The codebook a series store holds this variable’s codes in (docs/bundle.md, “Series codebooks”; docs/zarr-profile.md, “Series store”): one linear block whatever the profile, with a nodataCode above 255, so its codes are uint16. An encoder that writes a source’s seriesBundleIds writes every variable of those bundles that carries this key under it, quantized from the same plane as the profile’s codes, and puts the block in the series store’s metadata as the variable’s quantization; every other variable of a series store keeps its profile codebook. Absent: the series store holds the profile’s byte codes. Present exactly for tmp2m, ugrd10m, vgrd10m, prate and dswrf. |
valueRange | [low, high] in unit: the range the pipeline treats as the field’s own. |
fillValues | Values GDAL hands back where the record carries no data; folded to valueRange[0] before anything else touches the plane. |
static | True for a field read at the analysis alone and published as one frame. |
predictor | delta (chunks chain against the previous frame) or raw. |
decimation | How reduced tiers sample the full tier: sample (the site’s own code) or peak (the warmest code around the site). |
companions | The subset of poster, video this variable’s bundle ships beside the store. video is further subject to the source’s video flag. |
conversion | The unit rule: see below. |
match | How the record is found: see below. |
conversion
{"rule": <name>, …}. The rule names the arithmetic that takes a record’s
values to unit and the unit spellings it accepts a record under; a
record under any other spelling is an error. Spellings are compared after
compaction: lower-cased, whitespace and *()[] removed, ² written ^2.
| Rule | Accepts | Arithmetic |
|---|---|---|
none | the entry’s acceptedUnits list, compacted; no list = any unit | identity |
celsius | k, kelvin; c, celsius, degc; f, fahrenheit, degf (after dropping °, degrees, degree) | K − 273.15; (F − 32) × 5⁄9 |
soil-temperature | as celsius | as celsius, after the soil read-through: a plane GDAL labels [C] whose values are kelvins is kelvins |
precipitation-rate | kg/m^2s, kg/m2s, kgm^-2s^-1, kgm-2s-1; mm/h, mm/hr | × 3600; identity for mm/h |
precipitation-accumulation | -, m, empty; kg/m^2, kg/m2, kgm^-2, kgm-2, mm, kg/m^2s, kg/m^2*s, kg/m2s, kg/m2*s | × 1000 for metres; identity for the millimetre spellings |
pascal-to-hectopascal | pa | ÷ 100 |
metre-to-kilometre | m, metre, meter, metres, meters | ÷ 1000 |
mass-ratio-to-g-per-kg | kg/kg | × 1000 |
proportion-to-percent | proportion, fraction, 1, -, empty | × 100 |
cloud-cover | %; -, 1, fraction, proportion, 0-1 | identity for %; × 100 otherwise |
degrees-true | degreetrue, degtrue, degrees, degree, deg, degreestrue | value mod 360 |
geopotential-to-metres | gpm, m; m2/s2, m2s-2 (compacted further: ^ dropped too) | identity; ÷ 9.80665 for the geopotential |
mass-density-to-micrograms | kg/m^3, kg/m3, kgm^-3, kgm-3 | × 10⁹, kg/m³ to µg/m³ |
per-second-to-1e-5 | 1/s, /s, s-1, s^-1 | × 10⁵, s⁻¹ to 10⁻⁵ s⁻¹ |
code-table | 1, -, empty, the entry’s table, any spelling containing it or 0=no (after dropping codetable) | identity |
A GRIB record is accepted under the listed spellings alone. A series
variable read out of a NetCDF file is accepted, in addition, under the
variable’s own unit and its udunits spelling, which take the identity:
the scaling rules scale only under their listed input spellings, so a
series already in the published unit is left as it is.
The raster expression the two inspection paths compare (gdal.py,
inspect.rs) is derived from the rule and the unit alone and is never
written anywhere. A variable whose gdal list is empty matches no band;
that is not an error.
match
The first eleven keys are the fetch-side spellings of VariableSpec
(xuebuild/variables.py), one for one. statistical is the code table
4.10 process the record must carry (null: instantaneous). aliases are
other parameter triples on the same surface, alternates whole other
record identities, both accepted when matching and never written.
gdal is how the variable’s record is recognised among a GRIB’s bands as
GDAL describes them: a list of rules, the band is the record when any one
accepts it. Empty for a field no GRIB band carries (a derived field, a
series-file variable). Each rule reads the band’s GRIB_ELEMENT,
GRIB_SHORT_NAME, GRIB_COMMENT, GRIB_LEVEL, description and, for the
template rules, GRIB_PDS_PDTN, GRIB_PDS_TEMPLATE_ASSEMBLED_VALUES and
GRIB_DISCIPLINE; the “text” is the short name, comment, level and
description joined and lower-cased, except that isobaric, phrase,
local-parameter, total-precipitation and accumulation-from-start
search the comment, level and description without the short name.
accumulation-from-start also reads GRIB_FORECAST_SECONDS. Elements compare upper-cased; the
template-mrms element compares as written.
A band whose GRIB_PDS_PDTN is an ensemble template — 2, 12 (a derived
forecast), 6, 10 (a percentile), 5, 9 (a probability) — is a statistic of
an ensemble’s members, which the element and surface do not tell from the
quantity (GDAL spells a spread as it spells the mean): only a
template-ensemble rule accepts it, every other rule refuses it. The GRIB2
header index applies the same rules to the octets it reads, and a variable
that carries its own ensemble block matches no record of another
template.
| Rule | Parameters | Accepts the band when |
|---|---|---|
surface | elements | the element is one of elements, and the short name ends in -SFC, or the text contains sfc=" or ground or water surface |
height | element, metres | the element matches, and the short name is <metres>-HTGL or <metres>-M-HTGL, or the text matches `(^ |
entire-atmosphere | element | the element matches, and the short name is 0-EATM or the text contains entire atmosphere |
mean-sea-level | elements | the element is one of elements, and the short name is 0-MSL or the text contains mean sea level |
isobaric | element, hpa | the element matches, and: where GRIB_PDS_PDTN is 0, 1, 8 or 11 and the assembled values (with GRIB_DISCIPLINE) give a first surface of type 100 with a value of whole pascals (the scaled value at index 11 times 10 to the minus the scale factor at index 10, a scale factor of at most 9 either way), that value is <hpa×100>; otherwise the short name is <hpa>-ISBL or <hpa×100>-ISBL, or the text names this level as <hpa> mb/hPa or <hpa×100> Pa and no other. The template decides first because GDAL spells 10 hPa 1000-ISBL, 1000 hPa’s short name in hectopascals |
cloud-layer | element, shortName, phrases | the element matches, and the short name is shortName or the text contains one of phrases |
template | — | GRIB_PDS_PDTN is 0 and the assembled values’ parameter category and number, surface type and surface value equal the entry’s parameter or one of its alternates (a null level value accepts any) |
template-aerosol | — | GRIB_PDS_PDTN is 48 and the assembled values equal the entry’s parameter and aerosol blocks whole |
template-ensemble | discipline, category, number, levelType, levelValue, ensemble, hours, statistical | see below |
template-rank | — | the element is match.gribElement, then as template against the entry’s own identity, the surface value being the rank; without an assembled template, the short name is <rank>-RESERVED(<surface type>) |
template-mrms | — | the element is the entry’s mrmsProduct up to its first _, the discipline is 209, and the assembled template 4.0 values equal the entry’s discipline-209 alternate (or its own identity); without an assembled template, a surface of type 102 must spell <value>-GPML in the short name |
total-precipitation | — | the element is unknown, tp, apcp or tprate; the short name is 0-SFC or the text contains surface; and the comment contains cat 1, subcat 193 or the text total precipitation |
accumulation-from-start | — | the element is APCP followed by nothing or by digits (GDAL names an accumulation by its length in hours, APCP06, APCP264, and the empty interval APCP); GRIB_PDS_PDTN is 8; GRIB_FORECAST_SECONDS, for template 4.8 the interval’s start, reads as 0 (a run total, where a window that starts later, the NAM’s APCP06 at 21600 s, is refused); and the short name is 0-SFC or the text contains ground or water surface |
local-parameter | category, number | the element is unknown, the short name is 0-SFC or the text contains ground or water surface, and the comment contains cat <category>, subcat <number> |
phrase | element, phrases | the element matches and the text contains one of phrases |
geopotential-surface | elements | the element is one of elements, the short name ends in -SFC or the text contains ground or water surface, and the text contains geopotential |
template-ensemble names the record whole:
levelValue is a number or null (any value, a missing one included);
ensemble is a block of docs/bundle.md §“Ensemble”; hours and
statistical are both integers (an interval of at least one hour and its
code table 4.10 process) or both null. It accepts a band when all hold:
GRIB_PDS_PDTNis the template of the block’s shape: a derived forecast 2 (hoursnull) or 12 (hoursset), a percentile 6 or 10, a probability 5 or 9;- the leading integer of
GRIB_DISCIPLINEisdiscipline; - in
GRIB_PDS_TEMPLATE_ASSEMBLED_VALUES(space-separated integers, from index 0): index 0 iscategory, 1number, 9levelType, and whenlevelValueis notnullthe surface value, index 11 × 10^−(index 10), equals it (a missing pair never equals a number); - the record’s statistic equals
ensemble. After the fifteen values every template shares with 4.0, a derived forecast’s code is index 15, a percentile’s index 15, a probability’s type index 17 with the lower limit at 18–19 and the upper at 20–21; a limit with either half missing isnull, and a probability keeps only the limits its type uses (types 0, 3, 5 the lower, 1, 4 the upper, 2 both), whatever the record wrote in the others; - of an interval template, there is exactly one time range, its unit is
hours (1), its length is
hoursand its processstatistical: indices 23, 25, 27, 28 of 4.12, 22, 24, 26, 27 of 4.10, 28, 30, 32, 33 of 4.9 (the range count, the process, the unit, the length).
A missing scale factor is −127 or 255 and a missing scaled value −2147483647 or 4294967295, whichever way the driver assembles them. A template the driver did not assemble, or assembled short, is no record.
Bundles
A bundle id absent from bundles is the scalar bundle of the variable of
the same id. Every other bundle is listed:
| Key | Meaning |
|---|---|
kind | scalar, vector (two members, u then v), composite (members an algorithm produced in the fetch stage, read off the series), volume (members read directly, lowest level first). |
members | The variables the bundle’s arrays hold, in file order (variableId 1…n). Absent for a scalar. |
derivation | optional. The members are computed in the converter from inputs, by the named algorithm. levelHpa is written where the algorithm takes the surface. |
producer, inputs, optionalInputs | A composite’s producer id, the channels it reads, and the subset of those a source may lack (read when the source fetches them, left out otherwise). |
derivation.kind is one of the closed set: vapour-flux (q·V/g from a
specific humidity and a wind pair), wave-vector (a height laid along a
direction), theta-e (Bolton’s equivalent potential temperature at
levelHpa), precipitation-type (the four categorical flags combined),
clear-air-turbulence (Ellrod at levelHpa, calibrated by the source’s
catCalibration), precipitation-rate (the first of inputs the source
lists, de-accumulated, de-averaged, divided by its interval, differenced
within its window or taken as is by the source’s precipitation flags).
Sources
One entry per source, every field of xuebuild/sources.py’s SourceSpec
under its camelCase name, nested records as objects, tuples as arrays —
except feed and packing, which only the fetch reads (the native
encoder never fetches), and columnArrays, which only build-columns reads
(zarr-profile.md, “Column store”). A companion family’s repack is always false:
repacking is the source’s packing, not a family’s.
The four precipitation flags name how the source’s precipitation input
becomes prate, and a source sets at most one: accumulatedPrecipitation
(a total since the run began, differenced against the previous frame),
averagedPrecipitation (a mean rate since the start of a window of
averageWindowHours, scaled to a total and differenced within the window),
intervalPrecipitation (the total over the interval ending at the frame,
divided by the interval’s hours) and windowedPrecipitation (a total since
the start of a window of accumulationWindowHours, differenced against
the previous frame of the same window and, on the window’s first frame,
against zero). A window that ends at hour h starts at
w × ⌊(h − 1) / w⌋ for its length w. A source that sets none reads the
rate as it is.
ensembles names, per published variable that is an ensemble’s centre
standing in for the deterministic field under its id, the ensemble block
written onto that variable’s metadata, as bands names a channel’s.
intervalPrecipitationPairs are further [rate, total] pairs an
intervalPrecipitation source derives the way it derives prate from its
input: the total over the interval ending at the frame divided by the
interval’s hours, on the same axis and analysis-optional through the
total’s own optionalAtAnalysis entry; the rate is then the bundle the
total is read for. variableFirstHours names inputs absent from every
frame before an hour (an integer above 0): no earlier frame is read for
them or required to carry them, they never key a run’s axis, and the
series of a bundle read from them starts at that hour, on a time_<id>
axis of its own; a build that ends before the hour leaves the bundle out.
variableStepHours names inputs written only every so many hours (an
integer above 0), counted from the input’s first hour (0 when
variableFirstHours does not name it): a frame at hour h carries one
exactly when h is at least the first hour and h less the first hour is
a multiple of the step. No other frame is read for it or required to carry
it, it never keys a run’s axis, and a bundle read from it is on a
time_<id> axis of its own, the run’s axis thinned to those hours — even
when its first hour is the analysis.
downsample is {"factor": n} or null. gridRelativeWinds is true on a
source published on a map projection, whose wind pairs a reader turns to east and
north (docs/encoder.md, “Native grids”), and whose bundles are on y and x.
gaussianN is the latitudes per hemisphere of a primary grid that is regular
Gaussian, or null. The meaning of each field is SourceSpec’s docstring and
docs/contribution/sources.md.
The shell’s copy
xue registry --shell web/src/data/registry.ts writes, beside the document,
the part of it the shell reads, as a TypeScript module (export const REGISTRY = {…} as const) so the ids reach the type checker as literal
unions. It carries every published variable’s unit, parameter,
producer, aerosol, ensemble and quality codebook; every bundle’s kind and
members; each source’s label (manifestModel), product,
latestFilename, observation, coreBundleIds and cadenceSeconds;
and, from the same tables, the isobaric, turbulence, stratosphere and
relative vorticity levels, the family
lists the shell’s rail groups by, the pressure family’s contour intervals
and the tropical cyclone registry (xuebuild/tc/registry.py). It is not
a published artifact either, and it is held to the tables by the same test
as the document.
Closed sets
A reader implements these names and refuses a document that names any
other, as it refuses a registrySchema it does not implement. Adding a
name is a behaviour change and needs the readers released; using an
existing name on a new entry does not.
| Field | Names |
|---|---|
quantization.<profile>.type | linear, log1p |
seriesQuantization.type | linear |
conversion.rule | the thirteen rules above |
match.gdal[].rule | the fifteen rules above |
predictor | delta, raw |
decimation | sample, peak |
companions[] | poster, video |
bundles.<id>.kind | scalar, vector, composite, volume |
derivation.kind | the six algorithms above |
sources.<id>.downsample | the one shape |
Validation
Before reading any input, a reader checks: the schema; every name above;
that every members, inputs and derivation.inputs id is a variable;
that every bundle id a source lists is a variable or a bundles entry;
that every id a source’s ensembles, intervalPrecipitationPairs,
variableFirstHours and variableStepHours name is a variable, the pairs
only on an intervalPrecipitation source and every first hour and step
above 0;
that a source sets at most one precipitation flag, and a
windowedPrecipitation source an accumulationWindowHours above 0;
that a vector has two members; that a published variable (one with
quantization) has every profile the reader is asked for; that a
seriesQuantization is a linear codebook whose code range follows from its
parameters, every code from 0 to 65535 and its nodataCode above 255, so
its codes are sixteen-bit; and that every profile codebook under
quantization keeps every code from 0 to 255. Any failure
refuses the whole build. A build is handed one source’s part of the document:
that source, the bundles it publishes and the variables they read
(registry.source_document_json), so these checks stop only the sources
that reach the problem.
Part of the Xue specification, licensed under CC BY 4.0.
5 - The native encoder
xuebuild/ is the reference encoder: Python driving GDAL and zstd as CLI
subprocesses. rust/xue/src/encode/ is the same convert-bin pipeline
written in Rust with those tools linked in process, behind the xue crate’s
off-by-default encoder feature, and published as the xuepy wheel.
A build converts through it by default. The Python encoder remains the reference (a format change lands there first), and the native encoder is held to it by byte-for-byte identical output.
Motivation
Profiling the Python pipeline put the remaining wall time in extraction:
gdal_translate -of ENVI -ot Float64 writes every plane to disk as float64
and the encoder reads it back. A full GFS run is 121 files × 4 variables ×
1.04 M points × 8 bytes ≈ 4 GB written and re-read per build, plus one
subprocess per file. Reading the same bands through GDAL’s C API skips all
of it.
Components
| Stage | Python | Native |
|---|---|---|
| grid + band metadata | gdalinfo -json subprocess | gdal-sys (georust) in process, exported back to Python as xue.gdal_info so xuebuild can inspect without a system GDAL |
| plane extraction | gdal_translate → ENVI → np.fromfile | GDALRasterIO into a Vec<f64>; PNG-packed GRIB2 (template 5.41, every MRMS product) inflated directly (gribpng.rs), with the single-precision unpack calibrated against one GDAL read per process |
| GRIB2 record index | hand-rolled section walker (xuebuild/grib2.py) | grib-rs |
| compression | compression.zstd / zstd CLI | zstd crate (ZSTD_compress2) |
| poster deflate | zlib.compress(level=9) | flate2 on libz |
| read-back verify | xuebuild/binformat.py reference reader | the xue decoder crate, the same code the browser runs |
gdal-sys is used rather than the high-level gdal crate because, as of
gdal 0.19, the safe wrapper does not compile against GDAL 3.13 (its
GDALDataType and GDALRasterIOExtraArg changed shape). The surface needed
here is a dozen stable C functions (src/gdalio.rs).
GDAL’s GRIB driver takes about 0.3 s to unpack one 7000 × 3500 MRMS plane
whose PNG inflates in under 10 ms; gribpng.rs reads it in about 80 ms. Its
values must be GDAL’s to the bit. g2clib computes refD + bdscale × X in
single precision, and whether that multiply-add is fused depends on how the
linked GDAL was compiled. So the first eligible plane is read both ways, and
the arithmetic that reproduces GDAL is used from then on. If neither does,
every read stays on GDAL.
Each band is taken through the whole per-plane chain (column roll, fill
values, block thinning, crop, the completeness check, unit
conversion) as soon as it is read, before the next band is read, so a
worker holds one full-resolution plane at a time rather than every record
of its file. That matters for the MRMS 3D mosaic, whose frame is 33
records of 7000 × 3500 doubles: 6.5 GB read whole, 196 MB a plane. A file
the netCDF driver reads is the exception: its reads stay serialized under
netcdf_guard, and its planes are finished after the guard is released.
Building
GDAL must be discoverable through pkg-config, and gdal-sys generates its
bindings with bindgen, so libclang must be present too:
Or, from the repository root, make encoder-rust.
Using
--skip-video is accepted and ignored: no encoder builds the retired H.264
companion.
In the build pipeline
xuebuild depends on the xuepy wheel and converts through it by default.
xuebuild/encoder.py is the dispatch and XUE_ENCODER overrides it:
XUE_ENCODER | |
|---|---|
auto (default) | the native encoder when the wheel imports, the Python pipeline otherwise |
native | require the wheel; fail if it is missing |
python | the reference pipeline, whatever is installed |
make check reports which one a build would take. The scheduled publish-*
workflows pin native: a run that fell back to the Python pipeline would
take hours longer and look identical in the logs. publish-jma.yml and the
other rolling windows are the exception: a wheel ships on the crate’s
tags, so the wheel on PyPI can predate a rule the registry document now
names, and a scheduled run cannot pass an input. Their Resolve the encoder step asks native.knows_source(model) and sets
XUE_ENCODER=native when the installed wheel implements the document,
else python with GDAL installed and a ::warning:: on the run, so the
fall back is explicit rather than silent; a dispatch can still insist on
either. The question is the wheel’s validate_build(registry=..., model=..., bundle_ids=...): the checks convert_bin makes before it reads any input
(the document, the source, the profile’s codebooks, the bundle list), run
alone. It returns None, or raises xue.UnsupportedRegistry (a
RuntimeError) naming what this wheel does not implement, which is the one
answer that falls back. Anything else it raises fails the step: the
reference pipeline runs through the same wheel, so a broken wheel would
fail that build too. A wheel without validate_build is asked with an
empty conversion instead, and only its refusal of the empty input list
(no GRIB files given, or a series-file source’s a <model> build takes one NetCDF series, …) counts as a yes.
The registry document
The native encoder holds no table of variables, bundles or sources. It
reads the registry document (registry.md) — the one JSON
document the Python tables author and xue registry prints — and builds
from that: every codebook, every GRIB band rule, every unit conversion,
every bundle’s members and derivation, every source’s inputs and grid
come out of the document (rust/xue/src/encode/registry.rs parses it,
units.rs and inspect.rs implement its rule names). No code path in
rust/xue/src/encode/ selects behaviour by matching a variable or bundle
id; what an id means is what its entry says.
The document reaches the encoder two ways:
- the wheel’s
convert_bin(..., registry=...)takes it as a required keyword argument carrying the JSON text, andxuebuild/native.pypassesxuebuild.registry.document_json()on every call, andvalidate_build(registry=...)takes it the same way;xue.quantizetakes the sameregistry=keyword, since a codebook is a block of the document; xue-encode convert-bintakes--registry <path>, and without one reads the snapshot embedded at build time,rust/xue/registry.json, whichxue registry --output rust/xue/registry.jsonregenerates andtests/test_registry.pyholds to the Python tables.
The encoder validates the document it is handed before any input is read
(registry.md §Validation) and refuses it with the field and value named
when it carries a registrySchema, a rule, a derivation or a codebook
type the encoder does not implement; a key it does not know it ignores. A
build hands it only its own source’s part (registry.source_document_json),
so a rule a wheel lacks stops the sources that use it and no others.
So a table change — a new source, a new bundle, another level of a known
family, a changed codebook, a changed set of inputs — is a commit to
main and needs no release: the next build hands the new document to the
wheel already installed. A release is still needed for what the document
cannot say: a new rule name under conversion or match.gdal, a new
derivation.kind or codebook type, a new ingest path (a file shape the
converter does not read), or a registrySchema bump, each of which the
installed wheel refuses, for the sources that use it, until the wheel that
implements it ships. A seriesQuantization is the exception that is not
refused: a wheel that predates it ignores the key and writes the series
store on byte codes, so a codebook enters SERIES_CODEBOOKS only once the
wheel the builds run writes sixteen-bit series stores.
The native encoder writes the Zarr stores’ arrays itself, straight from its
codes (rust/xue/src/encode/zarrstore.rs, the counterpart of
zarrstore.write_bundle_arrays over a CodesSource), with the series
stores for the bundles the caller names (SourceSpec.series_bundle_ids,
passed in by native.py). A series store’s widened variables
(zarr-profile.md, “Series store”) follow the
reference’s rule over the same document: every variable of those bundles
(of bundle_ids alone on a restricted build) whose registry entry carries
a seriesQuantization is quantized a second time in the per-file stage,
from the float plane its byte codes come from, with the same round-half-up
and clamp, into sixteen-bit codes. Those go to a spool, one file per
variable in a scratch directory of the build’s own under the system
temporary directory (xue-series-<pid>-<n>; the wheel takes no work
directory, and the output is never used, since a publish uploads it),
frame-major and little-endian, by positioned writes as each file finishes;
the series writer reads them back one block row (every frame of eight grid
rows) at a time, writes the variable as a uint16 array under the series
metadata (the bundle’s, the block as that variable’s quantization), and
deletes the variable’s file once its store is written; the directory goes
when the build returns, failed or not (only a process killed outright
leaves it, in the temporary directory). Every other variable of a series
store, and every map store, container and tier, keeps its byte codes
exactly. The wheel’s write_store takes uint16 planes for such a
variable too, which is what tests/_support.py::native_writes_wide_series
asks before a parity test over widened series stores runs. It does not
write two artifacts, and xuebuild/native.py supplies them:
The shared stores’ group documents. See “Shared stores” below.
The live pointer. It carries the manifest’s CRC32, and stamping the shared stores’ CRCs in changes the manifest, so the native encoder has no pointer writer: it writes the manifest alone and the pointer is written afterwards, from the finished bytes. The wheel’s
convert_binstill acceptslatest_pathandrun_idand ignores them.
tests/test_native.py holds the two together: one build through each
encoder into identically shaped directories, then every artifact compared
byte for byte (stores, containers where written, reduced-resolution
variants, posters, manifest.json, and the live pointer), and one fanned-out job’s arrays,
parts and partial manifest the same way. tests/test_zarr.py also holds the
two one-bundle store writers to the same bytes directly (xue.write_store).
Shared stores
A run’s map stores are shared (zarr-profile.md,
profile 2): every bundle of one tier in bundles[.<tier>].zarr. The call
boundary is the partial group document. For every build, whole or one job
of a fan-out, the wheel writes into each tier’s shared store:
- every bundle’s variable arrays, as a one-bundle store’s but with
attributes.xue.bundleleading the block and the bundle’s dimension names (discover.store_dimensions:time_<bundle id>for a published scalar inanalysis_optional_idsor a static first variable,latitude_<family>/longitude_<family>,<family>the idbundle_grid_familyreturns, for a bundle off the primary grid); - every coordinate array those names call for, the same bytes whichever bundle writes it;
- one partial group document,
zarr.part.<first bundle id>.json— the profile’s group document (zarrstore.group_document, same key orders, same serializer aszarrstore._dump_json) over the bundles this build wrote, in manifest order — and nozarr.json;
and names each store in its manifest entries with the entry’s byteLength
(its arrays and the coordinates it uses) and the part’s CRC-32 as
crc32, writing the manifest where native.py asks
(.<manifest>.native, beside the real one). native.py then, unless the
build is a fan-out job (partial=True), calls
zarrstore.finalize_store on each store — the reference’s own merge, which
writes zarr.json and removes the part — and stamps the group document’s
CRC-32 on every entry naming the store as it writes the real manifest. A
fan-out job keeps the part and the part’s CRC; assemble-run does the
rest, as for the reference.
This keeps byte identity to what the native side writes anyway (arrays,
coordinates, and one JSON document per store in the profile’s serializer)
and gives the group document, the merge with parts and live documents and
the CRC stamping one implementation, the reference’s. The wheel’s own
store reader opens a profile-2 group by bundle id
(zarr::parse_group_metadata_for(text, bundle_id)), which the encoder’s
read-back self-check uses.
Column stores
A run’s column store (zarr-profile.md, “Column store”)
is cut after the run is finished, from its map stores, so it is a call of its
own rather than part of a conversion: xue.write_columns
(rust/xue/src/encode/columns.rs), the counterpart of
columns.write_column_store. It is data processing alone. It takes no
registry document and knows no source; it takes a plan, the one document
both writers are called with, as JSON text:
store is relative to the run directory. The metadata, grid, axis,
codebooks, codes and tiling are read from the stores named, of either
profile: of each, the group document, whose consolidated metadata holds
every array’s, and each member’s shard. A columnsPlan, key or predictor
this writer does not implement is refused, and so is what a column store
cannot hold: members of one array that differ in axis or nodata code,
members of one store that differ in run, profile or grid (1 and 1.0
differ, as they are spelled apart in a document), a projected grid.
The Python side makes the plan from the source’s column_arrays, the
registry and the manifest.
The unit of work is one shard of one array: a band of 96 rows, every level
over the whole axis, held uncompressed. A worker seeks to the inner chunks
of the map shards that overlap its band and decodes them one at a time, and
writes each payload as it is compressed, so memory is one band per worker:
for twenty-one levels of a 161-frame axis on the 0.25° global grid, 467 MB
each. The shards run in a pool of jobs threads and the bytes do not depend
on how many. The level is 6, not the grid stores’ 15
(zarr-profile.md). Every chunk is decompressed again and compared with what went
in, and the group document is parsed by the decoder’s reader
(column::ColumnGroup) twice: before the cut, so that what a reader would
refuse is refused at once, and as it is written. It is written last, by
rename; a cut that fails removes its directory, and an output that exists
is an error.
xuebuild/encoder.py picks the writer by XUE_ENCODER as it picks a
conversion’s: under auto a wheel without write_columns falls back to
Python, under native it is an error. tests/test_columns_native.py holds
the two to the same directory, byte for byte, over the committed fixture and
over synthetic stores, at one worker and at four.
Python bindings
rust/xue-py/ is a thin PyO3 + rust-numpy wrapper, published as the
xuepy distribution and imported as xue. It carries both halves of the
crate.
The decoder is Bundle, the same reader the browser runs through wasm.
Planes come back as uint8 NumPy arrays of quantized codes:
The encoder is convert_bin, which runs the whole native conversion and
returns the same report dictionary the Python pipeline returns, plus
quantize / encode_residual / decimate / encode_poster, which take
and return NumPy arrays so individual stages can be compared against
xuebuild/quantize.py and xuebuild/temporal.py without running a build,
write_store, which writes one bundle’s one-bundle (profile 1) Zarr
store from codes handed in as NumPy arrays, and write_columns, which cuts
a run’s column store (“Column stores” above):
convert_bin writes the Zarr stores alone by default (zarr=True,
container=False), as every live run publishes; container=True adds
each bundle’s .xue beside the stores, from the same codes, and
zarr=False, container=True writes the containers alone.
Installing
The wheel carries its own GDAL, so nothing else has to be installed and no
environment variable has to be set. The wheel is abi3-py314: one per
platform, not one per Python minor version. Linux wheels are
manylinux_2_39, tagged with the glibc of the ubuntu-24.04 runner that
built them, which means Ubuntu 24.04 and later, Debian 13 and later;
broader coverage would mean building inside a manylinux_2_28 container.
macOS is arm64 only.
Building a wheel
scripts/build-gdal-minimal.sh builds libaec, OpenJPEG, HDF5, netCDF, PROJ
and GDAL from source into build/gdal-minimal, and
scripts/build-encoder-wheel.sh stages GDAL’s and PROJ’s data directories
plus every licence text into the package, runs maturin, and lets delocate
(macOS) or auditwheel (Linux) move the shared libraries in. zlib and
sqlite3 come from the platform and are not bundled.
Why a bundled GDAL, and why a minimal one
The wheel has to carry GDAL, because the GRIB driver will not read a band
without GDAL’s own data directory: with GDAL_DATA unset it reports
Cannot find grib2_center.csv and then matches zero records, so record
matching fails outright rather than degrading.
A distribution GDAL is not suitable to carry. A package-manager build pulls a 318 MB closure of 227 shared libraries (Arrow, TileDB, OpenBLAS, libicu, x265), of which the encoder uses none. It also includes Poppler (GPL-2/3), x265 (GPL-2), libde265 (LGPL-3), libspatialite and mariadb-connector-c (LGPL), whose obligations a redistributed binary would have to answer for.
Built here with the GRIB and netCDF drivers, plus the JP2OpenJPEG driver the GRIB driver decodes JPEG 2000-packed records through (WAVEWATCH III packs the GFS-Wave files that way, DRS template 5.40), and nothing else, the whole closure is eight libraries:
| 16.4 MB | libgdal |
| 4.2 MB | libproj |
| 3.9 MB | libhdf5 |
| 1.2 MB | libnetcdf |
| 0.4 MB | libopenjp2 |
| libhdf5_hl, libaec, libsz |
plus 10.2 MB of proj.db and 3 MB of GDAL’s data tables: a 12 MB wheel.
zlib, sqlite3, libSystem and libc++ come from the platform.
Everything bundled is permissive and allows binary redistribution with
attribution: GDAL and PROJ (MIT), HDF5, libaec and OpenJPEG (BSD), netCDF
(MIT-style), and zlib and sqlite3 from the platform. Several ask explicitly
for their notice to travel with a binary, so the wheel carries them in
xue/licenses/.
Build problems and their fixes
Each is commented where it happens:
- Enumerating the codecs to disable does not work. GDAL probes several
through pkg-config, which has its own search path; a machine with
Homebrew ends up linking libjxl and Brotli into a build with no driver
able to use them, and because those were built for a newer macOS, the
wheel comes out tagged
macosx_26_0instead ofmacosx_11_0.GDAL_USE_EXTERNAL_LIBS=OFFplus the three dependencies by name is the reliable form, and for OpenJPEG the library’s path as well: GDAL’s probe goes through pkg-config, CMake caches what it found the first time the tree was configured, and a developer machine linked Homebrew’slibopenjp2into a wheel meant to carry its own. - CMake will compile against one copy of a library and link another. With
Homebrew’s HDF5 2.1 headers ahead of the 1.14 built here, netCDF built
cleanly and then failed at run time on every netCDF-4 file with
H5Pset_libver_bounds(): high bound is not valid, an enum value that only exists in the newer library.CMAKE_IGNORE_PREFIX_PATHkeeps the prefix and the platform SDK the only things in scope. delocatecannot vendor what it cannot resolve. The extension links libgdal by its@rpathinstall name, so the build passes-C link-arg=-Wl,-rpath,<prefix>/lib; delocate strips the rpath again once the libraries are copied in.
Equivalence
make encoder-rust-test runs the crate’s unit tests plus a golden test that
encodes tests/fixtures/gfs.2026081406.f000.crop.grib2 and demands the
exact bytes tests/prepare_bin_fixture.py produced with the Python encoder.
Four places needed care to reach that:
- The geotransform is what
gdalinfo -jsonprints, on both sides. GDAL writes each coefficient in fixed notation with sixteen decimals, then itsintelliroundcuts a trailing00000xor99999xas binary noise (the same code in 3.8 and 3.13), so a netCDF axis’s 0.012500000000000292 reads as 0.0125. The native encoder reads the doubles through the C API and passes them through the same formatting (gdalio::as_gdalinfo_json), which is also what the wheel’sgdal_inforeports, so the Python encoder sees one geotransform whichever GDAL it inspects through. A grid the snaps ingrid.rsclean (whole thousandths or arc-minutes, a global width) never noticed the difference; the CWA radar’s 0.0125° grid does. flate2links stock libz, notzlib-rs.zlib-rsis a port of zlib-ng, whose deflate output differs from the zlib CPython uses, which would change every poster payload.- The manifest’s embedded metadata strings are
json.dumpsat its defaults. A bundle stores its metadata compact and in raw UTF-8; themetadataJsona manifest carries for a poster is the same object written with a space after every separator and every non-ASCII character escaped, so the degree sign in the temperature unit reaches the manifest as°.pyjson::dumps_defaultdoes both. - Compression is one-shot on both sides. The Python encoder calls
compression.zstd.compress, which records the pledged source size in the frame header. The streaming encoder does not, and picks different window parameters (about 5 % larger payloads and different bytes), sozstd_compresshere callsZSTD_compress2one-shot as well.
The reference compresses through compression.zstd (Python 3.14, the
floor of xuebuild), so both encoders run one-shot libzstd. The byte
comparisons still skip when the two link different libzstd versions
(require_comparable_compression in tests/_support.py).
Native grids
A model on its own grid (docs/bundle.md, “Projected Sources”, “Gaussian rows”)
adds three pieces of arithmetic on top of what a regular grid does. The operation
order is normative: both encoders land on the same doubles. On the native side
rust/xue/src/projection.rs holds the projection and the Gaussian iteration,
encode/reproject.rs the published grid, the rotation and the crs array’s text,
and encode/grid.rs the window and the rows.
Reading the grid. round3 of the geotransform’s origin and steps, then half a
step in: x0 = round3(gt0) + dx / 2, y0 = round3(gt3) + dy / 2, dy < 0. A file
on a projection is only accepted for a source with grid_relative_winds, and that
source only accepts such a file. Its dimensions are y / x by the same flag
(discover.store_dimensions).
Winds. After the extraction (fill, unit conversion, crop) and before any
derivation and quantization, each vector bundle’s pair on a grid_relative_winds
source is turned, on the plane the published window describes. No libm call runs
per cell. ρ0 is the projection’s origin_radius, computed once:
The sign is the cone’s, as in the inverse projection; it changes nothing on a
northern cone. Decimation works on the codes of the turned planes, so a tier keeps
sample sites and rotation. A derived vector bundle on such a source is refused
(binconvert._grid_relative_vectors, convert::grid_relative_vectors), and so is
clear-air turbulence on any projected grid.
A box on a projected grid. crop_grid walks each edge of (west, south, east, north) in 64 points, ends included, with latitudes clamped to ±89.9:
longitude = west + (east − west) × i / 63.0, latitude = south + (north − south) × i / 63.0, each edge’s fixed side as given. A point goes through
LambertConformal.forward_wrapped, then column = (x − x0) / dx,
row = (y − y0) / dy. The window is floor(min + 1e-9) to ceil(max − 1e-9) on
each axis, clamped to the grid, the rule a regular crop has. Empty is an error, and
so is a box whose east is west of its west. The window’s x0 is
x0 + column_start × dx and its y0 likewise, unrounded. A tier doubles dx and
dy, keeps x0 and y0, and takes (n + 1) // 2 on each axis.
Gaussian rows. A source with gaussian_n writes the gaussian block on its
primary grid, not on a grid family of its own: firstRow = floor((90 − first latitude) × (2n + 0.5) / 180 − 0.25), the inverse of the iteration’s first guess,
rounded, rowStride 1. A file whose first latitude is more than a quarter of a row
from that row, whose rows run off the grid, or whose step is more than 1 % from
180 / 2n is refused. A crop adds its row_start to firstRow; a tier doubles
rowStride. The regular fields are computed as ever. The column roll moves columns
only. The store’s latitude coordinate is the iteration of docs/zarr-profile.md,
“Coordinates”, one row at a time.
Grid families
One source publishes its inputs on two grids: CFSv2 writes the surface
series on the model’s T126 Gaussian grid and the pressure-level and sea
level pressure series on a regular 1° one. GDAL cannot read a GRIB whose
messages disagree on the grid — it exposes the later bands at the first
message’s size, warns that the data access may be incomplete and returns a
different checksum than reading that record alone — so the second grid
cannot simply be appended to the frame. It is a grid family:
sources.CompanionFile with a production_grid and a tile of its own.
What both encoders do with one:
- Layout. A family’s records of a frame live in a sibling file of the
same name under a directory named by the family id —
cfs.2026091912/pgb/cfs.2026091912.f006.grib2besidecfs.2026091912/cfs.2026091912.f006.grib2(sources.family_frame_path, the one place the rule is written down). Listing a run directory lists files, not directories, so the frame list is unchanged; a build narrowed to one family’s bundles writes no primary file at all, and then the frames are listed from that family’s directory and named by the primary path they would have had. - Inspection and extraction. A family’s variables are inspected and extracted from its own file, and a frame’s answers are merged into the one frame dictionary the rest of the converter reads. A missing family file is an error, not a fall-back.
- Grid. Each family gets its own
GridInfo, read from its own file by the same rules (the global longitude snap, the regional step snap, the column roll). A complete build checks each family’s grid against that family’sproduction_grid, and--bboxcrops each family separately. - Bundles. A bundle is built on the family every one of its inputs is read from — the vapour flux at 850 hPa reads the specific humidity and the wind pair there, all from the same family — and a bundle whose inputs would span two grids is refused outright. Its grid, its tile, its resolution ladder, its poster and its metadata are that family’s.
- What stays the primary family’s. The build report’s run-level
grid, and therefore the STAC Item’s bbox and spatial dimensions, which are read off the core scalars’ poster metadata. The manifest has no run-level grid and the frontend opens one grid per session, so nothing in the delivery contract changes.
A companion family without a production_grid is unchanged in every
respect: GFS-Wave and the ECMWF wave stream are still appended to the
frame’s GRIB after the primary file’s records, on the source’s own grid.
Not covered
Fetching (xue fetch), the showcase driver and build-bin stay in Python.
Verified against
Every source, on real runs, with every artifact compared byte for byte:
| Source | What it exercises |
|---|---|
| GFS | the plain path, the two-variable wind bundles, the derived vapour flux and the derived 850 hPa equivalent potential temperature (exp / ln / pow on both sides), the surface diagnostics, and the ocean fields: the wave records’ bitmap fill and, on a whole frame, the WAVEWATCH III grid snapped to the exact 0.25° grid |
| ECMWF | de-accumulating tp, and the shorter prate axis that follows; the records that arrive under another identity than GFS’s (the interval-maximum gust on the 10 m surface and its own analysis-less axis, the cloud cover as a local parameter in a 0–1 fraction, the most-unstable CAPE on surface type 17, the skin temperature as 0/0/17, the ice thickness with a bitmap, the wave period and direction under neighbouring parameter numbers), each matched both by the GRIB2 header index and by GDAL’s band metadata; the ensemble products appended by the fetch (template 4.2 spreads as code-table-4.7 code 2 and the sea-level pressure’s as 0/3/0, template 4.9 probabilities on 0/1/52 with an unscaled limit), matched by the extra template-ensemble rules of the CMA ids and published under the registry’s identity; the probabilities’ twelve-hourly axis from +24 h (variable_step_hours, a time_<id> axis thinned from the run’s) (tests/test_ecmwf.py, on the Kara Sea fixture) |
ECMWF 0.1° (ifs) | the ECMWF row’s work on the model’s full 0.1° grid (3600 × 1801), with the IFS HRES tile (90 × 95) and two-rung ladder; the split sfc / pl objects are reassembled by the fetch stage, so the encoder reads one GRIB per frame as for ECMWF (tests/test_ifs.py, on a Kara Sea crop) |
| GFS-SFLUX | de-averaging prate_ave, the Gaussian grid and its gaussian block, the -180 column roll, dswrf |
| RRFS | the mass-density-to-micrograms rule, and HRRR’s projection on a frame from two file families (tests/test_rrfs.py) |
| WOOF-NAM | a second Lambert conformal grid, NCEP 218 (tangent at 25°N), and a precipitation total that restarts every twelve hours, differenced within its window into the rate (tests/test_woofnam.py) |
| HRRR | a projected source: the Lambert conformal grid read out of GDAL’s WKT and published as it is, schemaVersion 4, the y / x coordinates and the crs array, the winds turned to east and north (exact IEEE arithmetic per cell; tests/test_hrrr.py), and the MSLMA / REFC aliases |
| GEFS-AEROSOLS | GRIB2 product definition template 4.48: the aerosol type and the size and wavelength intervals parsed out of the template by the header index and out of GDAL’s GRIB_PDS_TEMPLATE_ASSEMBLED_VALUES by the band matcher, compared whole with the registered AerosolIdentity (a dozen AOTK records per frame share the parameter and surface), written as the metadata’s aerosol block; the log1p codebooks on fields other than precipitation, NCEP’s local PMTF / PMTC numbers in µg/m³ as GDAL reports them (tests/test_aerosol.py, on the Saharan fixture) |
| CFSv2 | a seasonal run on two grids: the T126 Gaussian surface grid, its column roll, its gaussian block and the true latitudes of its store coordinate, the 1° pressure-level grid family beside it (its own frame file, its own GridInfo, its own tile and ladder, and the vapour flux derived on it), NCEP’s local “entire atmosphere” surface (type 200) accepted under the pgrb2 total cloud cover’s identity, the 9999 ice-thickness fill, and an axis that begins at a step rather than at the analysis (first_hour 6, so every bundle carries firstFrameOffset: 6) with the three flux fields’ typeOfStatisticalProcessing written into metadata although the records are the instantaneous template (tests/test_cfs.py, on the East Asian fixture) |
| ICON-EU | a regional regular grid at a power-of-two step (0.0625°) that the regional snap leaves as it is, DWD’s encodings under the existing alternates (the run-total TOT_PREC as AIFS’s WMO 0/1/52 in kg/m², VMAX_10M as ECMWF’s interval-maximum gust on the 10 m surface, CLCT as AIFS’s 0/6/1 in percent on the ground surface, HSURF as the orography’s 0/3/6 geometric-height alternate in metres), de-accumulation from an analysis total, the gust’s analysis-less axis (tests/test_iconeu.py, on the Alpine fixture) |
| ARPEGE | the ICON-EU encodings on the 0.25° global grid, with the analysis precipitation total the fetch writes as a zero record (the package has none), so the first hour’s rate is that hour’s total (tests/test_arpege.py, on the western Mediterranean fixture) |
| GSM | the GFS identities on a 1.25° global grid with no ladder; the isobaric surfaces scaled by -2 in sign-and-magnitude, which the header index reads as GDAL does; 10 hPa, whose 1000-ISBL the isobaric rule tells from 1000 hPa by the assembled template; the relative vorticity under the per-second-to-1e-5 rule; the run-total precipitation as the WMO 0/1/8 accumulated from the analysis (the accumulation-from-start rule and tp’s 0/1/8 alternate), with the analysis record the fetch writes as a zero record in pure Python (tests/test_gsm.py, on the Japan fixture) |
| CMA-GEPS | a global grid without its pole rows (1440 × 720, first centre 89.875°N); ensemble products read as CMA writes them (templates 4.2, 4.6, 4.9, 4.10), matched by template-ensemble rules in the header index and the band matcher alike and written as the metadata’s ensemble block — the centre under the deterministic ids with the block the source names (ensembles), the quartiles, spreads and probabilities under ids of their own; the interval precipitation path on GRIB frames (the six-hour median apcp total divided by the step) and its pairs (interval_precipitation_pairs: the quartile totals into prateq25 / prateq75 the same way); bundles that start past the analysis at an hour of their own (variable_first_hours: the 24-hour probabilities from +24 h, on a time_<id> axis, left out with a warning by a build that ends before it) (tests/test_cmageps.py, on the Japan fixture’s five frames) |
| WOOF-WRF | the series-file forecast path on a source with no feed: one CF NetCDF per variable from the wrf-series tool, an axis from f001 (first_hour 1, so every bundle carries firstFrameOffset: 1) with the hour’s precipitation total on every frame (interval_precipitation, nothing analysis-optional), a regional 0.005° grid that one tile covers and no ladder (variant_factors empty), a sea level pressure series in pascals turned into hectopascals like a GRIB record, the wind80m pair read as two series, the cloud3d volume bundle (24 clw<m> levels from 250 m to 12 km MSL, cloud water mixing ratio 0/1/22 on surface 102 at the level in metres, g/kg on the linear 0.01 g/kg codebook, a level under the model terrain filled as 0 g/kg), and fetched() false — require_complete is refused and the source is built from a dataset directory by a showcase case alone (tests/test_woof.py, on the Fuji fixture) |
| EFAS-v5, EFAS-v5-WB | the series-file forecast path again, with no feed: one CF NetCDF per variable from the efas-series tool, an axis of six-hour means from f006 to f120 (first_hour 6, firstFrameOffset: 6) with dis06 declared a mean (typeOfStatisticalProcessing 0), the file’s declared _FillValue of -9999 and the registry’s fill_values both folded to the bottom of the range (zero discharge, zero area, return-period class 0 “not evaluated”), log1p codebooks on the discharge and the upstream area, a class codebook on disrp, the xue producer version read off the disrp and upstream series, the 1/60° European grid with no ladder, and fetched() false (tests/test_efas.py, on the Valencia fixtures) |
| ERA5 | the series-file forecast path with no feed, for a reanalysis: one CF NetCDF per variable from the era5-series tool, the window’s first hour as the run (any hour, cycle_hours 1), an hourly axis from f000 to at most f1440 with every frame an analysis, the temperatures already in degrees Celsius, gust declared a maximum over the hour (typeOfStatisticalProcessing 2), the 0.25° grid cropped to the case with no ladder, and fetched() false (tests/test_era5.py) |
| CAMS | the same path for an aerosol analysis: one CF NetCDF per variable from the cams-series tool, the window’s first hour as the run (any 3 h mark, cycle_hours 3), a three-hourly axis from f000 to at most f1440, PM2.5 already in µg/m³, the 0.4° grid cropped to the case with no ladder, and fetched() false (tests/test_cams.py) |
| GFS, cropped | --bbox with --bundles, and manifest.json |
| CMA-RADAR | the NetCDF observation path: unscaling, the fill value, a unitSeconds: 360 axis listing its offsets around archive gaps, --hours; since 0.17 a fetched window like JMA’s, read out of its archive with the window’s first hour as the run (tests/test_cma.py); the id is cma since then, radar being the local-file shape the wheels before 0.17 know |
| JMA-HRPNS | a fetched observation that arrives as a NetCDF series (series_file), the way the CMA file does, with a cadence: the five-minute times snapped to their slots and the window’s first hour taken as the run (unitSeconds: 300, firstFrameOffset: 1, offsets listed around a gap), a byte-packed rate unscaled through scale_factor 0.5 with the 255 fill folded to the codebook bottom, and a run directory holding exactly one series (tests/test_jma.py) |
| NOAA-MRMS | a fetched observation: one GRIB per two-minute frame, each its own reference time, re-keyed onto the window’s axis (unitSeconds: 120, the observation times snapped to the mark, the first hour as the run); the MRMS-local identities (discipline 209) under cref and prate through the registry’s alternates and rqi (209/8/0) under its own, a rate already in mm/h, the -999 / -99 / -3 / -1 sentinels folded to the codebook bottom (for rqi a tenth below an index of 0); a regional grid described on its round step; and the 2 x 2 block-maximum thinning onto 0.02° (tests/test_mrms.py) |
| NOAA-MRMS3D | the same bucket’s 3D mosaic: the 33 constant-altitude levels of MergedReflectivityQC (209/9/0 on surface type 102, 0.5–19 km) read from one GRIB per ten-minute frame, every level matched on its altitude rather than on the element the levels share (by the assembled template 4.0, or GDAL’s <metres>-GPML short name), published as the one refl3d volume bundle in level order (unitSeconds: 600), each level RAW with the composite’s codebook, and thinned 5 x 5 by block maximum onto 0.05° (tests/test_mrms3d.py) |
| SWPC-AURORA | a fetched observation that arrives as a NetCDF series (series_file) like JMA’s but grown from a frame cache, since the live feed carries only the newest grid: xuebuild/aurora.py parses the OVATION JSON, snaps its valid time to the five-minute mark and writes one small NetCDF per slot; the fetch assembles the window’s cached frames, the window’s first hour being the run (unitSeconds: 300); a linear 0–100 % codebook on a 1° global grid, and a window that is a sequence of successive forecasts, not one run’s lead times (tests/test_aurora.py) |
One condition the reference never met: GDAL’s netCDF driver is not
thread-safe, and reading one file from several threads fails with netCDF chunk fetch failed: NetCDF: HDF error. Every extraction was its own
gdal_translate process in Python. encode::gdalio::netcdf_guard
serializes those reads; GRIB stays parallel.
Part of the Xue specification, licensed under CC BY 4.0.
6 - The STAC catalog
The shell reads the JSON it always has: a run’s manifest.json (schema v5),
the per-model live pointer (schema v1), showcase.json. None of that
changes here. Beside them the encoder derives a static SpatioTemporal
Asset Catalog (STAC 1.1.0), so the Zarr stores can
be found the way that ecosystem finds data: pystac walks the catalog,
xpystac / odc-stac open an
Item’s application/vnd.zarr asset into xarray, and a STAC browser lists
the runs. This document is the contract: the layout, what each document
carries, and where it comes from.
The catalog is derived, not authoritative. Every document is a pure
function of a manifest, a point product’s index.json, a showcase.json
row and the source registry
(xuebuild/stac.py), with no timestamps and no host names, which lets a
run built whole and a run built in pieces write the same bytes
(tests/test_assemble.py) and lets any document be regenerated from what
is on disk. The manifest stays what the shell validates and opens; a field
the catalog has and the manifest lacks is a summary. Should the manifest
itself become a STAC Item (a possible schema v6), this layer is what it
would become.
Layout
At the data root (https://dataset.ringsaturn.me/xue/), beside the
pointers:
| Path | STAC object | Mutable | Written by |
|---|---|---|---|
catalog.json | the root Catalog: one child per source with a live feed, one per point product a pipeline publishes (all but nexrad), one for the showcase | yes (a pure function of the registry) | every publish, showcase catalog |
<source>/collection.json | one Collection per source (gfs, ecmwf, ifs, aifs, sflux, hrrr, mrms, jma, cma), the STAC face of the live pointer | yes | build-bin (whole run), assemble-run |
<source>/item.json | the live Item: the run’s Item relocated to a path that never changes | yes, replaced by every publish | same |
<source>.<run>/item.json | one Item per published run, beside its manifest | rewritten in place by a top-up, like the manifest | build-bin (whole run), assemble-run |
<product>/collection.json | one Collection per point product (sounding, airport, synop, tc, nexrad, fire, aq, alerts), the STAC face of its live pointer; nexrad has no scheduled pipeline (the shell reads the public bucket), so its Collection is written only by a hand build and the root catalog does not name it | yes | the product’s build, xue stac --product |
<product>/item.json | the live Item: the newest issue’s Item relocated to a path that never changes | yes, replaced by every issue | same |
<product>.<issue>/item.json | one Item per issue, beside its index.json | no | same |
showcase/collection.json | the Collection of the historical cases | yes | showcase build / refresh / catalog |
showcase/<case>/item.json | one Item per case, beside its manifest | rewritten by showcase refresh | same |
index.html | not a STAC object: the root’s landing page for a reader arriving in a browser, naming catalog.json and these documents, listing every Collection with its licence (xuebuild/stacindex.py, from the registry and the prose, so a pure function like the catalog); the live run and extent are read from each Collection in the browser | yes (with the catalog) | wherever the catalog is, uploaded with it |
Mutable documents are served no-cache, like the pointer; an Item is too,
since a STAC client fetches it by its plain name rather than under a ?v=
and a top-up rewrites it. Links are relative (../catalog.json,
../gfs/collection.json, bundles.zarr), so a client resolves them against
whichever origin it read the document from, and no document names a host.
There are no self links for the same reason.
The point products’ documents are the same three shapes over an
index.json instead of a manifest; §“Point products” below.
Only the newest run per source is kept on the bucket (prune-r2), an hour
for HRRR and minutes for an MRMS round, so a link into <source>.<run>/
stops resolving when the run is pruned, and a client that bookmarked one,
or held a Collection in its cache, would get a 404. The Collection
therefore lists one Item at a stable path: <source>/item.json, the run’s
Item with every relative href rewritten to reach into the run directory
(../gfs.2026091512/bundles.zarr) and nothing else changed
(relocate_item). Its item and latest-version links both name it; an
alternate link names the run’s own copy beside its manifest (a round of a
rolling window has none: below). A client
that wants the live run follows item; one that wants the pointer’s own
fields follows xue:pointer (../latest.json, ../latest-<source>.json).
The live Item’s assets still name objects that are deleted when the run is
superseded, so a client holds it no longer than the source’s cadence, the
way the shell polls the pointer.
The run Item
<source>.<run>/item.json, derived from manifest.json in the same
directory and nothing else. Id: the directory with / as .
(gfs.2026091512, mrms.2026091509.1455). Extensions declared:
forecast v0.2.0 (forecast
sources only), datacube v2.3.0,
file v2.1.0.
Time. The Item covers the run’s whole axis: start_datetime /
end_datetime are the union of every axis the manifest’s bundle metadata
carries (a rate that starts at the first step widens nothing; f240 is the
end), and datetime repeats the start so a client that sorts on it can.
The time dimension carries step when the axis is uniform and values
(the exact instants, the datacube extension’s spelling) when it is not —
GFS is hourly to F120 and 3-hourly after, which one step cannot state — so
a client reads the whole axis off the Item.
forecast:reference_datetime is the cycle (runTime), forecast:horizon
the longest lead as an ISO 8601 duration (PT240H), forecast:perturbed
false, since every published run is a deterministic control. An
observation (MRMS) declares no forecast fields; its xue:observation is
true.
Space. Every bundle entry carries the bundle’s own full grid as grid — the
same block a store’s attributes.xue.grid holds — so the Item reads an
exact grid and states it again, verbatim, as xue:grid, for a client that
wants the origin and steps without parsing cube:dimensions. A manifest
written before the field falls back to the bundle metadata a run’s core
scalars always carry: the retired H.264 companion’s on a run published with
one (the full grid), else a poster’s, which is the grid decimated two to one
(GridInfo.decimated: same origin, doubled step), whose steps are halved
back — the origin is then exact and a regional far edge is right to within
one full cell. A wrapping grid is [-180, -90, 180, 90]. bbox and
geometry follow (two polygons when a window crosses the antimeridian).
On a grid on a map projection the block has no origin and steps in degrees:
bbox is the extremes of longitude and latitude its boundary cell centers reach
(over a rectangle its trapezoid does not fill), cube:dimensions x and y are
the grid’s own axes in metres with its WKT2 as reference_system, and the Item
uses the projection extension:
proj:code null, proj:wkt2, proj:shape [height, width], and proj:bbox
and proj:transform over the cells’ outer edges.
The store’s own attributes.xue stays the decode-time authority; a manifest
with no metadata at all (only the synthetic ones in tests) gets a null
geometry and a time dimension alone.
Variables. cube:variables has one entry per array the run publishes: a
scalar bundle is one, a vector bundle its two components (ugrd10m /
vgrd10m under wind10m, marked xue:bundle), each with the registry’s
label and unit, and with the variable’s codebook as xue:quantization
(the same block a store’s attributes.xue.variables[].quantization
carries), so a client turns a stored code into a value without opening the
store. A bundle the registry does not know (a manifest admits any
well-formed name) is listed by name alone.
Assets. One per artifact, keyed by bundle:
| Key | What | type | roles |
|---|---|---|---|
manifest | manifest.json?v=<crc32>, the manifest under the ?v= a viewer fetches it with | application/json | metadata |
<bundle> | the Zarr store the bundle is in (the run’s shared bundles.zarr, <bundle>.zarr on a run published before shared stores), or the .xue container when the entry ships no store | application/vnd.zarr / application/octet-stream | data |
<bundle>-series | the series companion (<bundle>.series.zarr) when the run publishes one, marked xue:series: true (docs/zarr-profile.md, “Series store”) | application/vnd.zarr | data |
columns | the run’s column store (columns.zarr, docs/zarr-profile.md, “Column store”) when the manifest names one, marked xue:columns: true; its xue:kind is store, xue:tier full, and xue:crc32 its group document’s CRC-32 (which carries every shard’s CRC-32), and file:size the sum of the store’s objects. It is absent from the Item until the run’s columns job has attached it | application/vnd.zarr | data |
<bundle>-xue | the container, when it ships beside a store | application/octet-stream | data |
<bundle>-<tier>, -<tier>-xue | each reduced-resolution tier, likewise: -half on every source, -quarter too on the satellite disks and the 0.1° grids (SourceSpec.variant_factors), -eighth on a run published with it | data, overview | |
<bundle>-poster | the first-frame poster (.poster.bin) | application/octet-stream | overview |
<bundle>-video, -video-index | the retired H.264 companion and its index, on a run published with them (docs/format.md, “Retired artifacts readers still accept”) | video/H264, application/json | data, metadata |
A store and a container beside it are not alternates in the
alternate-assets
sense (different bytes, different checksums), so each is an asset of its
own. Every asset carries xue:kind (store, container, poster,
video, video-index, manifest), data assets xue:tier (full, or
the rung’s name half / quarter / eighth, read off the variant’s
file suffix; the manifest lists a bundle’s rungs in ascending factor
order), and reduced ones xue:grid (width, height). A shared store
(bundles[.<tier>].zarr, or a segment of one) is the href of every bundle’s
asset of its tier, one asset per bundle as before; each such asset carries
xue:bundle, the bundle id a reader selects in the group’s xue_bundles
(docs/zarr-profile.md, “Reading”). Sizes and checksums use the file
extension: file:size is the manifest’s byteLength (for a store, the
bundle’s share of its objects: its arrays and the coordinates it uses), and
file:checksum is
the manifest’s crc32 as a multihash: the multicodec table gives CRC-32
the code 0x0132, so the value is b20204 + the eight hex digits. A store
is many objects and its crc32 is that of its root zarr.json (the same
on every asset naming a shared store), so it gets no file:checksum; the
bare xue:crc32 on every asset is the artifact’s ?v=.
application/vnd.zarr is the media type pystac 1.14 registers for a Zarr
store (MediaType.VND_ZARR); the application/vnd+zarr spelling older
catalogs carry is the same thing.
The source Collection
<source>/collection.json. Id: the source id. title, description,
license (an SPDX id, CC-BY-4.0 for ECMWF, or other with a license
link, the NOAA open data policy) and providers come from a table in
xuebuild/stac.py; keywords name the kind (forecast / observation)
and the model. extent is the live run’s: its bbox, its
[start_datetime, end_datetime]. A forecast source’s summaries carry
forecast:reference_datetime. Links: root and parent to the catalog,
item and latest-version to the live Item beside it, alternate to the
run’s own Item, xue:pointer to the live pointer, license. A round of a
rolling window (build-bin --round: MRMS, JMA, the radars, the satellites)
writes no Item beside its manifest, so its Collection has no alternate:
a round lives minutes, nothing reads its own copy, and on a feed that
publishes every few minutes the object would be one more bucket write per
round. The live Item is still the round’s Item, relocated (its id
<source>.<run>.<HHMM>). xue:live
repeats the Item id and xue:pointer the pointer’s file name.
Point products
Eight products beside the runs have no run manifest: the radiosonde
soundings (docs/sounding.md), the airport reports (docs/airport.md),
the surface station observations (docs/synop.md), the tropical cyclone
tracks (docs/tc.md), the single-site radar (docs/nexrad.md), whose
data are polar Zarr stores but whose index is a window manifest, and the
active fire detections (docs/fire.md), the air-quality stations
(docs/aq.md) and the weather warnings (docs/alerts.md). Each
publishes a mutable latest-<product>.json naming an immutable
<product>.<issue>/index.json, and each gets the same three documents a
source does — a Collection, a live Item, an Item per issue — derived from
that index.json alone and from nothing else.
<product>/collection.json. Id: the product id. title, description,
license, keywords and providers come from the pointProducts entry in
xuebuild/stac_prose.json; none of them has an SPDX identifier to name, so
all are other with the terms linked: the WMO Unified Data Policy
(Resolution 1, Cg-Ext(2021)) for the soundings, with the Licence Ouverte
2.0 beside it for Météo-France’s, the NWS disclaimer for the
airport caches (a work of the US government is in the public domain, which
is not CC0), each network’s terms for the surface stations (JMA’s website
terms, the Public Data License v1.0, for AMeDAS), NOAA Open Data
Dissemination (attribution requested, no endorsement) for the radar,
NASA’s Earth science data use guidance (no restriction, the FIRMS
acknowledgement requested, which the description carries in full) for the
fires, and both of the first two plus CC BY 4.0 for the tracks, whose sources are
several agencies at once; the AirNow Data Exchange Guidelines and the
DATA.GOV.HK terms for the air-quality stations, and the NWS disclaimer,
JMA’s website terms, the Public Data License 1.0 (with a via link to
the agency’s GIS data page, whose credit and survey approval notice the
JMA provider’s description carries for the warning area boundaries) and
the Open Government Licence – Canada for the warnings. extent is the whole world and
[[null, null]]: every issue is a rolling window whose start moves, so a
Collection stating the live issue’s bounds would be wrong as soon as the
next one lands, and the description says so. Links: root and parent to
the catalog, item and latest-version to the live Item beside it,
alternate to the issue’s own copy, xue:pointer to the live pointer,
describedby to the product’s document, and the license links.
xue:live repeats the Item id and xue:pointer the pointer’s file name.
the issue directory’s item.json: sounding/2026/09/14/sounding.2026091402/,
tc/2026/09/13/tc.2026091301/, airport/2026/09/16/airport.202609161430/,
synop/2026/10/05/synop.202610050010/, aq/2026/10/31/aq.202610311545/,
alerts/2026/11/01/alerts.202611010005/, nexrad.202610050805/,
fire.202610120500/ (the NEXRAD and fire rounds stay flat; an issue published
before its product’s archive tree sits flat too). Id: the directory’s own name
(sounding.2026091402, aq.202610311545, alerts.202611010005,
airport.202609161430, synop.202610050010,
nexrad.202610050805, fire.202610120500, tc.2026091301).
Extensions: file v2.1.0 alone —
a point product is a set of stations, not a cube, and declares no
cube:dimensions and no forecast fields.
Space. geometry and bbox are the box around the stations the index
lists: the soundings’, the airports’ and the surface stations’ own
positions, the radars’ antennas in the window’s site table, a storm’s headline
position. It is the plain minimum and maximum over those points, so two
storms either side of the Pacific make a box the long way round rather
than one across the antimeridian. A fire index carries no positions —
the detections are wherever something burns — so a fire round with any
detection is the whole world, [-180, -90, 180, 90], and one without is
null. A warnings round is the union of its index rows’ boxes (each
warning’s polygon, or its area codes’ boxes from the boundary set,
docs/alerts.md §5); a round whose warnings have no box at all is the
whole world, and one with no warning null. The air-quality stations, like the surface
stations from synop schema v2, keep their positions in the per-network
stations files, which the Item is built from with the index. An index whose storms have nothing
observed has no positions at all, and then geometry is null with no
bbox, which STAC allows.
Time. datetime is the issue (issued), what a client sorts on, and the
period it covers is in the two bounds: for a sounding issue the oldest
nominal time any station still carries to the newest ascent in it, for an
airport, synop or aq round the 24 hours of history it holds (issued − 24 h
to the newest observation), for a warnings round the oldest sent of a
warning still in force to the round, for a nexrad round the first to the newest
sweep the window holds, for a fire round its window.start to the newest
acquisition any sensor carries, for a tc issue the earliest and latest headline
position. An empty index is the instant it was issued.
Properties. xue:product, xue:schemaVersion, xue:issued,
xue:stations (xue:storms for the tracks; the window’s sites for the
radar; xue:detections, the detections in the window, for the fires;
xue:alerts, the warnings in force, for the warnings) and
xue:sources, the
index’s own sources[] reduced to {id, ok} so a client sees which
gateway or centre was down without reading the index. A sounding issue
also carries xue:watermark, the product’s account per source of how
current it is.
Assets. One per file the issue publishes, each under the ?v=<crc32> a
reader fetches it with, with file:size and file:checksum (the crc32 as
a multihash, as a run’s artifacts carry):
| Key | What | type | roles |
|---|---|---|---|
index | index.json?v=<crc32>, under the CRC the pointer carries | application/json | metadata |
soundings / history | the product’s one NDJSON file | application/x-ndjson | data |
<network id> | a synop or aq round’s NDJSON file per network, with xue:network | application/x-ndjson | data |
<network id>.stations | a synop (schema v2) or aq round’s stations file per network, xue:kind stations, with xue:network and xue:stations | application/json | data |
<network id> | an alerts round’s NDJSON file per network, one warning per line, xue:kind alerts, with xue:network | application/x-ndjson | data |
<network id>.areas | the boundary set an alerts network’s area codes resolve against, outside the round (../alerts-areas/<set>.<version>.pmtiles), xue:kind areas | application/vnd.pmtiles | data |
<sensor id> | a fire round’s NDJSON file per sensor, one UTC hour per line, with xue:sensor | application/x-ndjson | data |
<storm id> | one JSON file per system a tc issue lists | application/json | data |
n0b / n0g | a nexrad round’s own polar store per product (n0b.zarr), xue:kind store; file:size is the root document and the shard, and the store carries xue:crc32 (its root document’s, the ?v=) rather than file:checksum, as a run’s stores do | application/vnd.zarr | data |
The NDJSON asset’s description states the addressing rule, which is the
point of the layout: one station per line, sorted by id, and a station’s
offset and length in the index are the byte span of its line’s object
(the newline excluded), so one station is one Range request and the
whole file still streams. A fire sensor file is one hour per line instead,
and one sensor’s hours are consecutive, so a span of hours is one Range
request. A nexrad round’s Item names only that round’s
stores: the older rounds of the window are their own Items, and the index
asset — the window manifest — spans them all. Assets carry xue:kind
(index, series, store, storm), and a storm’s also xue:level and
xue:basin.
The live Item at <product>/item.json is that Item relocated
(relocate_item), every href reaching into the issue directory, so
the URL a client bookmarks still resolves after the issue it named is
pruned — seven days for the soundings and the tracks, three hours for the
airport, synop and nexrad rounds, six hours for the fire rounds.
An issue whose build withheld the pointer (no source contributed, both
observation sources failed, no FIRMS file arrived) gets its own Item and nothing else: the
Collection and the live Item follow the pointer, as a source’s do.
The showcase
showcase/collection.json lists one item link per case in
showcase.json’s order (newest event first); its extent is the union of
theirs (first) followed by each case’s own, and its license is other
because the cases come from several sources; each Item states its own
under license. showcase/<case>/item.json derives from the case’s
showcase.json row and its manifest: id is the case id; bbox is the
row’s dataBbox (exact); datetime is the eventTime, what a search
should find the case by, with the period in start_datetime /
end_datetime; title and description are the English strings, and the
whole thirteen-locale maps sit under xue:title / xue:summary, with
xue:tags, xue:credit, xue:defaultVariable, xue:eventTime. A
forecast case declares the forecast fields like a run; an observation case
does not. Assets are the same per-bundle set as a run’s.
Producing it
xuebuild build-bin for a whole run and xuebuild assemble-run for one
built in pieces write the run’s Item, the live Item, the Collection and the
catalog right after the manifest and the pointer (the report’s stac names
the four files); a piece of a fanned-out publish (build-bin --bundles)
writes none, since an Item describes a whole run. showcase build,
refresh and catalog write the cases’ documents whenever they rewrite
showcase.json. make upload-r2 / upload-r2-manifest copy the run’s
Item with the manifest, make upload-r2-pointer copies the live Item, the
Collection and the catalog with the pointer (the Item first, so the
Collection never names a live Item that is not there yet), and make upload-r2-showcase the showcase’s, all through the same targets the
scheduled workflows call. A publish that predates this document has no
Item, and that is not an error.
A point product’s build (xue sounding-build, airport-build,
tc-build) writes the same four documents right after its index and
pointer, from the index on disk, and reports them the same way;
xue stac --product sounding|airport|tc --issue <YYYYMMDDHH|YYYYMMDDHHMM>
rewrites them for an issue already built. make upload-r2-sounding,
upload-r2-airport and upload-r2-tc copy the issue’s Item with its
index (no-cache, application/geo+json, held out of the immutable
sync), then the pointer, then the live Item, the Collection and the
catalog through upload-r2-stac-collection STAC_DIR=<product> — the same
target and the same order as a run’s.
Every document is validated on write against a structural contract
(validate_item / validate_collection / validate_catalog in
xuebuild/stac.py: the required fields, the link rels, a bbox in range,
the checksum matching the crc); the published JSON Schemas are not fetched
in the pipeline. tests/test_stac.py holds the shapes above and, when
pystac is installed, round-trips them through it.
Reading it
run.properties["cube:variables"] says what else the run carries and in
which unit; run.assets["manifest"].href is the manifest under its ?v=,
for a client that wants the shell’s own view of the same run.
Part of the Xue specification, licensed under CC BY 4.0.
7 - Sources
What each source publishes, and the one home of those facts: the README’s
table summarises it with live run badges, llms.txt lists the ids, and the
engineering notes (fetch stages, quirks) are in
contribution/sources.md. Every source is an independent dataset under
<model>.<run>/ on the data root, taken live by its pointer
(latest.json for GFS, latest-<model>.json for the rest). The id in each
heading is the --model value and, for a live source, the viewer path
(/<id>). Time axes with
mixed steps are listed outright in the bundle metadata
(bundle.md, schema v3).
The geostationary mosaic (/geo) is a view, not a dataset: the
viewer opens whichever imager runs answer, clips each disk at the
midpoints between sub-satellite longitudes and plays them on one timeline
by valid time.
Twenty-one levels of the isobaric families are registered (1000 / 975 / 950 / 925 / 900 / 850 / 800 / 750 / 700 / 650 / 600 / 550 / 500 / 450 / 400 / 350 / 300 / 250 / 200 / 150 / 100 hPa); which of them a source publishes is its own table, and publishing one more is a source-table change, not a format change.
Forecasts
NOAA GFS (gfs)
In the viewer: /gfs.
0.25° global, hourly to F120 and 3-hourly to F240, four cycles a day.
- 2 m temperature, precipitation rate, categorical precipitation type (derived from the rain / freezing-rain / ice-pellet / snow flags), 10 m and 100 m wind.
- Surface diagnostics: gust, total / low / middle / high cloud cover, CAPE and CIN, visibility, 2 m dew point, apparent temperature, precipitable water, boundary layer height, the model orography (one static frame).
- Vertical velocity at 850 / 700 / 500 hPa, 850 hPa equivalent potential temperature (derived).
- Ocean: skin temperature, sea ice cover and thickness, significant wave height and primary period (GFS-Wave), and a derived wave vector (height laid along the direction of travel); the same height, period and vector for the wind sea and for the first swell partition.
- Soil: temperature (
tsoil1–tsoil4) and total volumetric water (soilw1–soilw4) in the Noah land model’s four layers, 0–10, 10–40, 40–100 and 100–200 cm below ground; no soil (code 0) over open water, and for the water content over sea ice too (the temperature there is the ice’s; the water content is 1 over the ice sheets). - Mean sea level pressure; geopotential height, temperature, relative
humidity and wind on all twenty-one isobaric surfaces; 850 hPa water vapour
flux (
q·V/g, derived).
ECMWF IFS open data (ecmwf)
In the viewer: /ecmwf.
0.25° global, 3-hourly to F144 and 6-hourly to F240. The subset of the GFS
set that open data carries, under the same identities so a model switch
keeps the layer. tp is differenced into an interval-mean rate and the gust
is an interval maximum, so both series start at F003. The soil layers are
HTESSEL’s, under the GFS layer ids: tsoil1–tsoil4 and soilw1–soilw4
span 0–7, 7–28, 28–100 and 100–289 cm, not GFS’s depths; the open data
carries no bitmap, so the sea holds the model’s soil temperature and a water
content of 0. The isobaric fields are GFS’s on twelve surfaces: the open data
has no 975, 950, 900, 800, 750, 650, 550, 450 or 350 hPa record, so those
nine are GFS’s alone and a model switch on one of them leaves the layer. Not
available: layer cloud covers, visibility, sea ice cover, apparent
temperature.
ECMWF IFS open data 0.1° (ifs)
In the viewer: /ifs.
The same cycle’s records as ecmwf on the model’s full 0.1° regular grid
(3600 × 1801), the bundle set, pressure levels and waves included, on the
same axis, landing about two hours later. It is a separate source with its
own pointer.
ECMWF AIFS Single (aifs)
In the viewer: /aifs.
0.25° global, 6-hourly to F360 from every cycle, landing about 5.5 h after
it. ECMWF’s data-driven model from the same open data service, including
the layer clouds IFS open data lacks. Soil in the IFS’s top two layers only
(tsoil1, tsoil2, soilw1, soilw2: 0–7 and 7–28 cm), the water content
masked over the sea (code 0). No isobaric relative humidity, gust, CAPE, ice
thickness or wave period.
ECMWF IFS HRES via Open-Meteo (ifshres, aliases hres, ifs9km)
In the viewer: /ifshres.
0.1° global, hourly to F090, 3-hourly to F144, 6-hourly to F360, from the 00Z and 12Z cycles only (complete about 6.5 h after the cycle). ECMWF’s ~9 km operational forecast as Open-Meteo forwards it, resampled once from the reduced Gaussian O1280 grid (nearest neighbour) by om2nc. Fifteen surface bundles with the GFS ids and charts: 2 m temperature and dew point, precipitation, 10 m wind, shortwave radiation, sea level pressure, gust, four cloud covers, CAPE, visibility, skin temperature, sea ice thickness. No isobaric levels, no waves. Precipitation, radiation and gust have no analysis frame.
GFS surface flux (sflux)
In the viewer: /sflux.
~13 km Gaussian global (T1534, gaussian block n 768), the GFS axis. 2 m
temperature, precipitation (de-averaged from window means, from F001), 10 m wind
and instantaneous downward shortwave radiation.
NOAA HRRR (hrrr)
In the viewer: /hrrr.
3 km Lambert conformal over the contiguous US (the model’s own grid, 1799 × 1059),
hourly to F18, a cycle every hour; the 00 / 06 / 12 /
18 UTC cycles run to F48, which a local build may request but the published
runs do not. The core pair, sea level pressure, 850 / 700 / 500 hPa heights,
925 / 850 / 500 hPa temperature, 10 m / 80 m (wind80m, the hub-height
pair) / 925 / 850 / 250 hPa winds, the surface diagnostics and forecast
composite reflectivity (cref). Nothing is resampled; the winds are turned from
the model’s grid-relative components to east and north. Runs published earlier
are on a regular 0.03° grid (2441 × 1051), and the viewer clips those to the
model’s footprint.
NOAA RRFS (rrfs)
In the viewer: /rrfs.
3 km Lambert conformal over the contiguous US, HRRR’s grid to the last digit,
nothing resampled and the winds turned to east and north. Hourly to F84 from the
00 / 06 / 12 / 18 UTC cycles,
complete about 3.5 h after the cycle (the other hourly cycles stop at F18 and
are not published). HRRR’s grid and field set plus 250 hPa height, and the
smoke and dust the model carries inline (RRFS-SD): near-surface smoke, fine dust
(under 2.5 µm) and coarse dust (2.5–10 µm), 8 m above the ground in µg/m³
(smokesfc, dustfine, dustcoarse), and the column optical thickness
(aotk), whose record names no species or wavelength, so it is not aod. Its
sea level pressure is the model’s only one, NCEP’s Shuell reduction (MSLET),
published as prmsl. The viewer clips to the model’s footprint.
WOOF-NAM by Recast (woofnam)
In the viewer: /woofnam.
12.19 km Lambert conformal over North America, NCEP grid 218 (614 × 428),
nothing resampled and the winds turned to east and north. Hourly to F84 from
the 00 / 06 / 12 / 18 UTC cycles, complete about 4 h 20 min after the cycle.
A GPU port of the NAM (NMMB) that NOAA retired, run by Recast from the GFS
analysis of the same cycle, in NOAA’s NAM awphys layout; not an official
forecast of NOAA or the National Weather Service. 2 m temperature and dew
point, precipitation, sea level pressure, 850 / 700 / 500 / 250 hPa heights,
925 / 850 / 500 hPa temperature, 10 m / 80 m / 925 / 850 / 250 hPa winds,
gust, total cloud cover, CAPE, visibility, composite reflectivity, the
freezing level and the terrain. The files carry no precipitation rate: the
published one is the mean over each hour, differenced from the model’s
totals, which restart every 12 hours, and it starts at F001. No layer cloud.
Data: WOOF-NAM by Recast, CC BY 4.0.
NOAA GEFS-Aerosols (gefsaero)
In the viewer: /gefsaero.
0.25° global, 3-hourly to F120, complete about 6 h after the cycle. Aerosol
optical depth at 550 nm in total (aod) and for dust, sea salt, sulphate,
organic and black carbon (aoddust, aodsalt, aodsulf, aodorg,
aodbc), and surface PM2.5, PM10 and dust PM10 in µg/m³ (pm25, pm10,
pm10dust). The aerosol type and size / wavelength intervals are written
as the aerosol block of the bundle metadata.
CMA-CW/DUST sand and dust forecast (cmadust)
In the viewer: /cmadust.
0.15° over Asia (835 × 301 cells, 25°E–150.1°E, 15°N–60°N; the model’s
own grid, nothing resampled), hourly to F072 and 3-hourly to F168 from the
00Z and 12Z cycles, complete about 7.25 h after the cycle. The China
Meteorological Administration’s CMA-CW v1.0/DUST forecast for the WMO
SDS-WAS Asian Center, read from the WMO WIS2 global caches. Two bundles:
the surface dust concentration (dustsfc, µg/m³ to 50,000, every particle
size the model carries — not pm10dust, GEFS-Aerosols’ dust under 10 µm;
WMO 0/20/0 on the ground with a dust aerosol block of no size interval)
and the dust optical depth at 550 nm (aoddust, GEFS-Aerosols’ identity
and codebook to 5; a storm core’s optical depth often exceeds 5 and takes
the overflow code, drawn at the top colour, null at a point). Negative
model concentrations are coded 0. Data: China
Meteorological Administration, WMO core data under the WMO Unified Data
Policy (free and unrestricted).
FMI SILAM global air quality (silam)
In the viewer: /silam.
0.2° global (1800 × 897 cells, 180°W–179.8°E, 89.6°S–89.6°N; the model’s
own grid, nothing resampled), hourly from F001 to F072 and 3-hourly to
F120 from the 00Z cycle, complete about five hours after the cycle. The
Finnish Meteorological Institute’s SILAM v6.1 atmospheric composition and
air-quality forecast, read from FMI’s open data on AWS. Two bundles on the
GEFS-Aerosols identities and codebooks: the surface PM2.5 (pm25, the
core) and PM10 (pm10) concentrations in µg/m³, each the total of every
aerosol the model carries (dust, sea salt, sulphate, nitrate, carbon,
fire smoke, secondary organics). Every value is the mean over the hour
ending at its time, a 3-hourly frame included; the bucket carries no
analysis, so the run starts at F001. Data: Finnish Meteorological
Institute, SILAM, CC BY 4.0.
NCEP CFSv2 (cfs)
In the viewer: /cfs.
Seasonal: ensemble member 01 of the 00Z and 12Z cycles, 6-hourly from F6 to
F6552 (39 weeks, 1092 frames), landing about 11:30Z and 23:25Z. Surface
fields on the T126 Gaussian grid (0.9375°, gaussian block n 95): the core pair, total cloud
cover, shortwave radiation, surface temperature, two sea ice fields and
10 m wind. Upper air on a regular 1° grid: sea level pressure, height,
temperature, 500 hPa vertical velocity, wind at seven levels and water
vapour flux at four. Precipitation, radiation and cloud cover are six-hour
means ending at the frame (typeOfStatisticalProcessing 0 in the
metadata).
DWD ICON-EU (iconeu)
In the viewer: /iconeu.
0.0625° regular grid over Europe (23.5°W–62.5°E, 29.5°N–70.5°N), hourly to F78 and 3-hourly to F120 from the 00 / 06 / 12 / 18 UTC cycles, landing about 3.5 h after the cycle. A basic set: the core pair, sea level pressure, gust (the maximum over the step ending at the frame, from F001), total cloud cover, 10 m wind and the model terrain. Precipitation is de-accumulated from the run total, from F001. Data: Deutscher Wetterdienst, CC BY 4.0 (“Source: Deutscher Wetterdienst”).
Météo-France ARPEGE (arpege)
In the viewer: /arpege.
0.25° global, hourly to F48 and 3-hourly to F102 from the 00 / 06 / 12 /
18 UTC cycles, from the surface packages of the data.gouv.fr ARPEGE 0.25°
dataset; the 00/12 UTC cycles land about 3–4 h after the cycle, the 06/18
UTC ones about 5 h. The same basic set as iconeu; the gust is the
maximum over the hour ending at the frame. Data: Météo-France, Licence
Ouverte / Etalab 2.0.
JMA GSM (gsm)
In the viewer: /gsm.
1.25° global (288 × 145 cells, pole to pole), 6-hourly to F132 and
12-hourly to F264 from the 00 / 12 UTC cycles: the Japan Meteorological
Agency’s Global Spectral Model at the resolution JMA exchanges through WMO,
from the open data directory of GISC Tokyo. A run is complete about 6.5 h
after the cycle, when the second object (F144 to F264) lands. Published:
tmp2m, prate, prmsl, the 2 m relative humidity rh2m, the vector
pair wind10m, and on seventeen isobaric surfaces (1000, 925, 850, 700,
600, 500, 400, 300, 250, 200, 150, 100, 70, 50, 30, 20 and 10 hPa) the
geopotential height (hgt<level>), temperature (tmp<level>) and wind
(wind<level>), with the relative humidity (rh<level>) and the vertical
velocity (vvel<level>) on the eight from 1000 to 300 hPa and the
relative vorticity (relv<level>, in 10⁻⁵ s⁻¹) on 925, 700, 500 and
250 hPa. prate is de-accumulated from the run total, the mean rate over
the six or twelve hours ending at the frame, and has no analysis frame.
The objects also carry the divergence, stream function and velocity
potential, none of them published. JMA’s
higher-resolution GSM products are not open and are not used. Data: Japan
Meteorological Agency, via GISC Tokyo, essential data under the WMO data
policy.
CMA GRAPES GEPS ensemble products (cmageps)
In the viewer: /cmageps.
0.25° global without the pole rows (1440 × 720 cells, centres 89.875°N to
89.875°S), 6-hourly to F360 from the 00 / 12 UTC cycles. Not a member
and not a deterministic run: statistics of the ensemble (CMA GRAPES GEPS
v1.3, 30 perturbed members and the control), which is all CMA exchanges.
Every field carries an ensemble block saying which statistic it is
(docs/bundle.md, “Ensemble”).
- The centre, under the ids and identities the deterministic sources
use, so it compares with them directly: the ensemble mean of the 500 hPa
geopotential height (
hgt500) and the mean sea level pressure (prmsl), the only centre CMA publishes of those two, and the ensemble median (50th percentile) of 2 m and 850 hPa temperature (tmp2m,tmp850), precipitation rate (prate: the median of the total over the six hours ending at the frame, divided by six; from F006), 10 m gust (gust, the instantaneous gust, published under GFS’s gust identity; from F006), total cloud cover (tcdc, from F006, since the analysis file’s is a field of zeros) and CAPE (cape). A median is smoother than any member, and a precipitation median is drier than the mean wherever only some members rain. - The quartiles of each median field, in its unit and on its codebook:
tmp2mq25/tmp2mq75,tmp850q25/tmp850q75,prateq25/prateq75(the 25th and 75th percentile six-hour totals divided by six),gustq25/gustq75,tcdcq25/tcdcq75,capeq25/capeq75. Half the members lie between them. - The spread of the two mean fields:
prmslsd(hPa, 0.1 hPa steps to 25 hPa) andhgt500sd(m, 1 m steps to 250 m). - The probabilities of more than 1, 5, 10, 25, 50 and 100 mm of
precipitation in the 24 hours ending at the frame (
apcp24gt1…apcp24gt100): the percentage of members past the threshold, at 0.5 % steps, from F024.
No wind components (CMA exchanges only speeds). Nothing else of the model is exchanged: no member fields, no deterministic CMA-GFS run, no isobaric level beyond the 850 hPa temperature and wind speed, the 500 hPa height and the 250 hPa wind speed, and no humidity. The National Meteorological Centre’s website draws more of the same ensemble over China (stamp maps of the 31 members, spaghetti plots, the extreme forecast index), but as images whose reuse needs CMA’s permission, so they are not a source. A run is complete on the caches about 18–20 UTC the same day for both cycles. Data: China Meteorological Administration (CMA), via WMO WIS2, core data under the WMO Unified Data Policy, free and unrestricted.
Observations (rolling windows)
A rolling window is rebuilt every few minutes; each build is a round under
<model>.<run>/<HHMM>/.
NOAA MRMS radar (mrms)
In the viewer: /mrms.
0.02° contiguous US, every 2 min, a 4 h window. Composite reflectivity
(cref), radar precipitation rate (prate) and the radar quality index
(rqi), thinned two to one by block maximum. rqi is MRMS’s estimate,
0 to 1 in tenths, of how far the reflectivity near the ground can be
trusted (falling with range from the radars, under beam blockage and in the
melting layer); its code 0 marks cells outside radar coverage, which
cref code 0 does not tell from “no echo”. The block maximum keeps the
best cell of each block.
JMA precipitation nowcast (jma)
In the viewer: /jma.
0.005° over Japan (121–149°E, 20.5–45.5°N), every 5 min, a 3 h window. The
agency’s high-resolution precipitation nowcast (高解像度降水ナウキャスト)
publishes intensity classes, not reflectivity, so it ships prate alone at
each class’s representative rate (0.5, 3, 7.5, 15, 25, 40, 65, 100 mm/h).
Fetched through jma-radar.
HKO rainfall nowcast (hkonowcast)
In the viewer: /hkonowcast.
0.019° × 0.018° over Hong Kong and the Pearl River Delta (112.955–115.292°E,
21.33–23.49°N, 124 × 121), one issue every twelve minutes or so. The Hong
Kong Observatory’s gridded rainfall nowcast: four half-hourly accumulations
ending 30, 60, 90 and 120 minutes after the issue, published as prate,
the mean rate over each half hour (typeOfStatisticalProcessing 0). A
window is the newest issue alone, under the hour its first frame falls in,
and every frame of it lies ahead of the clock; there is no archive, so a
missed issue is not published. The Observatory’s points are evenly spaced
in Mercator, not in latitude, and are sampled onto the regular grid by
nearest point. No reduced tier. Attribution: Hong Kong Observatory
(DATA.GOV.HK).
CWA radar composite (cwa)
In the viewer: /cwa.
0.0125° over Taiwan and its seas (921 × 881 cells, centres
115.0081–126.5081°E, 17.9982–28.9982°N), every 10 min, a 3 h window. The
Central Weather Administration’s (中央氣象署) composite reflectivity of
its seven radars, dataset
O-A0059-001,
read from the agency’s anonymous open-data bucket and published as cref
(dBZ). The bucket keeps about two weeks of mosaics, so a window is whole
from its first round, and a slot the agency never wrote is absent from the
time axis.
The agency publishes the grid on TWD67, from 115.0°E 18.0°N; it is moved
onto WGS84 by one offset, 0.0081° east and 0.0018° south (the mean over
the agency’s station tables, which give both datums), not resampled, so
every value keeps its cell. Points with no echo and points outside radar
coverage are both missing, the codebook bottom. One reduced tier, at half resolution. Licence:
Taiwan’s Open Government Data License, version 1.0;
attribution: Central Weather Administration.
Geostationary imagers (himawari, himawarijp, goeseast, goeswest, meteosat)
In the viewer: /himawari, /himawarijp, /goeseast, /goeswest, /meteosat.
| Source | Spacecraft | Disk | Cadence and window |
|---|---|---|---|
himawari | Himawari-9 at 140.7°E (NOAA noaa-himawari9) | 80.7–200.7°E | 10 min, 6 h |
himawarijp | Himawari-9, the same files, the tiles over Japan only | 122–148°E, 24–46°N at 0.01° | 10 min, 3 h |
goeseast | GOES-19 at 75.2°W (noaa-goes19) | 135.2°W–15.2°W | 10 min, 6 h |
goeswest | GOES-18 at 137°W (noaa-goes18) | 163–283°E | 10 min, 6 h |
meteosat | Meteosat-12 at 0° (EUMETSAT Data Store) | 60°W–60°E | hourly, 24 h |
The disks are on a 0.04° plate carrée grid, 60°S–60°N; himawarijp is
Himawari-9 over a box around Japan at 0.01° (about 1.1 km, where the
visible bands’ 0.5–1 km sampling shows), built from the six of the disk’s
88 tiles that reach the box. All have half and quarter reduced tiers. Each publishes:
ir104: 10.4 µm brightness temperature (180–332 K at 0.6 K; shown in °C).ir039: 3.9 µm brightness temperature (180–407.7 K at 0.9 K), the warmest 2 km pixel under each cell and, in the reduced tiers, the warmest code around each site, so a fire’s hot spot survives the grid. Seesatellite.md.dustrgb: the Dust RGB composite (red 12.3 − 10.4 µm, green 11.2 − 8.6 µm, blue 10.4 µm), computed per scan by shachen; dust reads pink to magenta, day and night. Code 0 means no data in every gun. FCI has no 11.2 µm channel, so Meteosat’s green gun is 10.5 − 8.7 µm.dustcf(not Meteosat orhimawarijp): the DEBRA dust confidence (Miller et al. 2017), 0–1, over water and inside staged emissivity regions (the Gobi through Japan, the US Southwest, the Saharan corridor). Seesatellite.md.zhouye(not Meteosat orhimawarijp): the ZHOUYE dust confidence, shachen’s day-and-night scheme on the same chain: DEBRA’s by day, and after dark a reading at the day’s level instead of a fading one. Same grid, coverage and scale asdustcf; a second product, not a replacement.truecolor: one picture day and night. By day the visible picture — the 0.64, 0.51 and 0.47 µm reflectances (0.444 µm on Meteosat) as red, green and blue, each divided by the cosine of the solar zenith, the molecular sky’s scattering taken out (an analytic Rayleigh correction, faded out towards the terminator and the limb) and put through one brightness curve, the green a hybrid with the 0.86 µm band (synthesized from blue, red and 0.86 µm on the ABI, which has no green band). After dark white cloud over a dark ground: the 10.4 µm window from 280 K (clear) to 220 K (white) and, for fog and low cloud, the 10.4 − 3.9 µm difference as a softer grey. The two blend across solar zenith 80–90°. Code 0 is no data in every gun (outside the disk, or an input missing). Xue’s own recipe (producerxue, version the recipe’s). Seesatellite.md.
The live windows end 15–20 min behind real time. Meteosat publishes only
the cycle on each hour: EUMETSAT releases that cycle under CC BY 4.0 and
the cycles between under terms that do not allow this use. Building it
needs EUMETSAT_CONSUMER_KEY / EUMETSAT_CONSUMER_SECRET (free at
https://api.eumetsat.int/api-key).
NOAA SWPC aurora (aurora)
In the viewer: /aurora.
1° global (360 × 181), every 5 min, a 12 h window. The OVATION model’s probability (percent) that aurora is visible overhead. A frame’s valid time is the model’s forecast time, about an hour after the solar-wind observation driving it, so the window is a sequence of successive forecasts. The feed carries only its newest grid, so the window grows from a frame cache.
Cases only
These have no live pointer and no place in the model switch; a showcase
case (showcase/README.md) opens them.
Recast WOOF-WRF (woof)
Case: /showcase/fuji-woof-2026-10-10.
A WRF-ARW nest at 500 m over Mount Fuji: a regular 0.005° grid of 79 × 61
cells, 138.54°E–138.93°E and 35.22°N–35.52°N, every cell inside the model
domain, hourly from F1 with no analysis frame. volume=cloud3d draws its
cloud water in 3D.
Copernicus EFAS river discharge (efas, efaswb)
Cases: /showcase/valencia-2024-efas and /showcase/valencia-2024-efaswb.
EFAS v5 (LISFLOOD) discharge on its 1-arcmin regular grid over Europe
(4530 × 2970 cells, 25.25°W–50.25°E and 22.75°N–72.25°N; a case ships a
crop), six-hourly from +6 to +120 h. efas is the forecast forced by the
ECMWF HRES; efaswb is the water-balance run forced by observations, the
analysis the forecast starts from, on the same grid and axis. A case opens
them on the return-period class.
ECMWF ERA5 (era5)
Cases: /showcase/sumatra-haze-2026-era5 and /showcase/arxan-fire-2026.
The reanalysis (reanalysis-single-levels), hourly on the 0.25° grid over a
window of up to 1440 hours from any hour; every frame is an analysis. A case
ships a crop of the 2 m temperature and dew point, the 10 m wind and the
hourly gust maximum.
Copernicus CAMS aerosol analyses (cams)
Case: /showcase/sumatra-haze-2026-cams.
The global composition analyses (global-composition-analysis) on the 0.4°
grid, three-hourly over a window of up to 1440 hours; each frame is a 00Z or
12Z cycle’s analysis or its +3/+6/+9 h step. Total and organic optical depth
(aod, aodorg) and surface PM2.5 (pm25).
NOAA MRMS 3D reflectivity (mrms3d)
Case: /showcase/rolling-fork-2023-3d.
The MRMS mosaic’s 33 constant-altitude levels, 0.5 to 19 km above mean sea
level (every 0.25 km to 3 km, 0.5 km to 9 km, 1 km above), one frame every
ten minutes from the scan at each mark, thinned by block maximum to 0.05°,
all in one refl3d bundle (refl500 … refl19000, dBZ, GRIB2 209/9/0 on
surface 102 at the altitude in metres). The viewer draws it as a raymarched
volume (?vexag= sets the vertical exaggeration). The live window is
paused: its scheduled publish is disabled, and the volume is published
through showcase cases.
Point products
Not runs, but published beside them and drawn as marks in the viewer:
tropical cyclone tracks (tc.md, hourly), airport METAR / TAF
(airport.md, every ten minutes) and radiosonde soundings
(sounding.md, hourly).
Archive depth
A showcase case can only be cut where the upstream archive reaches: GFS and
sflux to about 2021-01, ECMWF open data to about 2024-02, Himawari-9’s
ISatSS tiles to 2022-12. See showcase/README.md.
Part of the Xue specification, licensed under CC BY 4.0.
8 - Run metrics
In the viewer: /metrics draws this file.
metrics/latency.json at the data root records when each forecast run
went live, for the last 30 days, measured rather than promised. It is the
data behind the metrics page; Xue makes no availability commitment.
It is built by xuebuild metrics-latency (.github/workflows/metrics.yml,
every six hours) from the GitHub Actions records of the forecast publish
workflows. Nothing in a manifest or a pointer carries a publication time,
and nothing there changes for this file.
What is measured
Every forecast source publishes through publish.yml. Its finalize job
is named finalize <model> <run>, and its step Upload the manifest and
take the run live writes the live pointer.
- Landed: that step succeeded and the publish was not a dry run (a dry
run skips Verify the live pointer).
landedAtis the step’s completion time, the moment the pointer was written. - Latency:
landedAtminus the run’s cycle time, in minutes. It includes the upstream model’s own production time: a run cannot be published before its last input file exists. A source that ships a column store lands when the store is ready, later by the cut (at most 30 minutes; a run goes live without the store past that). - A cycle written live more than once (a top-up, a forced rebuild) arrives at its first write.
- Cadence: the commonest gap, in hours, between consecutive cycles that arrived in the window. It is measured, not declared, so a source that publishes two of its upstream’s four daily cycles is not counted as missing the other two.
- Missing: cycles on that cadence, strictly between the window’s first and last arrival, that never arrived.
- Deadlines: for each whole local day in the window, the newest cycle
live at a fixed local clock time, and its age then in hours. The one
deadline listed is the ERCOT day-ahead market close, 10:00 US Central
(
America/Chicago, so 15:00 UTC in summer and 16:00 UTC in winter).
Workflow runs whose finalize job is named without the run (before the
naming existed) take the run from their publish-report-<model> artifact
while it is retained, otherwise run is null and the arrival is not
counted.
The file
One JSON object, schemaVersion 1, served no-cache:
| Field | Meaning |
|---|---|
schemaVersion | 1 |
generatedAt | When the file was built, ISO 8601 UTC |
windowDays | Days the summaries cover (30) |
repository | The repository whose workflow runs were read |
sources | One object per forecast source id, below |
Per source:
| Field | Meaning |
|---|---|
workflow | The caller of publish.yml, e.g. publish-gfs.yml |
cadenceHours | Integer, or null with fewer than two arrivals |
landed | Arrivals in the window |
missing | The missing cycles, YYYYMMDDHH, oldest first |
outcomes | Workflow runs started in the window, counted by outcome |
latencyMinutes | {median, p90, max} over the window’s arrivals, or null |
latest | The newest arrival, as in arrivals, or null |
deadlines | [{id, label, timeZone, localTime, days: [{date, cutoff, run, ageHours}]}]; run is null (and ageHours absent) when nothing had arrived by cutoff |
arrivals | [{run, landedAt, latencyMinutes}], oldest first |
backlog | Workflow runs not yet read because the build’s API budget ran out; the next build reads them |
workflowRuns | Every workflow run read, [{id, event, conclusion, startedAt, outcome, run, landedAt}], oldest first; outcome is landed, skipped (the bucket already served the newest cycle), dry-run or failed |
workflowRuns keeps one day beyond the window, so the first day’s deadline
sees the run live before it. It is also the next build’s state: a build
fetches job records only for workflow runs it does not list.
Observation windows (radar, satellite) and point products are not covered yet.
Part of the Xue specification, licensed under CC BY 4.0.
9 - The tropical cyclone product
In the viewer: the storm map /typhoon, one page per archived storm under /tc/, and the live tracks drawn over any layer by default (?tc=<storm id> focuses one).
The .xue container is a raster container. A storm track (a few dozen
points from each centre, a few thousand from an ensemble) is not a raster,
so tropical cyclones are a second, smaller product published beside the
runs: plain JSON, a few hundred kilobytes an hour, aggregated by xue tc-build (xuebuild/tc/) from the agencies’ and the models’ own track
files, and taken live by the same pointer → immutable directory contract
the runs use. This document is the normative description of that product,
schema v1. The design it implements (the sources, the three notions of an
impact area, the phases) is in the project’s private notes; what is here is
the contract a reader can hold the publisher to.
1. Delivery
Everything is a static file under the data root, the same root as the run
pointers (latest.json, latest-<model>.json) and showcase.json.
latest-tc.jsonis the one mutable object. Fetch it with caching disabled. It names the newest issue directory and the index inside it:pathis relative to the pointer and alwaystc/<YYYY>/<MM>/<DD>/tc.<issued hour>/index.json, the date being the issued hour’s. A pointer written before that layout names the flattc.<issued hour>/index.json, and a reader accepts both.byteLengthandcrc32(zlib CRC32 of the file’s bytes, eight lowercase hex digits) are the index’s, so it can be requested as<path>?v=<crc32>through an immutable cache.tc/<YYYY>/<MM>/<DD>/tc.<YYYYMMDDHH>/is one immutable directory per issue, filed under its UTC day so the archive can be kept for years without any listing level growing past a few dozen prefixes. The hour is the UTC hour the product was aggregated at, not any centre’s issue time. It holdsindex.jsonand one<storm id>.jsonper system, and beside themitem.json, the issue’s STAC Item — a pure function of the index, read by a catalog client and by nothing in the product (docs/stac.md§“Point products”). Once the pointer names it nothing in it changes; a manual rebuild of an hour (tc-build --issue … --force) writes the directory again, and every file is addressed by its CRC, so a cache never serves one hour’s bytes under another’s key. Directories are pruned after a year (make prune-r2-tc).Paths inside
index.jsonare file names beside it; request each as<name>?v=<crc32>with the CRC the index carries.
The publisher builds every hour at twenty past (publish-tc.yml). A source
that is late or unreachable is recorded (see sources) and the hour
publishes without it. The pointer is withheld only when no agency and no
model contributed at all, in which case the previous hour stays live. An
hour the pointer already names is finished: a run that resolves to it (a
dispatch landed in the same hour, or the schedule ran late) builds nothing,
and the workflow’s force input is the manual rebuild.
Deployment is one-sided: the product is new files under a new pointer, so a
shell that does not know it never asks for it. A schemaVersion bump
follows the runs’ rule (ship the shell first); an added optional field does
not bump the version.
2. Units and conventions
SI throughout, converted at the parser:
| quantity | unit | note |
|---|---|---|
wind (vmax, gust) | m/s | on whatever averaging the source uses: one-minute for NHC and JTWC, ten-minute for JMA, the Hong Kong Observatory and the other RSMCs, the model’s own for a model |
pressure (pmin) | hPa | |
radii (radii, rmw, cone, alert halfWidth) | km | |
| position | degrees, longitude in (−180, 180] | a track crossing the antimeridian is split by the reader, not the file |
| time | ISO 8601, UTC, Z suffix | |
lead | seconds | from the forecast’s base |
Wind radii are keyed by the threshold in knots the centres name them by
("34", "50", "64") as four quadrant values [ne, se, sw, nw] in km. A
quadrant not reported is null; a quadrant reported as zero means no such
wind there. A threshold a source never reports is absent from the object; a
point with no radii at all has radii: null. ECMWF reports at 18 / 26 /
33 m/s, the same three thresholds to within a knot, and is keyed the same
way.
class is the source’s own intensity string, verbatim (TS, HU, TY,
JMA’s grade digit, CMA’s category…). A reader colours it by the source’s
own scale (registry.py names the scale per agency) and never converts
between scales. The Hong Kong Observatory spells its categories out; its
six tropical cyclone categories are written as the abbreviations IBTrACS
carries for it (TD, TS, STS, T, ST, SuperT), so every hko
track speaks one vocabulary, and Low Pressure Area and Extratropical Low, which have none, stay verbatim.
Numbers are JSON numbers; a value not reported is null. The files are
written compactly with ASCII escaping, and a file’s identity is its bytes:
the CRC32 in the index is of the file exactly as served.
3. Identity
A system has one id for its whole life in the product:
- A-level, numbered: the ATCF id, basin, two-digit number, season
(
EP142026). JTWC, NHC, the NCEP tracker, ECMWF (14E⇔EP14) and IBTrACS (USA_ATCF_ID) all carry it; nothing is inferred. The season is the calendar year, except in the southern hemisphere, whose season runs July to June and is named after the year it ends in (SH022027in October 2026). The NCEP tracker’s sub-basin codes are read as the basin JTWC numbers in:AAandBBasIO,SIandSPasSH. ECMWF’s storm numbers are JTWC’s and NHC’s except in the western Pacific and the southern hemisphere, where they are its own (its36Wwas JTWC’sWP29, its06SJTWC’sSH12): an ECMWF system in those basins is therefore placed by position, as a C-level one is, and never names a storm. - B-level, an unnumbered disturbance a centre tracks (an invest, a tropical
depression under a formation alert): a synthetic id
x-<basin>-<first seen YYYYMMDDHH>-<n>(basin lowercase,nfrom 1). The invest number (EP97) is an alias with a validity window, because the numbers are reused within a season; the same alias seen again within 48 hours is the same system. - C-level, a potential system only a model has found: the same synthetic
shape, named after the run that first found it. ECMWF numbers such
systems afresh every run (
70W,71W…), so those names never carry across; a model’s system is attached to a known system when it lies within 333 km (three degrees of arc) of that system’s position nearest in time, and otherwise stands alone, matched the same way to the previous hour’s C-level systems so its id holds while the model keeps finding it. - A centre’s own number that is not an ATCF id (the Hong Kong
Observatory’s four-digit
TCID,2206) is placed by position the same way and kept as the aliashko:<TCID>. Unlike a model’s it names one system for its whole life, so a sighting near no current system finds the previous hour’s system carrying that alias (within 48 hours), and a system only a centre tracks is B-level, not C.
When an invest is numbered, its B-level system merges into the A-level
storm: the previous hour’s B or C system that no source names any more,
whose last position lies within 333 km and 48 hours of a current A-level
storm, becomes an alias of it, and index.json’s crosswalk maps the old
id to the new for as long as the new one is published. A reader holding an
old id follows the crosswalk before giving up.
Only positions are compared, never intensities. Binary cyclones within 333 km at the same hour would be merged; the ATCF key takes precedence wherever any source supplies it, which keeps that rare.
4. index.json
The shape — every field, its type and range — is
schemas/tc-index.schema.json; the
pointer’s is schemas/pointer.schema.json.
This section says what the fields mean and the rules across them.
issuedis the aggregation hour,generatedwhen the build ran.storms[]is sorted by level, basin, id.levelisA,BorC(§3);basinan ATCF basin (AL,EP,CP,WP,IO,SH);namethe name the newest source gives, ornull.position,vmax,pmin,class,classAgencyare the headline: the last point of a best track when there is one, else the first point of an agency forecast, else of a model’s;classAgencysays whose.positionmay benullfor a system with nothing observed.agencies,models,bestlist the keys present in the storm file, so a reader can decide what to fetch before fetching.sources[]is the same list every storm file carries (§6).
5. <storm id>.json
The shape is schemas/tc-storm.schema.json.
Forecast. base is the time the leads count from: a model’s cycle, or a
centre’s synoptic time (NHC’s 03Z advisory forecasts from the 00Z position,
its first point at lead 3 h). issued is when it was released, equal to
base where a source does not say. A point’s valid time is base + lead,
also written as time; leads are strictly increasing. A reader aligns
tracks with the raster’s playhead by valid time, never by base or
issued. run (YYYYMMDDHH) is present on a model’s forecast and is what
the raster manifest calls run; number is a centre’s advisory or warning
number, verbatim.
Track. A best track: points by time, strictly increasing, no leads.
source says where it came from: ibtracs, or the centre whose working
file it is (nhc for its b-deck, jtwc for a warning’s history block,
hko for the past positions and analysis of its track information);
provisional is true for every working track of a live storm. Keys of
best are IBTrACS’ agency keys: usa (the NHC / JTWC joint best track),
jma, cma, hko, kma, imd, mfr, bom, fms, mnz. When more
than one source supplies the same key, the fresher working file is taken
(nhc, then jtwc, then ibtracs; hko, then ibtracs).
Ensemble. A member set on one lead axis, as fixed-point integer arrays
flattened member-major: index = member position × len(leads) + lead position. lat and lon are degrees × 100, vmax m/s × 10, pmin hPa ×
10; −32768 is missing (a member that has not found, or has lost, the
system). members lists the member ids in array order (GEFS: 0 for the
control, 1–30; ECMWF ENS: 1–51 as the BUFR numbers them). mean is the
ensemble mean track when the source publishes one (GEFS’ AEMN), else
null.
Keys. Agency and model ids are ^[a-z][a-z0-9]*$ and are admitted
structurally: a key the reader’s registry does not know is drawn in a
neutral colour, not rejected. The ids the publisher writes today are
xuebuild/tc/registry.py’s, which the frontend reads out of the shell’s
registry (web/src/data/registry.ts, generated by xue registry --shell).
Alert. JTWC’s tropical cyclone formation alert, when one is in force for a B-level system: the formation line’s two ends, its half-width and the estimated centre.
6. sources[]
One entry per source the build was asked for, in build order:
ok: false always carries error. A source’s counts say what it
contributed: products the JTWC products read, storms the systems NHC
listed, members the GEFS member files read, systems the systems the
build took from it. cycle is the model run a model source
was read from; the ensemble’s cycle lagging the deterministic one (ECMWF’s
enfo lands later than oper) is the normal state. The list is repeated
in every storm file so a storm can be read on its own.
Source ids in v1: jtwc (JMV 3.0 warnings and formation alerts, via the
RSS feed), nhc (CurrentStorms.json, the a-deck’s OFCL lines, the
b-deck), hko (the Hong Kong Observatory’s tropical cyclone track
information, below), gfs (the NCEP tracker’s avno file), gefs (its ac00,
ap01–ap30 members and the aemn mean), ecmwf (open data oper tf
BUFR), ecmwfens (enfo tf BUFR), ibtracs (the v04r01 active list).
hko is the DATA.GOV.HK dataset hk-hko-rss-tc-track-info, reused under
the DATA.GOV.HK terms of use with the attribution “Hong Kong Observatory
(DATA.GOV.HK)”. tc_list.xml names the systems the Observatory issues
forecast tracks for (storms counts them), each with a
hko_tctrack_<TCID>.xml, which maps onto a storm file as:
| feed | product |
|---|---|
BulletinTime (Hong Kong time) | agencies.hko.issued, in UTC |
AnalysisInformation | agencies.hko.base and its point at lead 0; the last point of best.hko |
ForecastInformation with a Time | the forecast’s later points; an entry without one is a position interpolated for the Observatory’s own map and is skipped |
PastInformation | best.hko before the analysis (source: "hko", provisional: true) |
MaximumWind (145km/h, ten-minute mean) | vmax in m/s; -- is null |
Intensity | class, as §2 says |
TropicalCycloneName | name, null while it is a category |
The feed gives no pressure, radii or advisory number: pmin, radii and
number are null or absent. Every system it tracks is filed under WP.
A bulletin with no position past its analysis (the last, on a system that
has weakened or turned extratropical) contributes its best track and no
forecast.
7. Validation
The JSON Schemas of §4 and §5 are normative for shape: a file that does
not match them is not a tc file. tests/test_schemas.py holds the
committed golden (tests/fixtures/tc/expected/, a build from the fetched
fixture tests/fixtures/tc/tc.2026091206/ by tests/prepare_tc_golden.py)
to them, and the shell’s validators are generated from them
(web/src/schema/generated/). xuebuild/tc/schema.py validates every
file as it is written, and tests/test_tc.py holds the build to the
golden. What a schema cannot say is each reader’s own check: unique
storms and file names, an A-level storm’s ATCF id, the alias keys and
their windows’ order, the radii thresholds, a forecast point’s lead and
its time as base + lead, leads and best-track times strictly
increasing, an ensemble’s members unique and its arrays one value per
member and lead, and a crosswalk entry naming two different storms. A
reader rejects a schemaVersion above the one it implements.
8. The archive
The hourly directories are the live view. The archive is the record: every
distinct forecast of a numbered system, once, filed by month, and every
season’s best tracks — what a track-error score is computed from. It is a
separate tree under the data root, written every six hours
(archive-tc.yml, xue tc-archive) and never pruned.
8.1 Layout
catalog.jsonis fetched with caching disabled. Each entry names an index bypath(relative to the catalog),byteLengthandcrc32; each index names its.jsonlthe same way. Every file but the catalog is requested as<path>?v=<crc32>.- A month is the UTC month of a forecast’s
base. A season is the ATCF season of the storm id (its last four digits): the calendar year, except that the southern hemisphere’s season runs July to June and is named after the year it ends in (SH012026forms after 1 July 2025). - A month or season file is rewritten in place when a record reaches it (the month in progress daily, an earlier one by a late arrival or a backfill), and its CRC32 changes with it. Nothing in the files records when they were built: the same records give the same bytes.
- Lines are sorted by storm, then source, then
base, so one storm’s records in a month are one byte span — one Range request.
8.2 Records
A line of forecasts.jsonl:
stormis the ATCF id. Only numbered systems are archived; a system the product first carried under a synthetic id (§3) is filed under the ATCF id the crosswalk later gave it, forecasts before numbering included. A system never numbered is not archived.sourceis an agency or model id (§5);kindisagency,modelorensemble;forecastis a §5Forecast, or anEnsemblewhenkindisensemble.nameis the name the source gave, ornull.originsays where the record came from:live(the hourly product),nhc-atcf(NHC’s a-deck archive),ucar-atcf(the UCAR RAL mirror of the ATCF a-decks),ecmwf-aws(ECMWF open data’stfBUFR as kept on AWS).- A record is identified by
(storm, source, base). Of two records under one key the later replaces the earlier, except that aliverecord is never replaced by a backfilled one. - Ensemble member ids are the origin’s own: in a backfilled a-deck the
control is 0 and a perturbed member its tech number (
AP07→ 7,EE12→ 12); ECMWF’s BUFR numbers 1–51.
A line of best.jsonl holds one storm:
atcf lists every ATCF id the storm carried (one that crossed into another
basin’s numbering has two). For each agency key the archive keeps
IBTrACS’ track once it is final, and until then whichever of IBTrACS’ and
the centre’s working file (§5 Track.source) reaches later.
A season’s best tracks may also hold what IBTrACS’ backfill brings and the
centres never numbered, most of the storms before the satellite era. Such a
storm’s id is a history id, <basin>-<SID>-<season> (WP-1951123N10140-1951):
the ATCF basin (IBTrACS’ NA as AL, NI as IO, SI, SP and SA as
SH), IBTrACS’ SID, and its SEASON, which follows the same southern
July-to-June rule. Like an ATCF id it opens on the basin and ends on the season.
Its atcf is empty, it has no forecasts, and a branch IBTrACS marks as a spur
of another storm is not kept. A storm no agency holds has one track, under the
key ibtracs: IBTrACS’ merged position (source: "ibtracs"), vmax and pmin
from WMO_WIND and WMO_PRES, class its NATURE. Early winds and pressures
are mostly null, and centres’ methods changed over the record, so the
positions and intensities of different eras are not of equal quality. IBTrACS
lists as a known issue that some storms before 1950 were not correctly matched,
so one storm can appear as several and those seasons’ counts run high; the
archive keeps them as IBTrACS has them. The history page says both on a season
before 1980, the start of what IBTrACS calls the modern era of satellite
observations.
A storm IBTrACS does not hold can be reconstructed by hand from primary sources
and kept in xuebuild/tc/curated.json, backfilled as curated. Its id is
<basin>-<NAME>-<season> (WP-COBRA-1944), its one track has the key and
source curated, and its record adds provenance: each source’s publisher,
title, url and use (position, pressure or check), shown on the
history page. Its points carry their sources’ own times, without interpolation,
and what the sources do not measure stays null. Typhoon Cobra has seven
positions, from the Weather Bureau’s daily charts and two ships’ war diaries that
bracket the centre, one measured pressure and no wind.
A storm IBTrACS does hold keeps its id and its agency tracks when the primary
sources contradict them for a stretch of its life: only that stretch goes under
curated, beside them. CONNIE (WP031945), the Navy’s Viper, has five points
around the fleet’s passage through the centre on 5 June 1945 (local time), whose
958.3 hPa and 80 kt the US track, at 43 kt then, does not hold. A source’s use
can also be wind.
8.3 Indexes
A month’s index.json:
A season’s index.json carries season, best (the file) and storms,
each with id, basin, name, sid, atcf, its span in best.jsonl
(offset and length, both null for a storm with forecasts but no best
track yet), the agency keys of its tracks (best), the first and last
time any of them places it (first, last) and its peak wind (vmax,
m/s, on the usa track when there is one, else on the first key that has
a wind, raised by a curated track that observed more; all three null
without a best track or wind), the months it has
forecasts in and the sources of those forecasts. It names overview (path,
byteLength, crc32; absent from an index written before it):
{archiveSchemaVersion, product, season, storms: [{id, track: [[lon×10, lat×10, class], …]}]}, each storm’s US best track (else the first with
points) at its synoptic times, longitudes and latitudes in tenths of a
degree, class the Saffir–Simpson class of its wind from 0 (TD, below
34 kt) through 1 (TS) and 2–6 (H1–H5, from 64, 83, 96, 113 and 137 kt),
−1 where it has none. catalog.json lists months (month, path, byteLength,
crc32, storms, records) and seasons (season, path, byteLength,
crc32, storms). Storms and entries are sorted and unique; the spans tile
their file exactly. A reader rejects an archiveSchemaVersion above the
one it implements.
The shapes are normative in
schemas/tc-archive-catalog.schema.json,
tc-archive-month-index,
tc-archive-season-index,
tc-archive-overview and, for a
line of §8.2’s files,
tc-archive-forecast-line and
tc-archive-best-line;
tests/test_schemas.py holds an archive it builds to them, and the shell’s
readers run the validators generated from them (§7). What they cannot say,
the order, uniqueness and tiling above and a storm’s season, is each
reader’s own check.
8.4 Producers
- The harvest (every six hours) reads the last 48 hourly issues from the data origin,
follows their crosswalk, and for every system it renames reads back ten
days for the forecasts it carried before it was numbered; hourly
directories are therefore kept at least that long. The 00:50 UTC run
then merges IBTrACS’ last three years into the seasons; the other three
pass
--no-ibtracs. - The backfill (
xue tc-archive --backfill <sources> --from YYYY-MM) readsnhc(OFCL→nhc,AVNO→gfs,AC00/AP01–AP30/AEMN→gefs,EMX→ecmwf,EC00/EE01–EE50/EEMN→ecmwfens,GDMN→gdm; AL, EP, CP),ucar(AVNO, orAVNXwhere it is alone, →gfs, and the GEFS techs; WP, IO, SH),ecmwf(oper/scdaandenfotfBUFR from 2023-01-18) andibtracs(every storm of the seasons named by the years of--fromand--to;since1980, orALLbefore 1980, or a copy on disk with--ibtracs-csv, since the whole list is hundreds of megabytes served slowly).hkoreads the Hong Kong Observatory’s last bulletin on each system of those seasons (hko_tctrack_<TCID>.xml, which it keeps serving after the system is gone, for the current season only) and adds its past positions as the storm’shkotrack, provisional, on the archived storm that most of its synoptic positions lie within 333 km of; the Observatory’s number and name are not used, and a system the archive does not hold is left out. The harvest adds numbered storms only, so a history id appears only where the backfill was run.gdmis Google DeepMind’s experimental model (the ensemble mean NHC files from 2025). Its data is CC BY 4.0 only for times past and under Google’s real-time terms for anything ahead, so it never enters the hourly product, and a track is archived only once its last valid time is 48 hours past; a weekly run of thenhcbackfill over the last two months brings each in. Wherever it is shown or distributed it carries: “Contains experimental research data produced by © 2023-25 Google LLC, whose machine learning models were used to create the experimental data, under a Creative Commons Attribution 4.0 International (CC BY 4.0) Licence. The data is intended for research modelling only and is not intended, validated, or approved for real world use.” An ECMWF system whose number is not JTWC’s or NHC’s (every western Pacific and southern hemisphere one, and every7x) is filed under the season’s best-track storm whose synoptic position at the forecast’s start lies within 333 km of the start — the nearest when two do — or not at all; a storm’s ECMWF forecasts from before it was numbered are kept this way.--rekey --from --toapplies the same placement to the ECMWF records of those two basins already archived, dropping those that start on no storm. JTWC’s and the Asian centres’ forecasts have no public archive: they exist from the day the live harvest kept them.
9. Track-error scores
Each season of the archive with forecasts carries their errors against its
best tracks, written by the same run (xue tc-archive, which scores
every such season whose inputs changed; --rescore forces one):
catalog.json names them under scores (season, path, byteLength,
crc32, from). from is what they were computed from — the season
index’s CRC32 and that of every month its storms appear in — so a reader
can tell scores that lag the archive, and a run knows which to redo.
9.1 Verification
- Truth is a best track of the season record (§8.2), each key scored on its
own:
usain every basin,jmaandcmain the western Pacific. They are never mixed, and intensity errors againstjmaandcmacompare a source’s winds with ten-minute ones. - Only the best track’s synoptic points (00, 06, 12, 18 UTC) are truth.
A forecast is verified at a lead when the best track has a point both at
its
baseand atbase + lead, and the system is a tropical or subtropical cyclone at both:usastatusTD,TS,TY,ST,STY,TC,HU,HR,MH,SDorSS; JMA grade 2–5 or 9; CMA category 1–6; and where a point carries no class, a wind of at least 25 kt. - Leads are 0, 12, 24, 36, 48, 72, 96, 120, 144, 168, 192, 216 and 240 h; a forecast point verifies only at exactly these. A forecast with no point past its start — a system the model lost, which ECMWF still writes, often at a stale position — is not verified.
- An ensemble is verified by its mean position: the centroid of the members that carry the system at that lead, only where they are at least half of the members. Members not following the system the others follow (within 333 km at their first position) are left out.
- Errors:
track, the great-circle distance in km;alongandcross, its components along the best track’s motion through the verifying time (positive ahead) and across it (positive to the right);vmaxandpmin, forecast minus truth,nullwhere either is missing.
9.2 scores.json
summary is every source on its own sample; homogeneous compares each
source with a basin’s references — the official forecast (nhc in AL,
EP, CP; jtwc in WP, IO, SH) and ecmwf — on exactly the (storm, base,
lead) cases both verified, with skill = 1 − track ÷ reference track.
A line of errors.jsonl is {storm, basin, truths: {<truth>: {<source>: {base: [], lead: [], track: [], along: [], cross: [], vmax: [], pmin: []}}}},
one column per field and one row per verified case, lead in hours.
The shapes are normative in
schemas/tc-scores.schema.json and
schemas/tc-errors-line.schema.json,
held as §8.3’s are.
The official forecasts are compared with the models of the same base,
which ran with the same data but finished after the official forecast
was written; the centres’ own verification compares them with the
previous cycle’s models instead, so these skills favour the models.
10. Pictures
The static storm and season pages show each track on a map. The pictures
are drawn from the archive (xue tc-images, xuebuild/tc/images.py, run
by archive-tc.yml after the archive is uploaded) and live beside it,
never inside tc/archive/:
- Every picture is 1200 × 630: the page’s light and dark WebP, chosen by
prefers-color-scheme, and the dark PNG as the page’sog:image(PNG, for scrapers that read no WebP). The track is the page’s own (§8.2’s best track,usafirst, synoptic times), on Natural Earth 1:50m land, in the storm map’s Saffir–Simpson colours. - A file’s name carries the CRC32 of its bytes, so it is immutable
(
max-age=31536000, immutable) and a redrawn picture is a new name.index.jsonis fetched with caching disabled and uploaded last. index.json:product("tc-images"),style,width,height,stormsby storm id andseasonsby season, each entryseason,sourceandlight/dark/cardas{path, byteLength}withpathrelative to the index.sourceis<style>:<crc32>of what the picture was drawn from (the storm’sbest.jsonlline, or the season’sbest.jsonl): a run draws again only what changed, or everything whenstylemoves. Storms with fewer than two synoptic points have none.- A file the index no longer names is deleted once it is 30 days old
(
prune-r2-tc-images): pages built before the index moved, cached share cards and image searches still ask for it until then.
Part of the Xue specification, licensed under CC BY 4.0.
10 - The airport product
In the viewer: one page per airport under /airports/ (e.g. /airports/rjtt), the stations over the map with ?stations=apt (/gfs?stations=apt), and the nearest airport’s reports under a pinned point and in /compare.
An airport’s weather is a line of text: a METAR every half hour, a TAF
every six. Five thousand of them are a few megabytes of JSON, not a
raster, so the airports are a third product published beside the runs and
beside the tropical cyclones (docs/tc.md) — aggregated every ten minutes
by xue airport-build (xuebuild/airport/) from the NOAA Aviation Weather
Center’s decoded cache files, and taken live by the same pointer →
immutable directory contract the runs use. This document is the normative
description of that product, schema v1. The design it implements is in the
project’s private notes; what is here is the contract a reader can hold the
publisher to.
1. Delivery
Everything is a static file under the data root, the same root as the run
pointers (latest.json, latest-<model>.json), latest-tc.json and
showcase.json.
latest-airport.jsonis the one mutable object. Fetch it with caching disabled. It names the newest round’s directory and the index inside it:pathis relative to the pointer and alwaysairport/<YYYY>/<MM>/<DD>/airport.<round>/index.json, the date being the round’s. A pointer written before that layout names the flatairport.<round>/index.json, and a reader accepts both.byteLengthandcrc32(zlib CRC32 of the file’s bytes, eight lowercase hex digits) are the index’s, so it can be requested as<path>?v=<crc32>through an immutable cache.airport/<YYYY>/<MM>/<DD>/airport.<YYYYMMDDHHMM>/is one immutable directory per round, filed under its UTC day so the data root does not carry a prefix per round: the UTC minute the product was aggregated at, always a multiple of ten. It holdsindex.json(§4) andhistory.jsonl(§5) — and beside themitem.json, the round’s STAC Item, a pure function of the index read by a catalog client and by nothing in the product (docs/stac.md§“Point products”) — and nothing in it changes once the pointer names it. Every file is addressed by its CRC, so a cache never serves one round’s bytes under another’s key. Directories are pruned after three hours (make prune-r2-airport,AIRPORT_KEEP=18); nothing reads an older round, because each round carries the whole history.Paths inside
index.jsonare file names beside it; request each as<name>?v=<crc32>with the CRC the index carries.
Two ways to read the history, which is why it is one file:
- One airport. Take the station’s row in the index, which ends in the
byte
offsetandlengthof its line, and issueGET <round directory>/history.jsonl?v=<crc32>withRange: bytes=<offset>-<offset + length - 1>. The bytes that come back are that station’s JSON object exactly — the span stops before the newline — so they parse on their own. One request, a few kilobytes. - Everything. Fetch
history.jsonland read it line by line: one station per line, sorted by ICAO id, each a complete JSON object. No listing, no thousand small objects, and the file streams.
The publisher builds every ten minutes (publish-airport.yml). A source
that is late or unreachable is recorded (see sources) and the round
publishes without it. The pointer is withheld only when both the METARs
and the TAFs failed, in which case the previous round stays live. A round
the pointer already names is finished: a run that resolves to it (a
dispatch landed in the same ten minutes, or the schedule drifted) builds
nothing, and the workflow’s force input is the manual rebuild.
Deployment is one-sided: the product is new files under a new pointer, so a
shell that does not know it never asks for it. A schemaVersion bump
follows the runs’ rule (ship the shell first); an added optional field does
not bump the version.
2. Units and conventions
SI throughout, converted at the parser:
| quantity | unit | note |
|---|---|---|
temperature, dew point (t, td) | °C, to a tenth | as the service decodes them |
wind speed and gust (ws, gust) | m/s, to a tenth | knots × 0.514444 |
wind direction (wd) | degrees true, 0–360 | integer; null when the direction is variable |
visibility (vis) | metres, to a hundred | statute miles × 1609.344 |
pressure (qnh, slp) | hPa, to a tenth | qnh is the altimeter setting, inHg × 33.8639; slp the reported sea-level pressure |
cloud base (cloud) | metres above ground, to ten | feet × 0.3048 |
elevation (elev) | metres | from the station table where there is one |
| time | ISO 8601, UTC, Z suffix |
vis has one convention: the service codes “ten kilometres or more” as
6+, 10+ or P6SM rather than a distance, and all of those are written
as exactly 10000. A vis of 10000 therefore means at least ten
kilometres, not ten kilometres. Every other value is the reported distance
converted, which is why a report of 7 statute miles reads 11300 — a
measured 11.3 km, not the coded ceiling.
wd has one too. A variable direction (VRB04KT, and a TAF group’s
VRB) is null with the speed kept: the direction is not known, and
writing the zero the CSV decodes it to would publish a north wind. wd: 0
therefore means due north, and wd: 0 with ws: 0 is calm.
qnh comes from the altimeter setting in inches of mercury, which is
itself a conversion of the Qnnnn hectopascals most of the world reports;
it can differ from the hectopascals in raw by a tenth. raw is the
report verbatim and is the authority.
cloud is [[cover, base], …] in the order reported, at most four layers,
with cover the three-letter code as it arrives (FEW, SCT, BKN,
OVC, OVX, and in a TAF also NSC, SKC, CAVOK). A layer that
reports no base — the sky-clear and no-significant-cloud codes, and an
obscured sky whose vertical visibility is in raw — has base: null.
Numbers are JSON numbers; a value not reported is null. A value outside
the range the contract admits is also null: the service codes some
unknowns as numbers (-99.99 for a position it does not have), and one bad
cell must not cost a round. A report with no usable position at all is not
published, since the product could not place it.
The files are written compactly with ASCII escaping — a history line is one
such object and carries no whitespace of its own — and a file’s identity is
its bytes: the CRC32 in the index, and the pointer’s, is of the file
exactly as served. Given the same inputs, a round is byte-identical;
nothing in it is a function of when the build ran except the index’s
generated.
3. Identity
A station is its ICAO id, uppercase (RJTT, KABQ, ZBAA). Nothing is
inferred: a station the station table does not know still enters the
product under the id its report carries, with a null name and the report’s
own position. The id is the key everywhere — the index’s rows and the
history’s lines are both sorted by it, and each history line repeats it as
icao so a slice read by range identifies itself.
4. index.json
The shape — every field, its type and range — is
schemas/airport-index.schema.json;
the pointer’s is schemas/pointer.schema.json.
This section says what the fields mean and the rules across them.
issuedis the round,generatedwhen the build ran.historynames the file beside the index, its length and the CRC32 of the whole file — the?v=a reader requests it under.columnsnames the rows’ columns, and a reader finds a column by its name there. In v1 it is always the order below, so a reader that indexes by position reads it too. It is optional: rounds published before it (every airport round up to 2026-11-04) do not carry it, and a reader takes such an index’s rows in the order below.stations[]is one compact row per station, sorted by ICAO id and unique, in this order:0 1 2 3 4 5 6 7 icaolatlonelevobsTimettdwd8 9 10 11 12 13 14 15 wsgustvisqnhcategorytafPresentoffsetlengthThe values from index 4 to 12 are the station’s newest observation; the whole of it, and its 23 hours of predecessors, are in the history file.
categoryis the service’s flight category (VFR,MVFR,IFR,LIFR) ornull;tafPresentis 1 when the station has a current TAF, else 0.offsetandlengthare the byte span of the station’s line inhistory.jsonl, the JSON object alone: the spans are in row order, they do not overlap, and each lies insidehistory.byteLength.sources[]is §6.
The index is what a map layer reads: about 600 KB for five thousand stations, every position and current condition, and no history.
5. history.jsonl
Each line’s shape is schemas/airport-line.schema.json.
One line per station, sorted by ICAO id, each the compact JSON object
below followed by \n:
Metar. time is the observation time, and the entries are strictly
decreasing in it: metars[0] is the newest. raw is the report as
transmitted. wx is the present-weather string verbatim (-SHRA BR) or
null; auto says the report came from an automatic station; type is
METAR or SPECI (an off-schedule special). A station in the product has
at least one observation in the window; when its last one falls out of the
24 hours, the station leaves the index and the history until it reports
again.
Taf. issued is the bulletin’s issue time, from and to its validity,
amended true for an amendment or a correction (AMD or COR in the
bulletin’s remarks). periods are the decoded groups sorted by from and
then to. change is the group’s change indicator — FM, BECMG,
TEMPO, PROB — and is null on the forecast’s first, prevailing group;
a PROB40 TEMPO group is change: "TEMPO" with prob: 40. A period
carries only what its group states: a field the group does not restate is
null and the reader inherits it from the prevailing group, as the TAF
itself is read. The BECMG completion time is not carried in v1.
A station’s history is a merge, not a snapshot. Each round lays that round’s observations over the previous round’s history keyed by (station, observation time), the newer report winning — so a correction replaces what it corrects — and drops what is older than 24 hours before the round. A station that did not report keeps its history untouched.
Only stations that have observed are in the product: a TAF for a station with no observation in the window is not published, since there would be nothing to hang it on.
6. sources[]
One entry per source, in build order:
ok: false always carries error. reports is what the source
contributed: METARs read, TAFs read, stations in the table. bytes is
the size of the file the source served; cached: true, with the table’s
modified (its Last-Modified, verbatim), marks a station table kept
from an earlier fetch.
Source ids in v1, all from the Aviation Weather Center’s cache (https://aviationweather.gov/data/cache/), a work of the United States government and in the public domain:
awc-metars—metars.cache.csv.gz, the world’s decoded METARs of the last ninety minutes, rewritten every minute.awc-tafs—tafs.cache.xml.gz, every current TAF, rewritten every ten minutes.awc-stations—stations.cache.json, the station table (name, IATA and WMO identifiers, position, elevation), rewritten daily and fetched at most once a day withIf-Modified-Since. When the request fails over a copy already on disk the source staysokwith the error noted: a day-old table names the same airports.
The service asks for at most a hundred requests a minute and a custom
User-Agent on every request; the publisher sends
xue/<version> (+https://github.com/ringsaturn/xue) and makes three
requests per round. The observations themselves are the world’s
meteorological services’, exchanged under WMO arrangements and
redistributed by NOAA/NWS; attribution names both.
7. Validation
The JSON Schemas of §4 and §5 are normative for shape: a file that does
not match them is not an airport file. tests/test_schemas.py holds
the committed golden (tests/fixtures/airport/expected/, two consecutive
rounds built from the fetched fixture
tests/fixtures/airport/airport.202609161430/ and …1440/, the raw
rounds, which stay flat under the raw root, by
tests/prepare_airport_golden.py) to them, and the shell’s validators are
generated from them (web/src/schema/generated/).
xuebuild/airport/schema.py validates every file as it is written, and
tests/test_airport.py holds the build to the golden and checks every
index row’s span against the history file it addresses. What a schema
cannot say is each reader’s own check: the history file’s name,
columns the v1 order, every row sixteen values, the rows sorted by id
and unique, the spans in row order inside history.jsonl, the METARs
newest first, and a TAF and its periods not ending before they start.
Admission is structural: a station id, a sky cover or a weather string a
reader has never seen is not an error. A reader rejects a schemaVersion
above the one it implements.
8. Share cards
Each airport page’s og:image is a card drawn from the pages’ checked-in
list (web/tooling/airports.json), not from the product: xue airport-images (xuebuild/airport/images.py, run by airport-images.yml
when the list or the drawing changes) writes them beside the product,
never inside airport/:
- A card is a 1200 × 630 PNG on the storm pictures’ dark map (docs/tc.md §10): Natural Earth 1:50m land around the airport, its mark and ICAO id, the other listed airports in the frame as dots, the airport’s English name, its codes and city.
- A file’s name carries the CRC32 of its bytes, so it is immutable
(
max-age=31536000, immutable) and a redrawn card is a new name.index.jsonis fetched with caching disabled and uploaded last. index.json:product("airport-images"),style,width,heightandairportsby ICAO id, each entrysourceandcardas{path, byteLength}withpathrelative to the index.sourceis<style>:<crc32>of what the card shows (the airport’s codes, name, city and position, and the positions of the listed airports in its frame): a run draws again only the cards that changed, or all of them whenstylemoves. An airport dropped from the list drops from the index.- A file the index no longer names is deleted once it is 30 days old
(
prune-r2-airport-images). A page whose airport the index lacks, or a build that cannot read the index, keeps the site’s card.
Part of the Xue specification, licensed under CC BY 4.0.
11 - The radiosonde sounding product
In the viewer: the stations over the map with ?stations=snd (/gfs?stations=snd), the nearest ascent as a skew-T under a pinned point, and the model’s own sounding beside it in /workbench.
The .xue container is a raster container. A radiosonde ascent — a few
hundred levels of pressure, height, temperature, dew point and wind at one
point — is not a raster, so soundings are another, smaller product
published beside the runs: plain JSON, a few megabytes an hour, aggregated
by xue sounding-build (xuebuild/sounding/) from the TEMP bulletins the
world’s weather services exchange, and taken live by the same pointer →
immutable directory contract the runs and the tropical cyclone product
use. This document is the normative description of that product, schema
v1. The design it implements is in the project’s private notes; what is
here is the contract a reader can hold the publisher to.
1. Delivery
Everything is a static file under the data root, the same root as the run
pointers (latest.json, latest-<model>.json), latest-tc.json and
showcase.json.
latest-sounding.jsonis the one mutable object. Fetch it with caching disabled. It names the newest issue directory and the index inside it:pathis relative to the pointer and alwayssounding/<YYYY>/<MM>/<DD>/sounding.<issued hour>/index.json, the date being the issued hour’s. A pointer written before that layout names the flatsounding.<issued hour>/index.json, and a reader accepts both.byteLengthandcrc32(zlib CRC32 of the file’s bytes, eight lowercase hex digits) are the index’s, so it can be requested as<path>?v=<crc32>through an immutable cache.sounding/<YYYY>/<MM>/<DD>/sounding.<YYYYMMDDHH>/is one immutable directory per issue, filed under its UTC day so the archive can be kept for years without any listing level growing past a few dozen prefixes. The hour is the UTC hour the product was aggregated at, not any sounding’s nominal time. It holds the product’s two files,index.jsonandsoundings.jsonl, and beside themitem.json, the issue’s STAC Item — a pure function of the index, read by a catalog client and by nothing in the product (docs/stac.md§“Point products”). Once the pointer names it nothing in it changes; a manual rebuild of an hour (sounding-build --issue … --force) writes the directory again, and both files are addressed by their CRC, so a cache never serves one hour’s bytes under another’s key. Directories are pruned after seven days (make prune-r2-sounding).soundings.jsonlis every station’s soundings, one JSON object per line, sorted by station id.index.jsonspans it: thesoundingsdescriptor gives the whole file’sbyteLengthandcrc32, and eachstations[]row gives theoffsetandlengthof that station’s object. So there are two ways to read the product and both are cheap:- one station, the way the viewer reads it — fetch
soundings.jsonl?v=<crc32>withRange: bytes=<offset>-<offset+length-1>. The span excludes the trailing newline, so what comes back parses as JSON on its own. - all of it, the way an analyst reads it — fetch the one file and stream it line by line. No directory traversal, no thousand small objects.
One file per issue rather than one per station is deliberate: a bucket full of small objects is slow and expensive to traverse for anyone doing statistics over the archive, and it bills per object.
- one station, the way the viewer reads it — fetch
The publisher builds every hour at a quarter past (publish-sounding.yml).
A station with no new ascent this hour is carried forward from the
previous issue’s soundings.jsonl, so its content is unchanged even
though the file around it is rewritten. A source that is late or
unreachable is recorded (see sources) and the hour publishes without it.
The pointer is withheld only when no source contributed and there was nothing to
carry forward, in which case the previous hour stays live. An hour the
pointer already names is finished: a run that resolves to it builds
nothing, and the workflow’s force input is the manual rebuild.
Deployment is one-sided: the product is new files under a new pointer, so
a shell that does not know it never asks for it. A schemaVersion bump
follows the runs’ rule (ship the shell first); an added optional field
does not bump the version.
2. Units and fixed point
The scalar fields are SI, converted at the parser. The level arrays are
fixed-point integers — a sounding is a few hundred levels and JSON floats
would double the file for no precision — with -32768 for a value the
bulletin does not report:
| array | quantity | unit |
|---|---|---|
p | pressure | Pa |
z | geopotential height | gpm |
t | temperature | K × 100 |
td | dew-point temperature | K × 100 |
wd | wind direction, the direction the wind comes from | degrees |
ws | wind speed | m/s × 10 |
sig | extendedVerticalSoundingSignificance | the BUFR flag word, verbatim |
The seven arrays are parallel and all of length n. -32768 is the
missing value in every one of them, including sig; it is a JSON number,
not a 16-bit field, so a height of 35 000 gpm is written out in full.
Scaling is half-up on the magnitude (-0.5 and 0.5 both round away from
zero), so a second implementation does not have to know one language’s
rounding rule.
p is the vertical axis: it is present on every level, strictly
descending, and the levels are ordered by it. A level the bulletin
reports without a pressure has no place on that axis and is not published;
two levels reported at one pressure (a significant temperature level and a
significant wind level at the same height, as a few centres file them) are
folded into one, the first keeping its values, taking what it is missing
from the second, and the two sig words or-ed together.
sig is BUFR flag table 0 08 042, an 18-bit field numbered left to right,
so bit 1 is 1 << 17. The bits a reader is likely to want:
| bit | value | meaning |
|---|---|---|
| 1 | 131072 | surface |
| 2 | 65536 | standard level |
| 3 | 32768 | tropopause level |
| 4 | 16384 | maximum wind level |
| 5 | 8192 | significant temperature level |
| 6 | 4096 | significant humidity level |
| 7 | 2048 | significant wind level |
Thinning. The product publishes the classical TEMP set, not every sample. A modern sonde reports every second — seven thousand levels of an ascent whose mandatory-and-significant set is forty to a hundred and fifty — which is detail no skew-T or model-profile comparison draws, at two orders of magnitude of bytes. After the levels are ordered and levels at one pressure folded, a level is published when:
- its
sighas any of bits 1–7 set (surface, standard, tropopause, maximum wind, significant temperature, significant humidity, significant wind); or - the source sends its ascents unflagged (Météo-France, §6) and it is
the level nearest one of the standard surfaces — 1000, 925, 850, 700,
500, 400, 300, 250, 200, 150, 100, 70, 50, 30, 20 and 10 hPa — within
one hectopascal of it. It is kept as measured, at its own pressure,
and its
sigstays-32768: it is not a level the station reported as standard; or - it is the lowest or the highest level of the ascent; or
- its pressure is at least 3 % below the last published level’s
pressure —
p_last_published / p >= 1.03, walking upward, the last published level being whichever was kept, flagged or not.
A sig of -32768 counts as unflagged. A properly flagged ascent passes
through untouched; an unflagged run is capped at about 150 levels between
1000 and 10 hPa. n is the published level count and reported beside it
is what the bulletin held before thinning, so a reader can always see what
was left out — and the three sample bulletins in the fixture lose one
level between them.
Times are ISO 8601, UTC, Z suffix. Numbers outside the level arrays are
JSON numbers, and a value not reported is null. The files are written
compactly with ASCII escaping, and a file’s identity is its bytes: the
CRC32 in the index is of the file exactly as served.
3. Identity
A station has one id for its whole life in the product, and it is a WIGOS
identifier: <series>-<issuer>-<issue number>-<local identifier>, written
out, which is digits and hyphens and needs no escaping in a URL. It is
what soundings.jsonl is sorted by and what the index’s rows key on.
- Two soundings are the same station when they carry the same five-digit
WMO number,
block × 1000 + station. That number is the identity key, because a station that has migrated to a native WIGOS identifier is still filed under its WMO number by the centres that have not. - The published
idis the station’s native WIGOS identifier once any bulletin has carried one (China’s stations do:0-20001-0-51463), and otherwise the legacy form of the WMO number,0-20000-0-<wmo>. Sources disagree over it, so the identifier a previous issue published is kept through an hour whose bulletins carry only the legacy form, and the soundings published under either are one station’s. wmocarries the five-digit number whenever it is known, whichever form the id took.- A subset with neither a WMO number nor a usable WIGOS identifier — a
ship, a mobile station, a WIGOS local identifier that is not
URL-safe — is dropped and counted in its source’s
dropped.
Names. TEMP bulletins name no station (no subset of any source
carries stationOrSiteName), so name comes from
xuebuild/sounding/stations.json: WMO number → name, built from NOAA
NCEI’s IGRA2 station list (igra2-station-list.txt, the file’s date in
the table) for the WMO-numbered stations reporting since 2020. It is
checked in, not fetched, so no outage can cost an issue its names. The
list’s names are the WMO station records in capitals, cut at 30
characters; the table title-cases them (acronyms such as AFB and Roman
numerals kept, particles such as de and na lowered), drops the index
annotations ((47418-0)), the station-type tags ((RS), (AERO), a
Canadian UA) and a trailing US state or Canadian or Mexican province
code, and drops the last word of a name the 30-character cut may have
broken. Nothing is translated or added. name is a function of wmo
alone, applied to carried-forward lines too, and is null for a station
the table lacks, a WIGOS-only station among them.
A sounding’s nominal time is the synoptic hour it is filed under: the
<ddhhmm> of the bulletin’s WMO file name, dated by the month the
gateway’s arrival stamp puts it nearest. A national node’s object carries
no heading, so its subsets are filed by their own clock instead: the
six-hourly hour at or before three hours after it, which puts a launch
from 21:00 to 02:59 on the 00Z ascent (and a TEMP converted from text,
whose clock is the nominal hour, on itself). Météo-France’s files are
filed the same way, by their launch time: the hour in a file’s name is
its publication batch, and an 18Z ascent from Rapa is in the next day’s
00 file. It is not the launch time. The
launch time is the subset’s own clock (timeSignificance 18) and is
published as launched when it lies between 90 minutes before the nominal
hour and an hour after it — the window that covers both the Chinese
stations releasing at 23:15 for 00Z and the Japanese ones at 00:16.
Anything outside is a clock the product does not trust, and launched is
null.
Descents. A message whose template is Table D 3 09 056, the
radiosonde descent, is not a sounding of this product: its levels run
down from the burst, and its clock and position are the burst’s. It is
left out whole and counted in its source’s descents. Météo-France’s
node publishes only descents, and the gateways carry none of mainland
France’s ascents; those come from Météo-France’s own files (§6). A
Météo-France file holds an ascent and a descent side by side, each
labelled with its direction, but the label is not relied on: an object
is an ascent when the level at its lowest pressure was measured later
after launch than the level at its highest, and a descent otherwise, and
only an object whose levels cannot say (a single level, no clock column)
falls back on the label. An object of fewer than two levels is no
sounding and is counted in dropped.
Deduplication. The same station-hour arrives more than once: the
sources carry overlapping sets, a station may be filed in more than one
bulletin, and corrections (CCA, RRA…) repeat a bulletin outright. One
sounding survives per (station, nominal time): the one with the most
temperatures, then the most levels, and on a tie the one that
arrived last, which is the correction. The sounding a previous issue
published for the hour competes on the same terms.
Parts. Many centres send an ascent as the parts of a TEMP, or as its
two halves: A the standard levels and their heights up to 100 hPa (or the
whole ascent that far), B the significant levels of the same reach, C and
D the same two above it. They come under headings that do not say which
they are, some in IUK and some in IUS bulletins, so a part is told by
its levels: none above 100 hPa is A or B, none below it C or D, and of
each pair the one that reports a height on a level other than the surface
is A or C.
The parts of one station and nominal time, whatever source they came by,
are merged, and the merged ascent competes with the others; it wins only
with more temperatures or, at as many, more levels. Of each part the
best by the rule above counts. B is left out when A reports a height off
the standard surfaces, since A is then the full ascent to 100 hPa. A part
whose launch clock is more than 30 minutes from the lowest part’s is of
another flight and is left out, unless either clock is the nominal hour
itself, which is a converter’s stand-in. The levels are laid on one pressure axis,
where two at one pressure become one by the rule of §2, A first.
reported is the merged count plus what the parts’ own thinning dropped,
and bulletin names every part’s, joined by +.
In any sounding, a level under the surface level with no temperature, dew point or wind on it is left out: A gives every standard surface down to 1000 hPa a height, those under the ground included.
The parts go out over an hour and a half, across issues. A part that arrives later is merged onto what the previous issue published, where that was a part or was itself merged. C and D with neither A nor B are no ascent and are not published.
The United States’ node names each part’s object, TEMP_AA_<wmo>_… to
TEMP_DD_<wmo>_…. Part D’s pressures are tenths of a hectopascal in the
text, and it writes them as whole hectopascals, ten times too
large. A part D holding any pressure above 100 hPa, which none can have
measured, is read with every pressure divided by ten; one that holds none
is taken as it is.
4. index.json
The shape — every field, its type and range — is
schemas/sounding-index.schema.json;
the pointer’s is schemas/pointer.schema.json.
This section says what the fields mean and the rules across them.
issuedis the aggregation hour,generatedwhen the build ran.watermarkis per source: the newest object modification time that source’s listing held when the issue was built, which is where the next hour’s fetch starts.nullmeans the source has never been listed successfully. It is published because it is the product’s own account of how current it is; a reader may ignore it.soundingsdescribes the file beside the index:pathis alwayssoundings.jsonl,byteLengthits length andcrc32the zlib CRC32 of its bytes, which is its?v=.stations[]is sorted byid, and so issoundings.jsonl.offsetandlengthare the byte span of that station’s object in the file, excluding the newline after it. The spans are strictly increasing, do not overlap, and tile the file exactly:Σ(length + 1) == byteLength.lat,lonandelevcome from the newest sounding.elevis metres above mean sea level, the first of three heights the subset may carry, in this order: the ground under the station (heightOfStationGroundAboveMeanSeaLevel), the BUFR height of station (height), the barometer’s height;nullwhen the bulletin gives none.nameis the station’s name (§3, Names),nullwhen it has none.latestis the newest nominal time and equalstimes[0];timeslists the nominal times the station’s line carries, newest first, at most four.headlinesummarises the newest sounding for a marker layer that has not fetched the soundings file:t500andtd500are the 500 hPa temperature and dew point in °C to a tenth (nullwhen that level is absent),freezingLevelandpwrepeat the derived values (§7), andlevelsis that sounding’sn.sources[]is the build’s account of its sources (§6).
A station whose newest sounding is more than 48 hours older than the issue hour is not carried forward any further: it has stopped reporting, or its identifier has changed.
5. soundings.jsonl
Each line’s shape is schemas/sounding-line.schema.json.
One line per station, sorted by station id, each line the compact JSON
object below followed by \n. It carries no schemaVersion and no
sources: the index it hangs off has both, and repeating them once per
station would cost more than the stations do.
soundings is in strictly decreasing time, newest first, and holds at
most four nominal times — two days of the twice-daily cycle. Each hour’s
build merges what arrived into what the previous issue published for the
station, under the same rule §3 gives: for one nominal time, the most
levels wins, then the latest arrival. A station with nothing new this hour
is carried forward from the previous issue’s file, its line re-encoded
unchanged; the file around it is rewritten every hour, which at this size
costs nothing worth saving. A part C or D an earlier issue published alone
is the exception: it is not carried forward.
bulletin is the WMO abbreviated heading of the bulletin the sounding was
decoded from, verbatim, and arrived the gateway’s own timestamp for it.
A national node’s object has no heading: bulletin is its object name
(WIGOS_0-20000-0-82022_20261104T233000.bufr4) and arrived its
LastModified; a Météo-France sounding’s bulletin is its file name
(07145.2026111100.json) and arrived the modification time its
directory index gives. An ascent merged from its parts (§3) has the parts'
object names in bulletin, in the order A to D with a space between, and
the latest of their times in arrived.
Together they say exactly which message a value came from.
Size. Measured over one issue of the live feed, 491 stations: the
newest ascent held a median of 504 reported levels and a maximum of 7 553,
of which the thinning rule (§2) publishes a median of 169 and a maximum of
383 — 9.7 % of the samples. The median station line is 23 KB and the
largest 46 KB; the issue is 10.6 MB behind a 160 KB index, in two objects.
A client that wants a marker layer reads the index alone; opening one
station costs one range request of its length.
6. sources[]
One entry per source the build was asked for, in build order:
ok: false always carries error. listed is how many objects the
source’s listing held, objects how many were downloaded (the ones newer
than the previous watermark), reused how many were carried over from the
previous issue’s download instead, failed how many the cache would not
serve, bytes how many bytes the objects held, bulletins how many
decoded, nil how many were plain-text NIL bulletins, descents how
many were descent profiles (§3) and left out, unreadable how
many did not decode, subsets how many station subsets they held,
dropped how many of those carried no usable station identity and
soundings how many soundings the source contributed. The list lives in the index alone: a station’s line does not
repeat it, so it always describes the issue the reader is holding, even
for a station whose soundings were carried forward from an earlier one.
A source’s watermark only advances when its bulletins were read. A
listing that failed, and a download not one bulletin of which decoded,
both leave the previous hour’s watermark in place, so the next hour sees
those objects again rather than stepping past them for good.
Source ids are of four kinds. The first two are directories of the WMO WIS2 Global Cache, a public bucket that lists without credentials.
- The two GTS→WIS2 gateways, which keep an object for 24 hours:
jp-jma-gts-to-wis2(run by the Japan Meteorological Agency) andde-dwd-gts-to-wis2(run by the Deutscher Wetterdienst). Each republishes every country’s GTS bulletins under the WMO abbreviated heading tree, and the two carry different sets, which is why both are read. Two branches of the tree are:I/U/S/, andI/U/K/, the soundings up to 100 hPa, where the lower halves are. wis2:<centre>, a national WIS2 node’s TEMP topic,data/<centre>/data/core/weather/surface-based-observations/temp/. A centre that runs its own node stops sending its soundings to the gateways, so these are read too. The nodes are discovered every hour by listing the cache’sdata/(the gateways and the discovery catalogues excepted), and a node whose topic is empty is not a source of that issue: it has no entry insources[], and itswatermarkentry, once it has one, is kept. A node with no watermark is taken back 48 hours, the staleness limit, since its objects outlive the gateways’ day. Objects named as the parts of a TEMP (§3) modified in the last four hours are taken again behind the watermark, so that a part sent before the lower ones is there to be merged. A discovery that fails is the one entrywis2, withok: false.meteofrance, Météo-France’s own radiosonde files on data.gouv.fr (datasetradiosondages),https://files.data.gouv.fr/meteofrance/data/OBS/RS/<YYYY>/<MM>/<DD>/<wmo>.<YYYYMMDDHH>.json: every ascent of its fifteen stations, mainland France, overseas and the TAAF, at full resolution with no significance flags (§2). The days the last 48 hours touch are listed each hour from their directory index, and the files are kept for good, so the watermark is trusted however old it is. Files go out in two batches a day, at about 01:40 and 13:40 UTC.nws-tgftp, TEMP as text (FM 35) from the US National Weather Service’s gateway,https://tgftp.nws.noaa.gov/data/raw/: the parts A to D of Canada’s and India’s stations underus/,uk/,ul/andue/. Canada’s WIS2 node publishes no TEMP and India’s a part of its stations. A heading has one file there, overwritten by its next bulletin, so the parts modified in the last four hours are taken again behind the watermark.
The text form holds less than the BUFR, and is published so:
- Each report is a part (§3, Parts), with the flags of its levels: the surface, the standard surfaces, the tropopauses and the levels of maximum wind in A and C, the significant temperatures and winds in B and D. Pressures are whole hectopascals (tenths in C and D), dew-point depressions whole degrees above 5 °C, directions multiples of 5°.
- Heights are the standard surfaces’ alone, in tens of metres from 500 hPa up, and the surface’s, which is the station’s elevation.
- It is filed by the report’s own day and hour, by the rule a node’s clock
is; one later than the file’s modification time is mistyped, and the
heading’s is taken.
launchedandsondeTypearenull. - A report has no position. It comes with the elevation from
xuebuild/sounding/positions.json, from the same IGRA2 list as the names, except for the stations itsbulletinslists, whose own BUFR gave it. A station that is not there is counted indropped. - A part is read up to the first level out of order (a height below the one
under it, a pressure above), and a part A with fewer than four
temperatures is no ascent and is counted in
dropped.
bulletin is the report’s heading (USCN01 CYEV 250000), and arrived
the file’s modification time, to the minute.
The data is WMO core data under the WMO Unified Data Policy: free and
unrestricted, with attribution of the original source requested. The
originating national meteorological and hydrological services are the
source of every sounding; the WIS2 Global Cache, its two gateways and the
national nodes are the distribution. Météo-France’s files are published
by Météo-France under the Licence Ouverte 2.0 (Etalab), which asks that
the source and the date of its last update be named: a sounding whose
gateway is meteofrance is Météo-France’s, and its arrived is that
date. The text bulletins are of the GTS, distributed by the US National
Weather Service. Station names (§3) and the positions of the text bulletins'
stations are from the Integrated Global Radiosonde
Archive (IGRA) version 2 station list, NOAA National Centers for
Environmental Information, a US Government work in the public domain.
7. Derived quantities
derived holds four numbers computed from the published levels — not from
the BUFR floats — in a fixed operation order, so a second implementation
reading <station>.json reproduces them exactly. Heights are rounded to
whole geopotential metres, the other two to a tenth. Any of them is null
when the sounding does not support it.
A derived height is a published z, interpolated or picked out, so it
carries z’s range and may be negative: stations below sea level report
negative geopotential heights, and a bulletin that flags a tropopause at
one is reporting a bad height rather than breaking the contract. A reader
sanity-checks derived values; the product does not silently drop them.
freezingLevel (gpm). Walking up from the surface, the first pair of
consecutive levels that both carry a temperature and a height and that
straddle 273.15 K with the lower one at or above it. The height is linear
in temperature across that pair:
z = z_lower + (273.15 − t_lower) / (t_upper − t_lower) × (z_upper − z_lower).
null when the lowest level with a temperature is already below freezing
(there is no warm layer to leave) or when the profile never crosses.
pw (mm). The depth of the water-vapour column. Only levels carrying
both a pressure and a dew point take part, in descending pressure, up to
the last one at or above 300 hPa; the integral is not extrapolated to
exactly 300 hPa, so a sounding that stops early reports what it measured.
Per level, with p in hPa and the dew point in °C:
and the column is the trapezoidal integral of q over pressure in
pascals, summed from the surface upwards, divided by standard gravity
9.80665 m/s². null when fewer than two levels qualify. (Worked example:
two levels at 1000 and 900 hPa with a 10 °C dew point give e =
12.271696 hPa, q = 0.00766857 and 0.00852504, and pw = 8.3 mm.)
lapse850_500 (K/km, positive when the temperature falls with
height). (t850 − t500) / ((z500 − z850) / 1000), where the 850 and
500 hPa levels are levels the sounding actually reports, within one
hectopascal of their nominal pressure, each carrying a temperature and a
height. The product never interpolates a standard level that was not
reported, so null here means the ascent did not report one of them — a
high station whose surface is above 850 hPa, or a bulletin that carries
only significant levels.
tropopause (gpm). The height of the first level, in descending
pressure, whose sig has bit 3 (32768) set and which carries a height.
A sounding may flag a secondary tropopause above the first; the lowest is
published. null when no level is flagged (Météo-France’s ascents
never are), or when the flagged level reports no height — which several
centres’ bulletins do.
8. Validation
The JSON Schemas of §4 and §5 are normative for shape: a file that does
not match them is not a sounding file. tests/test_schemas.py holds
the committed golden (tests/fixtures/sounding/expected/, a build from the
fetched fixture tests/fixtures/sounding/sounding.2026091402/ by
tests/prepare_sounding_golden.py) to them, and the shell’s validators
are generated from them (web/src/schema/generated/).
xuebuild/sounding/schema.py validates every file as it is written, and
tests/test_sounding.py holds the build to the golden. A reader rejects a
schemaVersion above the one it implements.
Admission is structural, in the posture the manifests take: a station
identifier the reader has never seen, a radiosonde type code it does not
know and a source id that is not one of today’s two are all admitted. What
is checked is shape — the id pattern, coordinate ranges, the level
arrays’ ranges, timestamps in UTC, CRC32s, which the schemas carry — and
what a schema cannot say: the soundings descriptor’s name, the stations
sorted and unique, every level array n long, reported at least n,
pressure strictly descending, the times newest first with latest the
first of them, and the stations’ byte spans: in order, not overlapping,
and tiling soundings.jsonl exactly. Every line is validated
as it is written, so a span the index advertises always slices out
something that parses.
Part of the Xue specification, licensed under CC BY 4.0.
12 - The synop product
In the viewer: the stations over the map with ?stations=syn (/gfs?type=temp&stations=syn), and the nearest station’s record on a pinned point’s temperature, wind and pressure rows.
A weather station’s record is a short table of numbers every ten minutes
to every hour. A national network is a few hundred to a few thousand such
stations, a few megabytes a day — not a raster — so surface stations are a
point product published beside the runs, the airports (docs/airport.md)
and the soundings (docs/sounding.md). synop is the name for surface
weather observations in general, not only the WMO FM-12 SYNOP code: each
national network enters through an adapter that reads it into one set of
elements and SI units, and the product carries every network in the same
shape. The networks are aggregated every ten minutes by xue synop-build
(xuebuild/synop/) and taken live by the same pointer → immutable
directory contract the other point products use. This document is the
normative description of that product, index schema v2.
1. Delivery
Everything is a static file under the data root, beside the run pointers and the other point products’ pointers.
latest-synop.jsonis the one mutable object. Request it withCache-Control: no-cache(in a browser,fetch(url, {cache: "no-cache"})): without it a browser cache may answer with a pointer up to four hours old. It names the newest round’s directory and the index inside it:pathis relative to the pointer and alwayssynop/<YYYY>/<MM>/<DD>/synop.<round>/index.json, the date being the round’s. A pointer written before that layout names the flatsynop.<round>/index.json, and a reader accepts both.byteLengthandcrc32(zlib CRC32 of the file’s bytes, eight lowercase hex digits) are the index’s, so it can be requested as<path>?v=<crc32>through an immutable cache. The pointer’sschemaVersionis its own and stays 1; the index’s is §4’s.synop/<YYYY>/<MM>/<DD>/synop.<YYYYMMDDHHMM>/is one immutable directory per round, filed under its UTC day so the data root does not carry a prefix per round: the UTC minute the product was aggregated at, always a multiple of ten. It holdsindex.json(§4), per network a<network>.stations.json(§5) and a<network>.jsonl(§6), anditem.json, the round’s STAC Item (docs/stac.md§“Point products”). Nothing in it changes once the pointer names it. Each round carries the whole window and lives three hours (make prune-r2-synop,SYNOP_KEEP=18).Paths inside
index.jsonare file names beside it; request each as<name>?v=<crc32>with the CRC the index carries.
Three ways to read a network:
- A map. Fetch the index, then the stations file of each network to be shown: every station’s position and current values, a few hundred kilobytes for a thousand stations.
- One station. Take the station’s row in its network’s stations file,
which ends in the byte
offsetandlengthof its line in the network’s.jsonl, and issueGET <round directory>/<network>.jsonl?v=<crc32>withRange: bytes=<offset>-<offset + length - 1>. The bytes are that station’s JSON object exactly, without the newline, so they parse on their own. - A whole network. Fetch
<network>.jsonland read it line by line: one station per line, sorted by id.
The publisher builds every ten minutes (publish-synop.yml). Each network
is asked for what it holds after its newest time in the previous round’s
index, so a network that was unreachable catches up, on its next answer,
as far back as its own retention reaches. A network that fails is recorded
(§7) and keeps its history; the round publishes with the rest. The pointer
is withheld only when no network’s observations arrived, in which case
the previous round stays live. A round the pointer already names is
finished; the workflow’s force input is the manual rebuild.
Upload order is every <network>.jsonl, then every
<network>.stations.json, then index.json and item.json, and the
pointer last, once R2 reports the size of every file (make upload-r2-synop). make live-synop-index pulls the live index and both
files of every network, checking each against the CRC32 the index states.
Deployment is one-sided: the product is new files under a new pointer, so
a shell that does not know it never asks for it. A new network is a new
entry in the index and two new files, which a reader of this schema admits
(§8); an index schemaVersion bump follows the runs’ rule (ship the
shell first).
2. Elements and units
Every network is converted to one table of elements, SI throughout, at
the adapter. The index lists them in this order (elements):
| key | quantity | unit | type |
|---|---|---|---|
t | air temperature | °C, to a tenth | number, −100 … 70 |
td | dew point | °C, to a tenth | number, −100 … 60 |
rh | relative humidity | % | integer, 0 … 100 |
p | station pressure | hPa, to a tenth | number, 300 … 1100 |
slp | sea-level pressure | hPa, to a tenth | number, 800 … 1100 |
wd | wind direction | degrees true | integer, 0 … 360; null when calm or variable |
ws | mean wind speed | m/s, to a tenth | number, 0 … 150 |
gust | gust | m/s, to a tenth | number, 0 … 150 |
pr | precipitation over the network’s prPeriod ending at the time | mm, to a tenth | number, 0 … 1000 |
pr1h | precipitation over the hour ending at the time | mm, to a tenth | number, 0 … 1000 |
sun | sunshine over the network’s prPeriod ending at the time | minutes | number, 0 … 60 |
snow | snow depth | cm | integer, 0 … 2000 |
vis | visibility | metres | integer, ≥ 0; each network’s ceiling in §9 |
tide | water level at a tide gauge, above the network’s chart datum | m, to a hundredth | number, −2 … 20 |
- A network publishes the elements it measures and leaves the others
null; nothing is derived — no dew point from temperature and humidity, no humidity from dew point, no sea-level reduction. Observations only.tdappears where the network reports a dew point. wd: 0never occurs; north is360. Withws: 0,wdisnull.prandsunare totals over the period the network reports at, which is the network’sprPeriodin seconds (§4);pr1his the network’s own hourly total, published where the network states one, because adding up shorter periods across a gap would understate it.- A value the network marks as doubtful, missing or suspended, or one
outside the range above, is
null. So is a snow depth the network codes as negative (BUFR’s −0.01 m “a little” and −0.02 m “patchy” are not depths). Each network’s section (§9) says which of its quality flags are kept. tideis the height of the sea surface at a tide gauge above the chart datum the network states (§9) — the zero of its tide tables and nautical charts, near the lowest astronomical tide — not above mean sea level and not a surge residual: the astronomical tide is in it. Datums differ between networks, so two networks’ values are not comparable without the offsets §9 gives. The range admits the largest tidal ranges on Earth above such a datum.- Times in the network files are epoch seconds, UTC; times in the
index and the stations files are ISO 8601 UTC with a
Zsuffix. - Positions are decimal degrees to four places;
elevis metres above sea level of the ground at the station, from the network’s station table, ornull.
The index carries this table as elementTable (§4), so a reader need
not hard-code it.
The files are written compactly with ASCII escaping, and a file’s identity
is its bytes: the CRC32 in the index, and the pointer’s, is of the file
exactly as served. Given the same inputs a round is byte-identical; only
the index’s generated, the sources’ fetched and the builder’s
revision depend on when and from what the build ran.
3. Identity
A station is <network>:<the network's own station identifier>
(amedas:50066 is Mt. Fuji). The network id is lowercase,
^[a-z][a-z0-9]*(-[a-z0-9]+)*$; the station part is the network’s own
identifier, unchanged, of the characters [0-9A-Za-z_.-]. The id is the
key everywhere: the stations files’ rows are sorted by it, each network
file’s lines are sorted by it, and every line repeats it as id so a
slice read by range identifies itself. A WMO station number, where the
network gives one, is carried as wmo but is not the key — most
national-network stations have none.
4. index.json
The shape — every field, its type and range — is
schemas/synop-index.schema.json (v1,
§8: schemas/synop-index-v1.schema.json);
the pointer’s is schemas/pointer.schema.json.
This section says what the fields mean and the rules across them.
issuedis the round,generatedwhen the build ran.networks[]is one entry per network that has a station in the window, in the publisher’s order (amedas,dwd,hko): its id and displayname;cadence, the seconds between a station’s reports;prPeriod, the secondsprandsunaccumulate over (ornull);wsPeriod(optional), the secondswsandwdare means over; theattributiona display must show, thelicensethe network’s data is reused under,licenseUrl(optional), the terms page that licence string names (§9), and the network’surl;latest, the newest observation time in the network’s files;file, the network file’s name (always<id>.jsonl), length and CRC32; andstations, the stations file’s name (always<id>.stations.json), length, CRC32 andcount, the number of rows in it.elementsis the element order of the stations files’ rows. It is authoritative: each stations file repeats it and must be equal.elementTable(optional) describes each ofelements, one entry per element in the same order:unit, the unit of §2’s table;cell, how the value stands for its time —point(an instantaneous reading),mean,sum,maxormin; andperiod, the seconds the value covers, ending at its time — a number,"network"where it is the network entry’s field (wsPeriodforwsandwd,prPeriodforprandsun), ornullfor an instantaneous value.gustis themaxof a window that varies by network and report (§9), so itsperiodisnull. A reader that finds no entry for an element falls back to §2.sources[]is §7.builder(optional) names the code that built the round:{"name": "xuebuild", "revision": <commit hash or null>}. The publisher sets the commit (XUE_BUILD_REVISION); an offline build leaves itnull.
The index carries no stations: a map reads the stations files of the networks it shows.
5. <network>.stations.json
The shape is schemas/synop-stations.schema.json.
schemaVersion,issuedandelementsare the index’s;networkis the network’s id.columnsnames the rows’ columns, and a reader finds a column by its name there. In v2 it is always the layout below — the seven leading columns, theelementsin their order, thenoffsetandlength— so a reader that indexes by position reads it too. It is optional: rounds published before it (every synop round up to 2026-11-04) do not carry it, and a reader takes such a file’s rows in the layout below.stations[]is one compact row per station of the network, sorted by id and unique, as many as the index’sstations.count:0 1 2 3 4 5 6 7 … last two idlatlonelevranknameobsTimeone value per elementsoffset,lengthEvery id’s prefix is the file’s network.
rankis how prominent the station is, which a map thins by:0a principal station (a staffed office, a summit, a remote island, a WMO station),1a multi-element automatic station,2a single-purpose gauge: one that measures precipitation alone, or the tide alone.nameis the station’s name in Latin script, ornull.obsTimeis the station’s newest time. The element values are the station’s current values: for each element, its newest non-null value no more than an hour beforeobsTime— some elements arrive less often than the station reports (AMeDAS sends Mt. Fuji’s humidity and pressure on the hour only) — except thatprandsun, which are totals over a period ending at their time, are only ever taken atobsTime, andpr1h, a rolling hour, no more than 20 minutes before it (a network may stamp its rain gauges on another beat than its other sensors, §9.3).offsetandlengthare the byte span of the station’s line in<network>.jsonl, the JSON object alone; the spans are in row order, do not overlap, and lie inside that file’sbyteLength.
6. <network>.jsonl
Each line’s shape is schemas/synop-line.schema.json,
in v1 and v2 alike. One line per station of that network, sorted by id, each the compact JSON
object below followed by \n:
namesmaps BCP 47 language tags to the network’s own spellings; a display picks the viewer’s language and falls back toname.timeis the station’s window, oldest first: every time in the last 24 hours before the round at which the station reported anything.obsholds one array per element the station reported at least once in the window, each as long astime,nullwhere that element was not reported at that time. An element the station never reported in the window is absent, and reads as allnull.wigos(optional) is the station’s WIGOS identifier (<series>-<issuer>-<issue number>-<local identifier>), present where the network’s reports state one (dwd, §9.2). It is not the key (§3).qc(optional) carries the network’s own quality code of each value, for a network that has them (amedas, §9.1): per element an array as long astime, the code as the network gives it,nullwhere there was no reading.obskeeps its rule — a value whose code the network says is not good isnullthere (§2) — andqcsays why. A column is written only where it says more thanobsdoes: an element without one had code 0 wherever its value is notnulland no reading where it is, and a line with nothing to add has noqc. An element can have aqccolumn and noobscolumn (suspended all day).
A station’s window is a merge, not a snapshot. Each round lays the
network’s new observations over the previous round’s file keyed by
(station, time) — a network that revises a value is believed — and drops
what is older than 24 hours before the round. For most networks a new
report replaces the old one at that time whole. A network whose report
for one time arrives in pieces — several messages, several files, several
rounds (dwd, hko) — is merged element by element instead: a value the
new piece carries replaces the old one, and an element it leaves out keeps
what an earlier piece said. A station that did not report keeps its
history; one with nothing left in the window leaves the files until it
reports again. Station metadata comes from the network’s current table
each round (for dwd, the reports themselves). A network with no station
left is not listed.
7. sources[]
One entry per source, every network’s in turn, in build order:
sha256 (optional) is the SHA-256, lowercase hex, of the raw bytes the
build read from the source, file after file in the order they were
fetched, so a round can be traced to its input; it is absent when the
source contributed no bytes. ok: false always carries error. reports is what the source
contributed — observations read (one per station and time), stations in a
table. files is how many files were read, missing how many were gone
when asked for, unplaced how many reports named no station the network
can place. A network’s own fields are described in its section.
8. Validation and versions
The JSON Schemas of §4–§6 are normative for shape: a file that does not
match them is not a synop file. tests/test_schemas.py holds the
committed golden (tests/fixtures/synop/expected/, two consecutive rounds
built from the fetched fixture tests/fixtures/synop/synop.202610050000/
and …0010/, the raw rounds, which stay flat under the raw root, by
tests/prepare_synop_golden.py) and the v1 rounds of
tests/fixtures/synop/v1/ to them, and the shell’s validators are
generated from them (web/src/schema/generated/).
xuebuild/synop/schema.py validates every file as it is written, and
tests/test_synop.py holds the build to the golden and checks every
stations-file row’s span against the network file it addresses. What a
schema cannot say is each reader’s own check: file names, unique networks
and elements, the element table in the elements’ order, a stations
file’s network, issued, elements and columns against its index,
its row width and count, rows sorted under the network’s prefix, each
element of §2 in its range in a row (a line’s obs carries the ranges in
its schema), the spans in row order inside the network file, and a line’s
strictly increasing time with every obs and qc array as long.
Admission is structural: a network, a station or an element key a reader
has never seen is not an error — the row width follows the elements
list. A reader rejects an index schemaVersion above the one it
implements.
Schema v1, the first, kept every station in the index: an index
stations[] of rows [id, network, lat, lon, elev, rank, name, obsTime, …values, offset, length], network being the position in networks[],
and no stations block in a network entry; its elements had no td.
The network files were the same. Readers keep reading v1 — the live round
at the switch is one, and the first v2 round merges onto its network
files.
9. Networks
9.1 amedas — JMA AMeDAS
The Japan Meteorological Agency’s Automated Meteorological Data
Acquisition System: about 1 300 stations over Japan and its islands, every
ten minutes. cadence, prPeriod and wsPeriod (wind is the
ten-minute mean) are 600.
Source. The JSON the agency’s own AMeDAS map page reads; there is no published API and no service commitment.
jma-amedas-table—https://www.jma.go.jp/bosai/amedas/const/amedastable.json, the station table (position in degrees and minutes, altitude, type, names in kanji, kana and English), fetched at most once a day withIf-Modified-Since. A failure over a copy already on disk staysokwith the error noted.jma-amedas-map—https://www.jma.go.jp/bosai/amedas/data/latest_time.txtfor the newest time, thendata/map/<YYYYMMDDHHmm>00.json(a JST minute) for every ten-minute time after the network’s previouslatest, at most the 144 times of the window and none after the round. The agency keeps about seven days of these.snapshotsis how many were read,missinghow many were already gone (HTTP 404).
Reading. Each value arrives as [value, quality]. A value is kept when
its quality is 0 (normal) or 1 (quasi-normal) and it is not null — the
agency’s own page’s rule; 2–4 (insufficient data), 5 (suspended) and 6
(missing) become null. Each line’s qc (§6) carries these codes as
they arrive, per element, for the key below that element is read from:
0 normal, 1 quasi-normal, 2–4 insufficient data, 5 suspended, 6 missing;
a code outside 0–255 or not an integer is null. The elements:
| AMeDAS key | element | conversion |
|---|---|---|
temp | t | — |
humidity | rh | — |
pressure | p | — |
normalPressure | slp | — |
windDirection | wd | 16-point code × 22.5, rounded half up; code 0 (静穏, calm) is null |
wind | ws | — |
precipitation10m | pr | — |
precipitation1h | pr1h | — |
sun10m | sun | minutes |
snow | snow | — |
visibility | vis | metres |
td and gust are not in the snapshots and stay null. vis reaches
20 000 m and no further in the snapshots examined: read 20 000 as
“20 km or more”. The hourly
snapshot (on the hour) carries more than the others: several stations,
Mt. Fuji among them, report humidity and pressure only then, and snow
depth and the present-weather code appear only then (the weather code is
not published).
Station identity: amedas:<the five-digit AMeDAS number>; name is the
table’s English name, names its kanji (ja) and kana (ja-Kana).
rank is 0 for the table’s types A, B, D, E, F and G (staffed offices,
special stations, and single sites such as Mt. Fuji and Minamitorishima),
2 for a type-C station whose element mask has neither temperature nor
wind (a precipitation gauge), and 1 otherwise. A snapshot entry for a
station the table does not list is dropped.
Terms. The agency’s website content is reusable, commercially included,
under the Public Data License v1.0 (the licenseUrl below) with the source credited —
「出典:気象庁ホームページ」 — and, for edited content, a statement that it
was edited; it must not be presented as the agency’s own publication
(https://www.jma.go.jp/jma/kishou/info/coment.html). The attribution
string carries the credit, and a display shows it with the data.
9.2 dwd — Deutscher Wetterdienst national SYNOP
Deutscher Wetterdienst’s national ten-minute SYNOP reports in BUFR: about
1 000 German stations — some 220 WMO stations, about 300 national stations
with the full set of elements and about 470 that measure precipitation
alone. cadence, prPeriod and wsPeriod are 600 (ws and wd are
the −10 min means). The network is partial (§6).
Source. dwd-synop-bufr —
https://opendata.dwd.de/weather/weather_reports/synoptic/germany/, a
directory of BUFR batches named
Z__C_EDZW_<yyyymmddHHMMSS>_bda01,synop_bufr_GER_999999_999999__MW_<seq>.bin,
about eight an hour, kept about 48 hours (a …_latest_…MW_XXX.bin copy of
the newest batch is not read). The sequence number cannot be predicted, so
each round reads the directory page and fetches every batch stamped after
the network’s previous latest and not after the round — at most the
24-hour window. A batch holds nothing newer than its stamp, so everything
new is in these, and values for older times that arrive late arrive in
later batches. files is how many batches were read, missing how many
were gone between the listing and the request. The batches are decoded
with eccodes’ bufr_dump -j f.
Arrival. A batch mixes observation times and templates: ten-minute values come in half-hourly batches 20–35 minutes late; the batch on the hour (~700 KB) adds an hourly SYNOP template for the WMO stations and an hourly national template; the half-hour batch adds a thirty-minute summary. One station at one time is therefore spread over several subsets, in different batches and different rounds — the reason the network is merged element by element. Within a round, the subsets of one station and time are merged the same way; where two carry the same element, the gust over the shorter period wins, then the ten-minute MOR over the observer’s visibility, then the later subset.
Reading. Values are picked by their BUFR key and the timePeriod or
sensor height the template states before them, never by position in a
template:
| BUFR key | condition | element | conversion |
|---|---|---|---|
airTemperature | sensor ≥ 1 m above ground (the 5 cm one is the grass minimum) | t | K − 273.15 |
dewpointTemperature | sensor ≥ 1 m | td | K − 273.15 |
relativeHumidity | — | rh | rounded half up |
nonCoordinatePressure | — | p | Pa / 100 |
pressureReducedToMeanSeaLevel | — | slp | Pa / 100 |
windSpeed, windDirection | timePeriod −10 min | ws, wd | direction 0 (calm) and any direction at ws 0 are null |
maximumWindGustSpeed | the shortest timePeriod given, up to −60 min | gust | m/s |
totalPrecipitationOrTotalWaterEquivalent | timePeriod −10 min | pr | kg m⁻² = mm |
totalPrecipitationOrTotalWaterEquivalent | timePeriod −60 min (or −1 h) | pr1h | mm |
sunshineOverPeriodSpecified | timePeriod −10 min | sun | minutes |
totalSnowDepth | — | snow | m × 100; negative codes null |
meteorologicalOpticalRange | — | vis | m (DWD’s ten-minute MOR); the largest value in the batches examined is 75 000 |
horizontalVisibility | when no MOR | vis | m (the hourly SYNOP template) |
The one-minute precipitation series, the 3, 6, 12 and 24-hour totals and
the hourly and daily sunshine are not elements. pr1h is the hourly
batch’s own one-hour total: the hourly national template states it
(timePeriod −60 min; 921 stations in the 2026-10-31 14:00 batch), while
the ten-minute template carries none and the WMO SYNOP template’s own
one-hour total was empty in the batches examined. Nothing is summed.
Quality. The reports carry no quality flags: a missing value is null,
and a value outside its §2 range is null. A subset that names no station
or no time — the NIL reports of stations that sent nothing — is counted
in unplaced and dropped.
Station identity: dwd:<DWD's station identifier>, the Kennung column
of DWD’s station list
(https://opendata.dwd.de/weather/weather_reports/stationlist_synoptic_germany.csv).
The BUFR carries it as shortStationName for a national station (WIGOS
0-276-<n>-<local>, e.g. dwd:M031, Ellrich-Werna) and as the WMO block
and station number for a WMO station (WIGOS 0-20000-0-<wmo>, e.g.
dwd:10393, Lindenberg) and for the few national stations DWD numbers in
the WMO style (dwd:10271, Neuruppin, WIGOS 0-276-2-96); checked
against the station list on 2026-10-31. wmo is the block and station
number where the BUFR carries one, and wigos the WIGOS identifier its
3 01 150 sequence states (wigosIdentifierSeries,
wigosIssuerOfIdentifier, wigosIssueNumber,
wigosLocalIdentifierCharacter), as given. Position, elevation (ground) and
name (stationOrSiteName) come from the newest subset that places the
station; names is null. rank is 0 for a station with a WMO number,
2 for one whose reports in the round were precipitation and nothing else,
1 otherwise.
Terms. DWD’s open data is licensed under CC BY 4.0
(https://www.dwd.de/copyright, the licenseUrl); the source is credited as
“Source: Deutscher Wetterdienst”
(https://www.dwd.de/EN/service/legal_notice/templates_dwd_as_source.html),
which is the attribution string.
9.3 hko — Hong Kong Observatory
The Hong Kong Observatory’s regional weather — about fifty manned,
automatic, buoy and wind stations every ten minutes — with the hourly
rainfall of its automatic weather stations and the water level of the
tide gauges around Hong Kong. cadence is 600; wsPeriod is 600 (the
ten-minute mean wind); prPeriod is null: there is no pr, and
rainfall is pr1h alone. The network is partial (§6): each element
comes from its own file, and the files of one round need not name the
same minute — the rainfall is stamped on the quarter hour and the tide on
five minutes, so a station’s rainfall and its regional readings usually
sit at different times of its line.
Source. Three sources, each its own entry of §7 so that one failing does
not take the others with it. files is how many of a source’s files were
read. Only the latest reading of each is served, so there is no backfill:
a round that does not run loses that time for good.
hko-regional-weather— five CSVs under https://data.weather.gov.hk/weatherAPI/hko_data/regional-weather/:latest_1min_temperature.csv,latest_1min_humidity.csv,latest_1min_pressure.csv,latest_10min_wind.csvandlatest_10min_visibility.csv, each row a time (HKT,YYYYMMDDHHMM), a station name and the values.hko-hourly-rainfall— https://data.weather.gov.hk/weatherAPI/opendata/hourlyRainfall.php?lang=en, the open-data API’s “rainfall in the past hour from automatic weather station” (renewed every fifteen minutes): oneobsTime(ISO 8601 with+08:00) and per station its name, an identifier local to this dataset (RF001…, or a GEO raingauge number such asN12), the value and the unit (mm). The value is the total over the hour ending atobsTime, in whole millimetres, orMwhile the system is under maintenance. The Observatory calls the data provisional, with limited validation, and notes that its own station’s figure here is not its official rainfall.hko-tide— https://data.weather.gov.hk/weatherAPI/hko_data/tide/ALL_en.csv, the latest five-minute water level of each tide gauge (UTF-8 with a byte order mark):Tide Station,Date,Time,Height(m), date and time HKT (2026-11-12,20:35), the height in metres to a centimetre, or dashes when there is none. The gauges are the Observatory’s (Quarry Bay, Shek Pik, Tsim Bei Tsui, Tai Miu Wan, Tai Po Kau, Waglan Island) and the Drainage Services Department’s at Tai O; the Observatory states that the real-time tide data are not quality-controlled.
Reading. Missing values are N/A or empty in the regional CSVs, M in
the rainfall and dashes in the tide file. There are no quality flags.
| file | field | element | conversion |
|---|---|---|---|
| regional | Air Temperature (°C) | t | — |
| regional | Relative Humidity (%) | rh | — |
| regional | Mean Sea Level Pressure (hPa) | slp | — (no station pressure: p stays null) |
| regional | 10-Minute Mean Wind Direction | wd | eight compass points, North = 360, Northeast = 45, …; Calm and Variable have no direction |
| regional | 10-Minute Mean Speed (km/h) | ws | ÷ 3.6; Calm is 0 |
| regional | 10-Minute Maximum Gust (km/h) | gust | ÷ 3.6 |
| regional | 10 minute mean visibility | vis | 18 km → 18000; whole kilometres, no ceiling stated (35 km is the largest in the fixture) |
| rainfall | value at obsTime | pr1h | mm, as given |
| tide | Height(m) | tide | m above Hong Kong Chart Datum, as given |
The tide file’s heights are “in metre (m) above the Chart Datum, which is
0.146 m below the Hong Kong Principal Datum” (the file layout,
https://data.weather.gov.hk/weatherAPI/hko_data/tide/File_layout_for_latest_tides_en.pdf);
the Observatory’s real-time tide page labels the same values “metres above
Chart Datum (mCD)”. The Observatory gives the 1995–2014 average annual
mean sea level at Quarry Bay as 1.45 m above Hong Kong Chart Datum
(https://www.hko.gov.hk/en/climate_change/proj_hk_msl_med_conf_info.htm),
so a tide there of about 1.45 is mean sea level.
Stations. None of the files carries a station number or a position, so
positions come from xuebuild/synop/hko_stations.json, built (2026-10-31)
from the Observatory’s station page https://www.hko.gov.hk/en/cis/stn.htm
and its Chinese twin /tc/cis/stn.htm: code, English and Chinese
(names: {"zh-Hant": …}) name, position and ground elevation of every
current manned and automatic weather station, buoy and wind station. The
page gives the wind stations’ anemometer height rather than the ground’s,
so their elev is null. To it were added (2026-11-12) the gauges the
rainfall and tide feeds name that are not among those stations — each with
elev null, since the page gives a raingauge’s height above sea level
and nothing for a tide gauge, and rank 2:
| code | name | from |
|---|---|---|
R23 | Tai Po Wong Shiu Chi Secondary School (大埔王肇枝中學) | the station page’s automatic rainfall section |
N12 | Shui Pin Wai (水邊圍) | GEO raingauge N12 |
K02 | Broadcast Drive (廣播道) | GEO raingauge K02 |
K09 | San Po Kong (新蒲崗) | GEO raingauge K09 |
H17 | Magazine Gap (馬己仙峽) | GEO raingauge H17 |
QUB | Quarry Bay (鰂魚涌) | the station page’s tide gauge section |
SPW | Shek Pik (石壁) | the station page’s tide gauge section |
TBT | Tsim Bei Tsui (尖鼻咀) | the station page’s tide gauge section |
TMW | Tai Miu Wan (大廟灣) | the station page’s tide gauge section |
TAO | Tai O (tide gauge) (大澳(潮汐站)) | the Observatory’s real-time tide page (https://www.hko.gov.hk/en/tide/marine/realtide.htm, its station list TAO) |
The GEO raingauges are the Civil Engineering and Development Department’s
Geotechnical Engineering Office’s, numbered as the rainfall feed numbers
them; their positions are those of the “GEO Raingauge Data” dataset on the
CSDI portal (cedd_rcd_1636517963140_47030, records of 2025–2026), their
names the feed’s English and Chinese ones. The station page lists the two
remaining tide gauges, Tai Po Kau and Waglan Island, under the codes of
existing stations, TPK (the wind station, at the same position) and
WGL (the weather station, about 100 m away), so their water level joins
those stations’ lines.
A file’s station name resolves to the table’s English name, or to an
alias the table lists, after a typographic apostrophe is read as ' (the
rainfall feed spells King’s Park):
| name | file | station |
|---|---|---|
| Chek Lap Kok | all | HKA Hong Kong International Airport |
| HK Observatory | all | HKO Hong Kong Observatory |
| HK Park | all | HKP Hong Kong Park |
| Pak Tam Chung | all | TYW Pak Tam Chung (Tsak Yue Wu) |
| Star Ferry | all | SF Star Ferry (Kowloon) |
| Tai Po | all | YCT Tai Po (Yuen Chau Tsai Park) |
| Tsuen Wan Ho Koon | all | TWN Tsuen Wan |
| Tsing Yi | temperature, humidity, pressure | TY1 New Tsing Yi Station |
| Tsing Yi | wind | SHL Shell Oil Depot |
| Tuen Mun | temperature, humidity, pressure, rainfall | TU1 Tuen Mun Children and Juvenile Home |
| Tuen Mun | wind | TUN Tuen Mun Government Offices |
| Tap Mun | wind | TME Tap Mun East |
| Cheung Ching | rainfall | CPH Ching Pak House (Tsing Yi) |
| Tai Po Market | rainfall | R23 Tai Po Wong Shiu Chi Secondary School |
| Tai O | tide | TAO Tai O (tide gauge) |
The aliases were resolved by hand: by the name and address in the
Observatory’s “Network of weather stations in Hong Kong” dataset on the
CSDI portal (which spells Tsing Yi, Tuen Mun, Pak Tam Chung and
Tsuen Wan Ho Koon the CSV’s way), by the station page’s own remarks
(the Tai Po station moved to Yuen Chau Tsai Park in 2022; the Tap Mun
East wind station replaced the Tap Mun one in 2017), and, where one name
covers two stations, by which of them the station page says measures the
file’s element (New Tsing Yi Station has no anemometer, the Shell Oil
Depot station is one; of the two Tuen Mun stations only the Children and
Juvenile Home has a raingauge). For the rainfall: Ching Pak House is a
block of Cheung Ching Estate and the station page’s only raingauge there
(CPH measures rainfall alone); Tai Po Market is the town centre of Tai
Po, where the only raingauge the station page lists is the one at Wong
Shiu Chi Secondary School (R23) — the Yuen Chau Tsai Park station has
none. Tai O is the drainage department’s gauge rather than the
Observatory’s wind station TO of the same name, about a kilometre away.
Some rainfall names match an Observatory station whose station page row
has no raingauge: the feed’s numbering says these are GEO raingauges near
it — N15 Sai Kung (SKG, about 0.9 km away), K03 Kwun Tong (KTG, at
the same position), H15 Stanley (STY, about 0.3 km) and H24 Wong
Chuk Hang (HKS, about 0.4 km) — and RF013 Ngong Ping (NGP) is most
likely the Ngong Ping Fresh Water Reservoir raingauge 0.4 km away. Their
rainfall is placed at the station of the same name. Three regional names
have no station in either source — Hong Kong Sea School (wind),
Central and Sai Wan Ho (visibility) — and are dropped, counted in
unplaced.
Station identity: hko:<the Observatory's station code> (hko:HKO,
hko:HKA, hko:WGL), or the GEO raingauge number for a GEO gauge
(hko:K02); name is the station page’s English name, or the feed’s for
a GEO gauge. rank is 0 for the two manned stations (HKO, HKA), 2 for
a gauge that measures rainfall or the tide alone (CPH and the stations
added above), and 1 for every other. The station page gives no WMO
numbers, so wmo is null.
Terms. DATA.GOV.HK’s terms of use
(https://data.gov.hk/en/terms-and-conditions, the licenseUrl) allow reuse, commercial
included, on condition that the source is identified and the Government’s
and the Observatory’s ownership acknowledged, with proper attribution to
them and to DATA.GOV.HK. The attribution string, “Hong Kong Observatory
(DATA.GOV.HK)”, is what a display shows.
Part of the Xue specification, licensed under CC BY 4.0.
13 - The aq product
In the viewer: the stations over the map with ?stations=aq, over the SILAM air-quality forecast (/silam?stations=aq) or any other layer.
An air-quality monitoring station reports an hourly mean of a handful of
pollutants. A national network is a few dozen to a few thousand such
stations, a megabyte or two a day — not a raster — so air quality is a
point product published beside the runs, the surface stations
(docs/synop.md), the airports (docs/airport.md) and the soundings
(docs/sounding.md). Each network enters through an adapter that reads it
into one set of elements and units, and the product carries every network
in the same shape. The networks are aggregated twice an hour by
xue aq-build (xuebuild/aq/) and taken live by the same pointer →
immutable directory contract the other point products use. This document
is the normative description of that product, schema v1.
1. Delivery
Everything is a static file under the data root, beside the run pointers and the other point products’ pointers.
latest-aq.jsonis the one mutable object. Request it withCache-Control: no-cache(in a browser,fetch(url, {cache: "no-cache"})): without it a browser cache may answer with a pointer up to four hours old. It names the newest round’s directory and the index inside it:pathis relative to the pointer and alwaysaq/<YYYY>/<MM>/<DD>/aq.<round>/index.json, the date being the round’s. A pointer written before that layout names the flataq.<round>/index.json, and a reader accepts both.byteLengthandcrc32(zlib CRC32 of the file’s bytes, eight lowercase hex digits) are the index’s, so it can be requested as<path>?v=<crc32>through an immutable cache.aq/<YYYY>/<MM>/<DD>/aq.<YYYYMMDDHHMM>/is one immutable directory per round, filed under its UTC day so the data root does not carry a prefix per round: the UTC minute the product was aggregated at, always a multiple of five. It holdsindex.json(§4), per network a<network>.stations.json(§5) and a<network>.jsonl(§6), anditem.json, the round’s STAC Item (docs/stac.md§“Point products”). Nothing in it changes once the pointer names it. Each round carries the whole window and lives three hours (make prune-r2-aq,AQ_KEEP=6).Paths inside
index.jsonare file names beside it; request each as<name>?v=<crc32>with the CRC the index carries.
Three ways to read:
- A map. Fetch the index, then the
<network>.stations.jsonof each network to show: every station’s position, agency and current values, no history. - One station. Take the station’s row in its network’s stations file,
which ends in the byte
offsetandlengthof its line in the network’s.jsonl, and issueGET <round directory>/<network>.jsonl?v=<crc32>withRange: bytes=<offset>-<offset + length - 1>. The bytes are that station’s JSON object exactly, without the newline, so they parse on their own. - A whole network. Fetch
<network>.jsonland read it line by line: one station per line, sorted by id.
The publisher builds at a quarter past and a quarter to each hour
(publish-aq.yml): the networks post an hour between ten and fifty-five
minutes after it ends. Each network is asked for what it holds after its
newest time in the previous round’s index, so a network that was
unreachable catches up, on its next answer, as far back as its own
retention reaches. A network that fails is recorded (§7) and keeps its
history; the round publishes with the rest. The pointer is withheld only
when no network’s observations arrived, in which case the previous round
stays live. A round the pointer already names is finished; the workflow’s
force input is the manual rebuild.
Deployment is one-sided: the product is new files under a new pointer, so
a shell that does not know it never asks for it. A new network is a new
entry in the index and two new files, which a v1 reader admits (§8); a
schemaVersion bump follows the runs’ rule (ship the shell first).
2. Elements and units
Every value is an hourly mean, and its time is the end of the hour
it averages. Every network is converted to one table of elements at the
adapter. The index lists them in this order (elements):
| key | quantity | unit | type |
|---|---|---|---|
pm25 | PM2.5 mass concentration | µg/m³, to a tenth | number, −5 … 10000 |
pm10 | PM10 mass concentration | µg/m³, to a tenth | number, −5 … 10000 |
o3 | ozone | ppb, to a tenth | number, −5 … 1000 |
no2 | nitrogen dioxide | ppb, to a tenth | number, −5 … 2000 |
so2 | sulphur dioxide | ppb, to a tenth | number, −5 … 5000 |
co | carbon monoxide | ppm, to a hundredth | number, −0.5 … 100 |
Gases are mixing ratios, particles mass concentrations. A network that reports a gas as a mass concentration is converted at the reference conditions it states its gases at — its
gasReference(§4). Hong Kong’s EPD states 293 K and 101.325 kPa (§9.2), where the molar volume is 24.04 L/mol:then rounded to the element’s precision. A network that reports in the product’s units is published as reported, and its
gasReferenceisnull.Small negative values are kept. An analyser near zero drifts below it, and a network that publishes such an hour (AirNow does) is not corrected; below the range’s floor a value is
null.A network publishes the elements it measures and leaves the others
null. Nothing is derived: no AQI, AQHI or other index, no 8-hour or 24-hour averages — a reader computes those from the 24-hour window with the scale of its choice. Observations only.A value the network marks missing, one in a unit other than the one expected, or one outside the range above, is
null.Times in the network files are epoch seconds, UTC; times in the index and the stations files are ISO 8601 UTC with a
Zsuffix.Positions are decimal degrees to four places;
elevis metres above sea level, ornullwhere the network does not give it.
The index carries this table as elementTable (§4), so a reader need
not hard-code it.
The files are written compactly with ASCII escaping, and a file’s identity
is its bytes: the CRC32 in the index, and the pointer’s, is of the file
exactly as served. Given the same inputs a round is byte-identical; only
the index’s generated, the sources’ fetched and the builder’s
revision depend on when and from what the build ran.
3. Identity
A station is <network>:<the network's own station identifier>
(airnow:060371103 is Los Angeles – N. Main Street, hkepd:15 the
Causeway Bay roadside station). The network id is lowercase,
^[a-z][a-z0-9]*(-[a-z0-9]+)*$; the station part matches
[0-9A-Za-z_.-]+. The id is the key everywhere: each stations file’s rows
are sorted by it, each network file’s lines are sorted by it, and every
line repeats it as id so a slice read by range identifies itself.
4. index.json
The shape — every field, its type and range — is
schemas/aq-index.schema.json; the
pointer’s is schemas/pointer.schema.json.
This section says what the fields mean and the rules across them.
issuedis the round,generatedwhen the build ran.networks[]is one entry per network that has a station in the window, in the publisher’s order: its id and displayname;cadence, the seconds between a station’s reports;avgPeriod, the seconds each value averages over, ending at its time;preliminary, true when the network publishes unvalidated data, which a display must then say;gasReference(optional),{"temperature": <K>, "pressure": <Pa>}, the reference conditions the network’s gases were converted from µg/m³ at (§2), ornullfor a network published in its own mixing ratios; theattributiona display must show, thelicensethe network’s data is reused under (§9 spells out each),licenseUrl(optional), the terms that licence string names, and the network’surl;latest, the newest observation time in the network’s file;file, the network file’s name (always<id>.jsonl), length and CRC32; andstations, the stations file’s name (always<id>.stations.json), length, CRC32 and rowcount.elementsis the element order of every stations file’s rows, which repeats it.elementTable(optional) describes each ofelements, one entry per element in the same order:unit, the unit of §2’s table;cell, how the value stands for its time —point,mean,sum,maxormin; andperiod, the seconds the value covers, ending at its time — a number,"network"where it is the network entry’savgPeriod, ornullfor an instantaneous value. Every v1 element is ameanover"network". A reader that finds no entry for an element falls back to §2.sources[]is §7.builder(optional) names the code that built the round:{"name": "xuebuild", "revision": <commit hash or null>}. The publisher sets the commit (XUE_BUILD_REVISION); an offline build leaves itnull.
5. <network>.stations.json
The shape is schemas/aq-stations.schema.json.
issued and elements equal the index’s. columns names the rows'
columns, and a reader finds a column by its name there. In v1 it is always
the layout below — the eight leading columns, the elements in their order,
then offset and length — so a reader that indexes by position reads it
too. It is optional: rounds published before it (every aq round up to
2026-11-04) do not carry it, and a reader takes such a file’s rows in the
layout below. stations[] is one compact row per station, sorted by id and
unique, count of them:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 … | last two |
|---|---|---|---|---|---|---|---|---|---|
id | lat | lon | elev | rank | name | agency | obsTime | one value per elements | offset, length |
- Every id’s prefix is the file’s
network. rankis how prominent the station is, which a map thins by:0a principal or background station,1a general station,2a roadside station.nameis the station’s name in Latin script, ornull.agencyis the agency that operates the station and owns its data, ornull; where the network’s terms ask for the agency to be credited (AirNow), a display shows it with the station’s values.obsTimeis the end of the station’s newest hour.- The element values are the station’s current values: for each
element, its newest non-null value no more than an hour before
obsTime. A network’s newest hour arrives a little short and fills in over the next hours, and a station’s analysers do not always report together; the hour of grace keeps a late element from blinking out. offsetandlengthare the byte span of the station’s line in<network>.jsonl, the JSON object alone. The spans are in row order, do not overlap, and lie inside that file’sbyteLength.
6. <network>.jsonl
Each line’s shape is schemas/aq-line.schema.json.
One line per station of that network, sorted by id, each the compact JSON
object below followed by \n:
namesmaps BCP 47 language tags to the network’s own spellings; a display picks the viewer’s language and falls back toname.timeis the station’s window, oldest first: every hour ending in the 24 hours up to the round at which the station reported anything.obsholds one array per element the station reported at least once in the window, each as long astime,nullwhere that element was not reported in that hour. An element the station never reported in the window is absent, and reads as allnull.
A station’s window is a merge, not a snapshot. Each round lays the network’s new hours over the previous round’s file keyed by (station, time), the new one replacing the old whole — a network that revises an hour, as AirNow does for days afterwards, is believed, and an hour it rewrites without a value withdraws the value — and drops what ended more than 24 hours before the round. A station that did not report keeps its history; one with nothing left in the window leaves the files until it reports again. Station metadata is the newest the network gave. A network with no station left is not listed.
7. sources[]
One entry per source, every network’s in turn, in build order:
sha256 (optional) is the SHA-256, lowercase hex, of the raw bytes the
build read from the source, file after file in the order they were
fetched, so a round can be traced to its input; it is absent when the
source contributed no bytes. ok: false always carries error.
reports is what the source contributed: station-hours with at least one value. unplaced is how many
station-hours (AirNow) or station names (EPD) had no usable position or
were not in the station table and were dropped. A network’s own fields
are described in its section.
8. Validation
The JSON Schemas of §4–§6 are normative for shape: a file that does not
match them is not an aq file. tests/test_schemas.py holds the
committed golden (tests/fixtures/aq/expected/, two consecutive rounds
built from the fetched fixture tests/fixtures/aq/aq.202610311515/ and
…1545/, the raw rounds, which stay flat under the raw root, by
tests/prepare_aq_golden.py) to them, and the shell’s validators are
generated from them (web/src/schema/generated/). xuebuild/aq/schema.py
checks, as every file is written and read, what a schema cannot say: file
names, unique networks and elements, the element table in the elements'
order, a stations file’s network, issued, elements and columns
against its index, its row width and count, rows sorted under the
network’s prefix, each element of §2 in its range, the spans in row order
inside the network file, and a line’s strictly increasing time and
obs arrays as long as it; tests/test_aq.py checks every span against
the network file it addresses. Admission is structural: a network, a
station or an element key a reader has never seen is not an error — the
row width follows the index’s own elements. A reader validates the same
on read and rejects a schemaVersion above the one it implements.
9. Networks
9.1 airnow — US EPA AirNow
The US Environmental Protection Agency’s AirNow: about 2 000 stations a
given hour across the United States, Canada and Mexico, run by federal,
state, local and tribal agencies and their Canadian and Mexican
counterparts, and a handful of US diplomatic posts abroad. cadence and
avgPeriod are 3600; preliminary is true; gasReference is null:
the gases arrive as mixing ratios.
Source. airnow-hourly —
https://files.airnowtech.org/airnow/<YYYY>/<YYYYMMDD>/HourlyAQObs_<YYYYMMDDHH>.dat,
one quoted CSV per hour with a row per site, about 1 MB (the dated
archive; the file is not under today/). The hour in the name and in
ValidDate/ValidTime is the start of the averaging hour in UTC, so
a value’s time is that plus 3600 s. AirNow posts an hour about 35 minutes
after it ends and rewrites the files of the previous days every hour as
late data arrive, so a round reads the newest three hours that have ended
by the round every time, plus any older hour that ends after the
network’s previous latest, at most the 24 hours of the window. files
is how many hours were read, missing how many were not there yet
(HTTP 404).
Reading. The file is decoded as UTF-8 (Latin-1 if it is not). Each row is a station-hour:
| AirNow column | element | conversion |
|---|---|---|
PM25 | pm25 | — (PM25_Unit must be UG/M3) |
PM10 | pm10 | — (UG/M3) |
OZONE | o3 | — (PPB) |
NO2 | no2 | — (PPB) |
SO2 | so2 | — (PPB) |
CO | co | — (PPM) |
These are the hourly concentrations, not AirNow’s NowCast; the *_AQI
columns are not published. A blank cell, or a unit column that does not
state the expected unit, is null. Values arrive to a tenth and are
published unchanged.
Station identity: airnow:<AQSID> (nine characters, or twelve with a
three-digit country prefix). name is SiteName, agency is
DataSource, the reporting agency. lat, lon and elev are the row’s
own; AirNow writes an elevation of 0.0 where it has none (half the
stations, Baku’s at −28 m among them), so an exact zero is null. A row
without a position, or at 0°, 0°, is dropped and counted as unplaced.
The file has no station type, so every station is rank 1. Rows of sites
that report no value (AirNow lists the Japanese Ministry of the
Environment’s stations without data) leave no station in the product.
Terms. AirNow data carry no open licence; their use is governed by the
EPA’s AirNow Data Exchange Guidelines (August 2025,
https://docs.airnowapi.org/docs/DataUseGuidelines.pdf, the
licenseUrl), named by the license string AirNow-DEG. The conditions this product and any display
of it meet:
- The observations are not fully verified or validated, are subject to
change and are preliminary. A display or product built on them must
say so (
preliminary: true), and they are not for regulatory use, trends or decision-making; official regulatory data are in the EPA’s Air Quality System (AQS). - Credit goes first to the federal, state, local and tribal agencies that
own the data, and to the EPA AirNow program. The
attributionstring carries the programme credit; each station’sagencynames its owner, and a display shows it with the station’s values. - Values are not altered and are disseminated as received: no conversion, no correction, no clipping of small negatives.
- Users of the data should receive the most current data available; the half-hourly round and the 24-hour rewrite window serve that.
- Observed values should be shown in accordance with the AQI and its colours where an index is shown; v1 carries no index, and a display that derives one follows the EPA’s Technical Assistance Document.
- Products relying on the data must be made known to the agencies and the AirNow program, and the user’s contact details kept current: whoever operates a deployment of this product returns the guidelines’ form to the AirNow Data Management Center.
9.2 hkepd — Hong Kong Environmental Protection Department
The Hong Kong Environmental Protection Department’s air quality
monitoring network: 15 general and 3 roadside stations. cadence and
avgPeriod are 3600; preliminary is true: this is the real-time feed,
ahead of the department’s validated records. gasReference is
{"temperature": 293, "pressure": 101325}.
Source. epd-24pc — https://www.aqhi.gov.hk/epd/ddata/html/out/24pc_Eng.xml,
the past 24 hours of every station’s hourly concentrations, about 100 KB,
rewritten about ten minutes after each hour. Every round reads the whole
file, so a missed round costs nothing while the next one comes within a
day; there is no other backfill.
Time. Each PollutantConcentration carries a DateTime in Hong Kong
time (Sat, 31 Oct 2026 22:00:00 +0800). It is the end of the
averaging hour: the file written at 22:10 HKT already lists 22:00 as its
newest hour, which can only be the hour that has just ended (observed
2026-10-31: Last-Modified 14:10:15 UTC, newest DateTime 22:00 +0800 =
14:00 UTC). It is published as it stands, in UTC. lastBuildDate runs
half an hour ahead of the file and is not an observation time.
Reading. Every concentration is in µg/m³, CO included; - is no value.
The feed does not state the conditions its gases are expressed at; the
department’s Air Quality Objectives do, for every gas measurement: “All
measurements of the concentration of gaseous air pollutants, i.e.,
sulphur dioxide, nitrogen dioxide, ozone and carbon monoxide, are to be
adjusted to a reference temperature of 293 Kelvin and a reference
pressure of 101.325 kilopascal”
(https://epd.gov.hk/epd/english/environmentinhk/air/air_quality_objectives/air_quality_objectives.html,
checked 2026-11-01). The gases are turned back into mixing ratios at that
reference, 24.04 L/mol:
| EPD element | element | conversion |
|---|---|---|
PM2.5 | pm25 | — |
PM10 | pm10 | — |
O3 | o3 | × 24.04 / 48.00 |
NO2 | no2 | × 24.04 / 46.01 |
SO2 | so2 | × 24.04 / 64.07 |
CO | co | × 24.04 / 28 010 |
Station identity: hkepd:<mid>, the department’s own station number
(hkepd:0 is Central/Western, hkepd:15 Causeway Bay). The XML carries
names only; the number, like the position, comes from the committed
table xuebuild/aq/hkepd_stations.json, keyed by those names and recorded
once from the network’s CSDI WFS layer (csdi:AQMN, Air Quality
Monitoring Network of Hong Kong) with the English names, traditional
Chinese names (names["zh-Hant"]), positions, station types and the
department’s station number (mid). Rounds of the first release named
the stations by their English name, lower-cased with every run of other
characters a hyphen (hkepd:central-western); the merge (§6) reads such
a previous round under the numbers. The layer gives no elevation, so
elev is null. Causeway Bay, Central and Mong Kok are roadside stations, rank 2;
the others rank 1. agency is EPD. A station name the table does not
know is dropped and counted as unplaced; a new station is a reviewed
change to the table.
Terms. The file is a DATA.GOV.HK resource, reusable free of charge for
commercial and non-commercial purposes under the DATA.GOV.HK Terms and
Conditions (https://data.gov.hk/en/terms-and-conditions, the licenseUrl), named
by the license string DATA.GOV.HK, on condition that the source is identified
clearly, the Government’s and the department’s ownership of the
intellectual property is acknowledged, and attribution is given to the
Government, the department and DATA.GOV.HK — the attribution string
Environmental Protection Department, HKSAR Government (DATA.GOV.HK),
which a display shows with the data. The data are provided as is.
Part of the Xue specification, licensed under CC BY 4.0.
14 - The alerts product
In the viewer: the warnings in force over the map with ?stations=alerts (/gfs?stations=alerts).
A weather warning is a short record — who issued it, what hazard, how
severe, where, until when — and a national service has a few dozen to a
few thousand in force at once. That is not a raster, so warnings are a
point product published beside the runs, the airports (docs/airport.md)
and the stations (docs/synop.md). Each national warning service enters
through an adapter that reads it into one shape — a closed list of
categories, one five-level scale, the service’s own codes kept beside
them, and every language the service publishes — and the product carries
every service in that shape. The snapshot is taken every five minutes by
xue alerts-build (xuebuild/alerts/) and taken live by the same
pointer → immutable directory contract the other point products use. This
document is the normative description of that product, schema v1.
1. Delivery
Everything is a static file under the data root, beside the run pointers and the other point products’ pointers.
latest-alerts.jsonis the one mutable object. Request it withCache-Control: no-cache(in a browser,fetch(url, {cache: "no-cache"})): without it a browser cache may answer with a pointer up to four hours old. It names the newest round’s directory and the index inside it:pathis relative to the pointer and alwaysalerts/<YYYY>/<MM>/<DD>/alerts.<round>/index.json, the date being the round’s. A pointer written before that layout names the flatalerts.<round>/index.json, and a reader accepts both.byteLengthandcrc32(zlib CRC32 of the file’s bytes, eight lowercase hex digits) are the index’s, so it can be requested as<path>?v=<crc32>through an immutable cache.alerts/<YYYY>/<MM>/<DD>/alerts.<YYYYMMDDHHMM>/is one immutable directory per round, filed under its UTC day so the data root does not carry a prefix per round: the UTC minute the snapshot was taken at, always a multiple of five. It holdsindex.json(§5), one<network>.jsonlper network (§6) anditem.json, the round’s STAC Item (docs/stac.md§“Point products”). Nothing in it changes once the pointer names it. A round is a snapshot, not a history, and lives three hours (make prune-r2-alerts,ALERTS_KEEP=36). The day directories sit besidealerts/archive/(§12) and the product’s STAC Collection; only a four-digit year is a day tree.alerts-areas/<set>.<version>.pmtilesare the boundary sets (§9): one file per upstream release, immutable under its versioned name and kept for as long as any round may name it, each with its codes’ boxes beside it in<set>.<version>.bbox.json. They are not part of a round and are never pruned with one.Paths inside
index.jsonare relative to it; request each as<path>?v=<crc32>with the CRC the index carries.
A round is a snapshot of what is in force at issued: what each
network lists as current, less what has expired by the round’s minute. It
carries no history; ended[] (§7) names what left since the previous
round, for that round only. The history is the monthly archive under
alerts/archive/ (§12).
Two ways to read an alert’s full record:
- One alert. Take its row in the index, which ends in the byte
offsetandlengthof its line in its network’s file, and issueGET <round directory>/<network>.jsonl?v=<crc32>withRange: bytes=<offset>-<offset + length - 1>. The bytes are that alert’s JSON object exactly, without the newline, so they parse on their own. - A whole network. Fetch
<network>.jsonland read it line by line: one alert per line, sorted by id.
The publisher builds every five minutes (publish-alerts.yml). A network
that fails is recorded (§8) and carries its previous round’s alerts over
(§7); the round publishes with the rest. The pointer is withheld only when
no network’s state arrived, in which case the previous round stays live.
A round the pointer already names is finished; the workflow’s force
input is the manual rebuild.
Deployment is one-sided: the product is new files under a new pointer, so
a shell that does not know it never asks for it. A new network is new rows
and a new file, which a v1 reader admits (§11); a schemaVersion bump
follows the runs’ rule (ship the shell first).
2. Categories and levels
Every alert is filed under one category, from a closed list the index
repeats in this order (categories):
| key | hazard |
|---|---|
rain | heavy rain |
flood | river, flash and snowmelt flooding |
landslide | landslides and debris flows |
wind | wind on land, tropical cyclones |
thunderstorm | thunderstorms, tornadoes, lightning |
snow-ice | snow, blizzard, freezing rain, icing, avalanche |
heat | heat |
cold | cold, frost, freeze, wind chill |
fog | fog |
dust | dust and sand |
fire | fire weather and dry air |
air | air quality, smoke, ashfall |
coastal | storm surge, coastal and lakeshore flooding, surf, rip currents |
marine | conditions at sea: gales, seas, freezing spray, waves |
tsunami | tsunami |
other | anything else, including non-weather civil alerts |
and given one level, an integer 1 … 5 on a scale every network maps onto:
| level | meaning | NWS | JMA | ECCC | MeteoAlarm | CMA | HKO | CWA |
|---|---|---|---|---|---|---|---|---|
| 1 | statement, information | Statement, Outlook, Message, Forecast | — | statement (no colour) | — | — | special announcement | — |
| 2 | advisory, be aware | Advisory, Watch | 注意報 (レベル2) | yellow; advisory or watch (no colour) | yellow | blue, yellow | amber rain, yellow fire, signals 1 and 3, the other warnings | yellow; Minor or Moderate (no colour) |
| 3 | warning | Warning | 警報 (レベル3) | orange; warning (no colour) | orange | orange | red rain, red fire, signal 8, landslip, tsunami | orange; Severe (no colour) |
| 4 | danger | Warning with CAP severity Extreme | 危険警報 (レベル4) | red | red | red | black rain, signals 9 and 10 | red, purple; Extreme (no colour) |
| 5 | exceptional | — | 特別警報 (レベル5) | — | — | — | — | — |
Level 5 is JMA’s 特別警報 alone: no other network has a tier above its
danger level, and folding it into 4 would lose the distinction the agency
draws. The level and category are this product’s; the network’s own
event name, code and level are kept beside them in the line’s native
(§6), verbatim.
3. Mapping per network
The mappings are data, in xuebuild/alerts/tables.json, and this section
is that file in prose. An event name, subject or code a table does not
list is not an error: it is filed under other and levelled by its last
word (NWS) or its colour and type (ECCC); a JMA code the table does not
know is skipped and counted (§8), and so is a MeteoAlarm awareness level
it does not list.
3.1 NWS
Level by event name, else by its last word:
| last word | level |
|---|---|
| Statement, Outlook, Message, Forecast | 1 |
| Advisory, Watch | 2 |
| Warning | 3 |
| anything else | 1 |
Named exceptions: 911 Telephone Outage and 911 Telephone Outage Emergency 1, Blue Alert 1, Air Quality Alert 2, Child Abduction Emergency 3, Civil Emergency Message 3, Extreme Fire Danger 3,
Local Area Emergency 3, Evacuation Immediate 4. Then any event ending
in Warning whose CAP severity is Extreme (a tornado emergency, a
particularly dangerous situation, a tsunami or extreme wind warning) is
raised to 4. Watches stay 2 at any severity: a watch says conditions are
possible, not occurring.
Category by event name (every event api.weather.gov/alerts/types
listed on 2026-10-31, and the names it retired that may still appear):
| category | NWS events |
|---|---|
flood | Arroyo And Small Stream Flood Advisory, Flash Flood Statement, Flash Flood Warning, Flash Flood Watch, Flood Advisory, Flood Statement, Flood Warning, Flood Watch, Hydrologic Advisory, Hydrologic Outlook, Small Stream Flood Advisory, Urban And Small Stream Flood Advisory |
wind | Extreme Wind Warning, High Wind Warning, High Wind Watch, Hurricane Local Statement, Hurricane Warning, Hurricane Watch, Lake Wind Advisory, Tropical Cyclone Local Statement, Tropical Depression Local Statement, Tropical Storm Local Statement, Tropical Storm Warning, Tropical Storm Watch, Typhoon Local Statement, Typhoon Warning, Typhoon Watch, Wind Advisory |
thunderstorm | Severe Thunderstorm Warning, Severe Thunderstorm Watch, Severe Weather Statement, Tornado Warning, Tornado Watch |
snow-ice | Avalanche Advisory, Avalanche Warning, Avalanche Watch, Blizzard Warning, Blizzard Watch, Freezing Rain Advisory, Ice Storm Warning, Lake Effect Snow Advisory, Lake Effect Snow Warning, Lake Effect Snow Watch, Snow Squall Warning, Winter Storm Warning, Winter Storm Watch, Winter Weather Advisory |
heat | Excessive Heat Warning, Excessive Heat Watch, Extreme Heat Warning, Extreme Heat Watch, Heat Advisory |
cold | Cold Weather Advisory, Extreme Cold Warning, Extreme Cold Watch, Freeze Warning, Freeze Watch, Frost Advisory, Hard Freeze Warning, Hard Freeze Watch, Wind Chill Advisory, Wind Chill Warning, Wind Chill Watch |
fog | Dense Fog Advisory, Freezing Fog Advisory |
dust | Blowing Dust Advisory, Blowing Dust Warning, Dust Advisory, Dust Storm Warning |
fire | Extreme Fire Danger, Fire Warning, Fire Weather Watch, Red Flag Warning |
air | Air Quality Alert, Air Stagnation Advisory, Ashfall Advisory, Ashfall Warning, Dense Smoke Advisory |
coastal | Beach Hazards Statement, Coastal Flood Advisory, Coastal Flood Statement, Coastal Flood Warning, Coastal Flood Watch, High Surf Advisory, High Surf Warning, Lakeshore Flood Advisory, Lakeshore Flood Statement, Lakeshore Flood Warning, Lakeshore Flood Watch, Rip Current Statement, Storm Surge Warning, Storm Surge Watch |
marine | Brisk Wind Advisory, Freezing Spray Advisory, Gale Warning, Gale Watch, Hazardous Seas Warning, Hazardous Seas Watch, Heavy Freezing Spray Warning, Heavy Freezing Spray Watch, Hurricane Force Wind Warning, Hurricane Force Wind Watch, Low Water Advisory, Marine Weather Statement, Small Craft Advisory, Small Craft Advisory For Hazardous Seas, Small Craft Advisory For Rough Bar, Small Craft Advisory For Winds, Special Marine Warning, Storm Warning, Storm Watch |
tsunami | Tsunami Advisory, Tsunami Warning, Tsunami Watch |
other | 911 Telephone Outage, 911 Telephone Outage Emergency, Administrative Message, Blue Alert, Child Abduction Emergency, Civil Danger Warning, Civil Emergency Message, Earthquake Warning, Evacuation Immediate, Hazardous Materials Warning, Hazardous Weather Outlook, Law Enforcement Warning, Local Area Emergency, Nuclear Power Plant Warning, Radiological Hazard Warning, Shelter In Place Warning, Short Term Forecast, Special Weather Statement, Volcano Warning |
The NWS issues no rain-only or landslide product; heavy rain reaches the
public as flood products. Storm Warning and Storm Watch are the
marine storm-force products, hence marine.
3.2 JMA
By kind code of the r8 warning map (the code table of the agency’s own warning page). Level is the agency’s own レベル; the English names are the page’s translation table, published here for display, not in the files.
| code | 種別 | English | element | level | category |
|---|---|---|---|---|---|
10 | レベル2大雨注意報 | Heavy Rain Advisory | rain | 2 | rain |
03 | レベル3大雨警報 | Heavy Rain Warning | rain | 3 | rain |
43 | レベル4大雨危険警報 | Heavy Rain Urgent Warning | rain | 4 | rain |
33 | レベル5大雨特別警報 | Heavy Rain Emergency Warning | rain | 5 | rain |
29 | レベル2土砂災害注意報 | Landslide Advisory | landslide | 2 | landslide |
09 | レベル3土砂災害警報 | Landslide Warning | landslide | 3 | landslide |
49 | レベル4土砂災害危険警報 | Landslide Urgent Warning | landslide | 4 | landslide |
39 | レベル5土砂災害特別警報 | Landslide Emergency Warning | landslide | 5 | landslide |
19 | レベル2高潮注意報 | Storm Surge Advisory | tide | 2 | coastal |
08 | レベル3高潮警報 | Storm Surge Warning | tide | 3 | coastal |
48 | レベル4高潮危険警報 | Storm Surge Urgent Warning | tide | 4 | coastal |
38 | レベル5高潮特別警報 | Storm Surge Emergency Warning | tide | 5 | coastal |
15 | 強風注意報 | Gale Advisory | wind | 2 | wind |
05 | 暴風警報 | Storm Warning | wind | 3 | wind |
35 | 暴風特別警報 | Storm Emergency Warning | wind | 5 | wind |
13 | 風雪注意報 | Gale and Snow Advisory | wind_snow | 2 | snow-ice |
02 | 暴風雪警報 | Snowstorm Warning | wind_snow | 3 | snow-ice |
32 | 暴風雪特別警報 | Snowstorm Emergency Warning | wind_snow | 5 | snow-ice |
12 | 大雪注意報 | Heavy Snow Advisory | snow | 2 | snow-ice |
06 | 大雪警報 | Heavy Snow Warning | snow | 3 | snow-ice |
36 | 大雪特別警報 | Heavy Snow Emergency Warning | snow | 5 | snow-ice |
16 | 波浪注意報 | High Wave Advisory | wave | 2 | marine |
07 | 波浪警報 | High Wave Warning | wave | 3 | marine |
37 | 波浪特別警報 | High Wave Emergency Warning | wave | 5 | marine |
14 | 雷注意報 | Thunder Storm Advisory | thunder | 2 | thunderstorm |
17 | 融雪注意報 | Snow Melting Advisory | snow_melting | 2 | flood |
20 | 濃霧注意報 | Dense Fog Advisory | fog | 2 | fog |
21 | 乾燥注意報 | Dry Air Advisory | dry | 2 | fire |
22 | なだれ注意報 | Avalanche Advisory | avalanche | 2 | snow-ice |
23 | 低温注意報 | Low Temperature Advisory | cold | 2 | cold |
24 | 霜注意報 | Frost Advisory | frost | 2 | cold |
25 | 着氷注意報 | Ice Accretion Advisory | ice_accretion | 2 | snow-ice |
26 | 着雪注意報 | Snow Accretion Advisory | snow_accretion | 2 | snow-ice |
Wind, snow and wave have no 危険警報; the 土砂災害危険警報 (code 49) is what was the 土砂災害警戒情報 before May 2026. The designated-river flood warnings (氾濫注意報 … 氾濫特別警報, codes 20–22, 30–31, 40–41, 51, 53 in their own numbering) are published in a separate document and are not in v1.
3.3 ECCC
Level by the MSC risk colour where there is one, else by the alert type:
| colour | level | type, no colour | level | |
|---|---|---|---|---|
| yellow | 2 | statement | 1 | |
| orange | 3 | advisory, watch | 2 | |
| red | 4 | warning | 3 |
ECCC’s own colour is the level, so a yellow warning is level 2: MSC uses
yellow for its moderate-impact warnings, and the colour is the risk it
states. Category by the subject of the alert’s short English name
(alert_short_name_en less a trailing parenthesis, lower case:
Fog (advisory) → fog):
| category | ECCC subjects |
|---|---|
rain | rainfall |
wind | hurricane, les suetes wind, les suêtes wind, tropical storm, wind, wreckhouse wind |
thunderstorm | severe thunderstorm, tornado |
snow-ice | blizzard, blowing snow, freezing drizzle, freezing rain, snow squall, snowfall, winter storm |
heat | heat |
cold | arctic outflow, extreme cold, flash freeze, frost |
fog | fog |
dust | dust storm |
air | air quality, smoke |
coastal | coastal flooding, storm surge |
tsunami | tsunami |
other | weather |
3.4 MeteoAlarm
Level by the code that leads the MeteoAlarm CAP profile’s
awareness_level parameter, its colour:
awareness_level | level |
|---|---|
2; yellow; Moderate | 2 |
3; orange; Severe | 3 |
4; red; Extreme | 4 |
Green (1; green; Minor) means no particular awareness is required: the
profile uses it to stand a warning down, and it is not published (the
message is skipped and counted, and the warning it stood down leaves the
snapshot). The colour is the level, as ECCC’s is: MeteoAlarm’s yellow is
“be aware”, orange “be prepared”, red “take action”, and none of the
services has a tier above red.
Category by the code that leads awareness_type:
| code | awareness type | category |
|---|---|---|
1 | Wind | wind |
2 | snow-ice | snow-ice |
3 | Thunderstorm | thunderstorm |
4 | Fog | fog |
5 | high-temperature | heat |
6 | low-temperature | cold |
7 | coastalevent | coastal |
8 | forest-fire | fire |
9 | avalanches | snow-ice |
10 | Rain | rain |
12 | flooding | flood |
13 | rain-flood | flood |
14 | Marine-Hazard | marine |
15 | Drought | other |
The services spell the names in either case (1; Wind, 1; wind); only
the code is read. Any other code is other.
3.5 CMA
Level by CAP severity, which the CMA profile ties to the signal’s
colour (预警信号 blue Ⅳ/一般, yellow Ⅲ/较重, orange Ⅱ/严重, red Ⅰ/特别严重):
| severity | colour | level |
|---|---|---|
Minor | blue | 2 |
Moderate | yellow | 2 |
Severe | orange | 3 |
Extreme | red | 4 |
Blue and yellow share level 2: the scale has one “be aware” tier and
CMA’s red is its highest, as MeteoAlarm’s is; the colour stays in
native.colour. A severity the table does not list is level 2.
Category by the Chinese event name (the English names beside it are not
spelt consistently: gale, Dense fog, Icy Road):
| category | CMA events |
|---|---|
rain | 暴雨, 短时强降水 |
flood | 城市内涝, 渍涝风险, 山洪灾害气象风险, 中小河流洪水气象风险 |
landslide | 地质灾害气象风险 |
wind | 台风, 大风 |
thunderstorm | 雷电, 雷暴大风, 雷雨大风, 冰雹, 强对流 |
snow-ice | 暴雪, 大雪, 雪灾, 道路结冰, 道路冰雪, 电线积冰, 冰冻, 低温雨雪冰冻 |
heat | 高温, 干热风 |
cold | 寒潮, 低温, 持续低温, 霜冻, 降温 |
fog | 大雾 |
dust | 沙尘暴, 沙尘, 扬沙 |
fire | 森林火险, 草原火险, 森林(草原)火险 |
air | 霾, 臭氧, 空气污染, 重污染天气 |
coastal | 风暴潮 |
marine | 海上大风, 海上大雾, 海浪 |
other | 干旱, 气象干旱, 农业干旱 |
Any other event is other.
3.6 HKO
By the warning’s code, its signal or colour where it has several:
| code | warning | level | category |
|---|---|---|---|
TC1, TC3 | Standby Signal No. 1, Strong Wind Signal No. 3 | 2 | wind |
TC8NE, TC8SE, TC8SW, TC8NW | No. 8 Gale or Storm Signal | 3 | wind |
TC9, TC10 | Increasing Gale or Storm Signal No. 9, Hurricane Signal No. 10 | 4 | wind |
WRAINA, WRAINR, WRAINB | Amber, Red, Black Rainstorm Warning Signal | 2, 3, 4 | rain |
WFNTSA | Special Announcement on Flooding in the northern New Territories | 1 | flood |
WL | Landslip Warning | 3 | landslide |
WTS | Thunderstorm Warning | 2 | thunderstorm |
WHOT | Very Hot Weather Warning | 2 | heat |
WCOLD, WFROST | Cold Weather Warning, Frost Warning | 2 | cold |
WMSGNL | Strong Monsoon Signal | 2 | wind |
WFIREY, WFIRER | Yellow, Red Fire Danger Warning | 2, 3 | fire |
WTMW | Tsunami Warning | 3 | tsunami |
Any other code is other at level 2.
3.7 CWA
Level by the tier’s colour, CAP parameter alert_color (the 燈號 of the
strong wind, low and high temperature warnings; 大雨, 豪雨, 大豪雨 and
超大豪雨 for rain), else by CAP severity:
alert_color | colour | level |
|---|---|---|
| 黃色 | yellow | 2 |
| 橙色 | orange | 3 |
| 紅色 | red | 4 |
| 紫色 | purple | 4 |
Without a colour: Minor and Moderate 2, Severe 3, Extreme 4, and
any other severity 2. Red and purple share level 4, as CMA’s red does:
the colour stays in native.colour.
Category by CAP event:
| category | CWA events |
|---|---|
rain | 降雨 |
wind | 強風, 颱風 |
thunderstorm | 雷雨, 大雷雨 |
heat | 高溫 |
cold | 低溫 |
fog | 濃霧 |
Any other event is other.
4. Identity
An alert is <network>:<the network's own identifier>: the CAP
identifier for NWS (nws:urn:oid:2.49.0.1.840.0.…) and MeteoAlarm
(meteoalarm:2.49.0.0.276.0.DWD.PVW.…), the feature id for
ECCC (eccc:<CAP identifier>_<region>), the CAP identifier for CMA
(cma:12011541600000_20261111192247), jma:<office>-<kind> for
JMA, whose map has no per-alert identifier (jma:130000-10 is Tokyo’s
レベル2大雨注意報), hko:<code>-<issue time> for HKO, whose API has
none either (hko:WRAINR-20261101T000200Z), and the CAP identifier for
CWA (cwa:CWA-Weather_strong-wind_202612010432001), with /<colour> after
it for each block of a message that holds several
(cwa:CWA-Weather_heat_202610241424001/orange). The network id is lowercase,
^[a-z][a-z0-9]*(-[a-z0-9]+)*$; the rest is the upstream’s identifier
unchanged and may itself contain :. The id is the key everywhere: the
index’s rows are sorted by it, each network file’s lines are sorted by
it, and every line repeats it so a slice read by range identifies itself.
An upstream that replaces an alert under a new identifier (an NWS
Update; a JMA kind raised from 注意報 to 警報, or a 危険警報 lowered to
注意報, each a new kind code) produces a new id; the old one leaves the
snapshot and is listed in ended[]. Where the network says which alert
the new one replaces, the new line names it in replaces (§6) and the
old one ends as replaced, naming its successor (§7), so a reader can
chain an event’s messages across rounds.
5. index.json
The shape — every field, its type and range — is
schemas/alerts-index.schema.json; the
pointer’s is schemas/pointer.schema.json.
This section says what the fields mean and the rules across them.
issuedis the round,generatedwhen the build ran.networks[]is one entry per network that has a file this round (§7), in the publisher’s order (nws, jma, eccc, meteoalarm, cma, hko, cwa): its id and displayname; theattributiona display must show, thelicensethe network’s data is reused under,licenseUrl, the page stating those terms (optional), and the network’surl;latest, the upstream’s own time of the state the file holds (NWSupdated, JMAlatestControlDatetime, ECCCtimeStamp, MeteoAlarm the newestsentof any message its feeds listed, CMA the SWIC listing’slastUpdated, HKO the newestupdateTime, CWA the newestsentof any CAP file the bucket holds; on a carry-over, the previous round’s);file, the network file’s name (always<id>.jsonl), length and CRC32 — an empty file when nothing is in force; andareas, the boundary set the network’s area codes resolve against (§9), ornull.areas.pathis relative to the index and climbs to the data root:../../../../../alerts-areas/<set>.<version>.pmtilesfrom a round filed under its day,../alerts-areas/…from a flat one published before that layout (a reader accepts both);layersare the layer names in that file;bbox(optional) is the set’s box file (§9),<the same climb>alerts-areas/<set>.<version>.bbox.json, with its length and CRC32.categoriesis §2’s list, in that order.mapping(optional) is{"tables": <crc32>}, the CRC32 of the bytes ofxuebuild/alerts/tables.json, the mapping (§3) that filed this round’s categories and levels: two rounds with the same value were mapped alike, and a reader that wants the table itself reads it at the commitbuildernames.columns(optional) names the columns ofalerts[]’s rows, and a reader finds a column by its name there. In v1 it is always the layout below, so a reader that indexes by position reads it too; rounds published before it (every alerts round up to 2026-11-04) do not carry it, and a reader takes their rows in the layout below.alerts[]is one compact row per alert in force, sorted by id and unique:0 1 2 3 4 5 6 7 8–11 12, 13 idnetworkcategoryleveleventsentonsetexpireswest,south,east,northoffset,lengthnetworkis the index intonetworks[], and the id’s prefix is that network’s id.eventis the network’s event name in its primary language (English for NWS, ECCC and HKO, Japanese for JMA, Chinese for CMA and CWA) — the line’snative.event.sentis when the network issued the alert’s current message;onsetwhen the hazard begins andexpireswhen the alert stops being in force, ISO 8601 UTC, ornullwhere the network states none (JMA states neither: a Japanese warning is in force until lifted). The four bounds are the bounding box of the line’sgeometryto four decimals (plain minimum and maximum of the coordinates); for an alert with no polygon of its own, the union of itsareascodes’ boxes from the network’s boundary set (§9); four nulls when it has neither — no polygon and no boundary set, or a code the set does not hold (a box that left part of the area out would hide the alert from a reader asking about that part). A MeteoAlarm line can carry both, each for different parts of its area (§10.4): its box is the union of the polygon’s and the codes’ boxes, and null when a code has none. Like any plain minimum and maximum, the box of an area that crosses the antimeridian spans every longitude.offsetandlengthare the byte span of the alert’s line in its network’s file, the JSON object alone; the spans of one network’s alerts are in row order, do not overlap, and lie inside that file’sbyteLength.ended[]is §7.sources[]is §8.builder(optional) is{"name": "xuebuild", "revision": <commit>}, the commit the round was built from (XUE_BUILD_REVISION, which the publisher sets), ornullfor a build that was not told (an offline build or the golden, which stays reproducible that way).
The index is what a map layer reads, and what a point or box query filters on: every alert’s category, level, times and box, about 90 KB (11 KB gzipped) for the 431 alerts in force on 2026-10-31 15:20 UTC, and no text.
6. <network>.jsonl
Each line’s shape is schemas/alerts-line.schema.json.
One line per alert of that network in force, sorted by id, each the
compact JSON object below followed by \n:
networkis the network’s id (the row carries its position instead).nativeis the upstream’s own classification, verbatim:event(the event name, always),code(the network’s event code, or null) andlevel(the network’s own severity or level, or null), and the network’s further fields listed in its section (§10). A reader that wants the network’s own words reads these; the product’scategoryandlevelare derived from them by §3.statusis alwaysactual: exercises, tests and drafts are not published.textsmaps BCP 47 language tags to that language’s texts, every language the network publishes, in full — never truncated. Each holds the fields the network has ofheadline,description,instructionandarea(the network’s own description of the area, e.g. NWSareaDesc); a field the network leaves empty is absent.areaslists the area codes the alert is in force in, in the network’s code space, which the network’s boundary set (§9) draws; empty for a network whose alerts carry their own polygons.geometryis the alert’s own polygon where the network draws one (NWS storm-based warnings, every ECCC alert, the MeteoAlarm areas a service draws), as drawn with rounded coordinates (§9), elsenull. Where both are given, the polygon is the warned area andareasthe zones it touches — except for MeteoAlarm, whoseareasare the parts of the warned area the polygon does not draw (§10.4), so a display draws both.urlis the alert’s own page or document at the network,senderthe issuing office, eachnullwhere the network has none.replaces(optional, aftersender) lists, sorted, the ids of the same network’s earlier alerts this one supersedes, where the network says so: NWS and MeteoAlarm CAPreferenceson any message but aCancel, JMA the office’s 危険警報 a 注意報 was lowered from. Absent when there are none (and for ECCC, whose collection carries no references). A replaced alert may already have left the snapshot rounds ago; only one that leaves in this round is listed inended[]asreplaced.
7. ended[] and carry-over
ended[] lists the alerts that were in the previous round’s index and are
not in this one, sorted by id: [id, network, reason], or
[id, network, "replaced", by], network being the position in this
round’s networks[]. reason is the first of these that holds:
expired— the alert’sexpiresis at or before this round’sissued(whether the network still listed it or not);replaced— an alert in force this round names it inreplaces(§6);byis that alert’s id (of several, the first by id), always one of this round’s rows;cancelled— the network withdrew it in so many words this round: an NWSCancelmessage referencing it, a JMA kind whose status is 解除, an ECCC feature whose status isendedorcancelled, an HKO entry whose action isCANCEL, a CWACancelmessage naming it (or the message it updated);gone— anything else: it is simply no longer listed (a JMA kind raised to another code, the network dropped it without a word).
The four-element form is the only one with a fourth element; a reader
that predates replaced reads the first three.
ended[] is kept for one round. A reader that wants to animate a
warning’s end compares nothing; a reader that missed a round has missed
those ends, and reads the snapshot.
A network that does not deliver a new state — its fetch failed, its
document did not parse, JMA’s map_time.json is stale (§10.2), or JMA
says nothing changed — carries over: its file is the previous round’s
lines, byte for byte, less those that have expired by this round, and its
latest stays the previous round’s. Its sources[] entry says why (the
“nothing changed” case stays ok: true, with unchanged: true). A
carry-over has no end but its expiries, so a network that stays down shows
its last known warnings with an old latest and a failed source, rather
than none. A network with nothing to carry over (no previous round, or a
previous file that cannot be read) is left out of the round.
A network read from several sources carries over per source:
MeteoAlarm reads one feed per country, and a country whose feed failed
keeps its previous round’s lines (by native.country), byte for byte,
less the expired, beside the lines of the countries that arrived. The
network carries over as a whole only when no country arrived. CMA reads
one CAP file per message beside the listing, and a message the listing
names whose file did not arrive keeps its previous line (by its url).
8. sources[]
One entry per source, every network’s in turn, in build order:
ok: false always carries error. An ok source carries sha256
(optional), the SHA-256 of the raw bytes the network was read from, in
the order they were fetched: NWS active.json; JMA map_time.json, then
map.json when it was fetched; ECCC every page in turn; a MeteoAlarm
country its feed; CMA the listing, then each CAP file read in the
listing’s order; HKO warnsum then warningInfo, each in English,
Traditional and Simplified Chinese; CWA the bucket listing, then each CAP
file in name order. A reader holding
the upstream answer can tell whether a round was built from it.
reports is how many upstream
records the source held (features, JMA office reports); skipped how
many of them were not published — a test or a cancel message, an ended
ECCC feature, a JMA report from an office or a kind code the tables do
not know, an expired or green MeteoAlarm message, an expired CMA
message, an HKO entry cancelled or expired, a CWA file whose message is
expired or a Cancel. A network’s own fields are described in its section.
9. Geometry and boundary sets
Inline polygons. An upstream polygon (GeoJSON Polygon or
MultiPolygon) becomes a MultiPolygon as drawn, not simplified:
coordinates rounded to four decimals (about 11 m), positions the rounding
made repeat dropped, rings closed. A ring left with fewer than three
distinct corners has no area: such a hole is dropped, such an outer ring
drops its polygon, and an alert with no polygon left has geometry: null. Pure NumPy (xuebuild/alerts/geometry.py), so the build has no
GEOS dependency.
Boundary sets. A network that names areas by code rather than drawing
them has a boundary set: one PMTiles file of vector tiles per upstream
release, each feature carrying one property, id, the code a line’s
areas lists. Several features may share an id (an island county).
A display joins a round’s codes to the set — e.g. MapLibre with
promoteId: "id" and feature state, or a filter on ["get", "id"] —
reading only the tiles in view by HTTP range. A set is named
<set>.<version> by the day it was built, YYYYMMDD, with a letter
after it for a second build that day (20261112b; the upstream release
is named in its section); a new release or a new build recipe is a new file and a
new pin in the network table, and older rounds keep naming the
file they were built against, so a round and its boundaries never
disagree.
Beside each set, <set>.<version>.bbox.json holds every code’s box:
one object per layer in the set’s order, codes sorted, each box
[west, south, east, north] over all of the code’s features as released
(reprojected), rounded outward to four decimals so it
holds the area. It is pinned by length and CRC32 in the network table
like the tiles. The build reads it from the raw directory’s
alerts-areas/, fetching it once from the public data origin under
?v=<crc32> when it is missing there; a build that cannot have it (an
offline build without it, the origin down) leaves the boxes of the rows
that need it null and publishes anyway. How a network’s codes resolve
against the layers is in its section (§9.1 – §9.5).
Sets are built by hand, not by the five-minute build:
The tool runs ogr2ogr (reproject to EPSG:4326, keep the code
attributes, five-decimal GeoJSONSeq; nothing simplified: ogr2ogr -simplify treats each polygon alone and pulls neighbours apart) and
tippecanoe (zooms 0–11, --simplification=10 --low-detail=11 --detect-shared-borders --simplify-only-low-zooms, no tile size or
feature limit, tiny polygons kept so every code can be hit): below z11 a
line moves at most ten tile units, well under a screen pixel at the zoom
the tile is drawn at, and a shared border is simplified once for both
neighbours so they still meet; z11 holds the boundaries as released, so
a map zoomed past it overzooms exact edges. A Python pass between the
two builds each feature’s id and holds the
county and fire-zone layers back to z6. tippecanoe runs on relative names
inside a scratch directory, so the same release builds the same bytes and
the pinned CRC32 can be reproduced. It writes the box file beside the tiles
and prints both files’ lengths and CRC32s for the network table
(xuebuild/alerts/networks.py); the upload sends both and refuses to
replace an existing object of a different length.
Low-zoom thinning is tuned to two view budgets, measured with
pmtiles extract <set> <out> --bbox=… --minzoom=z --maxzoom=z (the size
of the extract, header and directories included):
| view | budget | measured |
|---|---|---|
CONUS z4, -125,24,-66,50 | ≤ 300 KB | 171 454 bytes |
all Japan z5, 122,24,146,46 | ≤ 200 KB | 82 446 bytes |
With no simplification at any zoom (--no-line-simplification) the same
views were 797 765 and 310 650 bytes and the files 65.5 MB and 26.9 MB.
9.1 nws-zones
The AWIPS shapefiles of https://www.weather.gov/gis/, which post the
current and the next release side by side under their effective date:
| layer | release | id | zooms | features | codes |
|---|---|---|---|---|---|
zone | public forecast zones z_16ap26 | STATE + Z + ZONE (OKZ025) | 0–11 | 4 157 | 4 080 |
county | counties c_16ap26 | STATE + C + last three digits of FIPS (OKC109) | 6–11 | 3 352 | 3 269 |
marine | coastal marine zones mz16ap26 | ID (ANZ639) | 0–11 | 569 | 569 |
offshore | offshore marine zones oz16ap26 | ID (PZZ900) | 0–11 | 130 | 130 |
fire | fire weather zones fz16ap26 | STATE + Z + ZONE | 6–11 | 3 683 | 3 603 |
nws-zones.20261102.pmtiles: 31 023 141 bytes, CRC32 879ebf6c;
nws-zones.20261102.bbox.json: 524 181 bytes, CRC32 05a06972. Other
views: CONUS z3 150 322 bytes, the southern Plains at z6
(-104,33,-94,40) 55 243, a 1° box around Oklahoma City
(-98,35,-97,36) at z9 4 576 and at z11 11 016.
Fire weather zones share the public zones’ Z code space but not their
shapes: a code resolves against the fire layer for the fire-weather
events (Red Flag Warning, Fire Weather Watch, Extreme Fire Danger,
Fire Warning) and against zone, county, marine and offshore
otherwise (the four do not share codes). The high seas areas (hz…)
are not UGC-coded and not in the set. Boxes resolve the same way: a
fire-weather event’s codes against fire, any other’s against zone,
county, marine and offshore in that order. Three marine zones and an
Aleutian county cross the antimeridian, so their boxes span every
longitude.
9.2 jma-class20
The agency’s 予報区等GISデータ (https://www.data.jma.go.jp/developer/gis.html),
市町村等(気象警報等), release 20260226_AreaInformationCity_weather_GIS:
one layer, class20, id regioncode (seven digits, the class20 codes of
the warning map), zooms 0–11, 1 805 features and codes, read as JGD2011
(EPSG:6668; the release ships without a .prj).
jma-class20.20261102.pmtiles: 12 593 916 bytes, CRC32 49385bc7;
jma-class20.20261102.bbox.json: 82 289 bytes, CRC32 c1108b5b. Other
views: all Japan z4 66 452 bytes, Kantō at z8 (138.5,35,140.5,36.5)
33 311, central Tokyo at z11 (139.6,35.6,139.9,35.8) 64 613. A line’s
codes resolve against class20.
Terms. The release is reused under the agency’s website terms (the Public Data License v1.0, https://www.jma.go.jp/jma/kishou/info/coment.html). Wherever the set or a map drawn from it is shown or redistributed it carries:
- 出典:気象庁「予報区等GISデータ」(https://www.data.jma.go.jp/developer/gis.html), 公共データ利用規約 第1.0版 (Public Data License 1.0, https://www.digital.go.jp/resources/open_data/public_data_license_v1.0);
- 加工:PMTiles 化 by xue — the set is converted to vector tiles by xue, and is not published by the Japan Meteorological Agency;
- the agency’s notice of the Geospatial Information Authority of Japan’s approval, as its GIS page gives it: この地図の作成に当たっては、国土地理院長の承認を得て、同院発行の数値地図25000(空間データ基盤)、数値地図(国土基本情報)、電子国土基本図(地図情報)を使用した。(承認番号 平30情使 第401号・令2情使 第125号・令3情使 第90号・令3情使 第123号・令3情使 第648号・令4情使 第437号・令5情使 第71号・令6情使 第382号・令7情使 第395号)
9.3 meteoalarm-areas
The MeteoAlarm areas named by a code whose boundaries are published under
open terms, each feature’s id the code a line lists (<valueName>:<value>,
§10.4). One set, several upstreams (fetched on 2026-11-01):
| layer | upstream | id | features |
|---|---|---|---|
de_kreise | DWD GeoServer WFS dwd:Warngebiete_Kreise (counties and county parts) | WARNCELLID: + WARNCELLID | 402 |
de_kueste | dwd:Warngebiete_Kueste (coasts) | WARNCELLID: + WARNCELLID | 8 |
de_binnenseen | dwd:Warngebiete_Binnenseen (lakes) | WARNCELLID: + WARNCELLID | 23 |
fr_departement | IGN Géoplateforme WFS ADMINEXPRESS-COG-CARTO.LATEST:departement | NUTS3: + the NUTS 2013 code of code_insee | 101 |
The DWD layers are https://maps.dwd.de/geoserver/dwd/ows?service=WFS&version=2.0.0&request=GetFeature&typeNames=dwd:Warngebiete_<Kreise|Kueste|Binnenseen>&outputFormat=application/json&srsName=EPSG:4326
and hold every warn cell Germany’s MeteoAlarm warnings name (433 cells;
the 11 214 municipality cells are not used by the feed). The IGN layer is
https://data.geopf.fr/wfs/ows?service=WFS&version=2.0.0&request=GetFeature&typeNames=ADMINEXPRESS-COG-CARTO.LATEST:departement&outputFormat=application/json&srsName=CRS:84.
Each is saved as <layer's upstream name>.geojson without its crs
member (the coordinates are longitude, latitude) and passed to
xue alerts-areas --set meteoalarm-areas, all zooms 0–11. Météo-France’s
warnings carry NUTS 2013 codes (FR711 is Ain); the département
codes are mapped to them by xuebuild/alerts/fr_nuts2013.json, the 101
level-3 codes of the NUTS 2013 classification (Commission Regulation (EU)
No 1319/2013) matched by name to the départements’ INSEE codes.
meteoalarm-areas.20261102.pmtiles: 3 563 611 bytes, CRC32 25117c18;
meteoalarm-areas.20261102.bbox.json: 28 815 bytes, CRC32 97b9b07f.
Views: Germany and France at z4 (-6,41,16,56) 23 725 bytes, at z5
33 668; Germany at z6 (5,47,16,55) 40 610; a 1° box around Munich
(11,47.6,12,48.6) at z11 17 860.
EMMA_ID codes are not in the set. MeteoAlarm’s Redistribution Hub
(https://meteoalarm.org/en/live/page/redistribution-hub) links an
official geocodes file and shapefiles for redistributors, but its terms
grant reuse only of the warnings (“Information”); its downloadable data
is “Content”, owned by EUMETNET and licensed to the Participants alone,
so those boundaries are not redistributed here.
Terms. Wherever the set or a map drawn from it is shown or redistributed it carries:
- for the German layers: “Datenbasis: Deutscher Wetterdienst, Warngebiete als Vektorkacheln aufbereitet” and “© GeoBasis-DE / BKG 2021 (Daten modifiziert)” — DWD geodata are reusable under CC BY 4.0 with a source note (https://www.dwd.de/DE/service/rechtliche_hinweise/rechtliche_hinweise_node.html), and the warn cells carry the BKG’s notice as a feature property;
- for the French layer: “IGN – ADMIN EXPRESS COG CARTO, Licence Ouverte 2.0 (https://www.etalab.gouv.fr/licence-ouverte-open-licence/), tuilé par xue”.
9.4 cma-areas
China’s provinces, prefectures and counties, each feature’s id its
six-digit administrative code (120115 宝坻区, 654200 塔城地区,
650000 新疆): the Amap outlines that cnmaps-data packages
(https://github.com/cnmetlab/cnmaps-data, MIT, commit e2a1a346,
2026-04-02), one GeoJSON file per code under
cnmaps_data/data/datasets/administrative/amap/land/. The set is built
from a snapshot of that directory kept beside the raw rounds
(data/raw/alerts-sources/cnmaps-data-e2a1a346/, the land files and the
index database as the commit holds them):
Before ogr2ogr, xuebuild/alerts/cnmaps.py turns every file from
GCJ-02 (the mainland’s offset datum, which Amap draws in, a few hundred
metres from WGS84) into WGS84 by fixed-point iteration on the published
forward formula, and files it under the layer its code names:
| layer | codes | features |
|---|---|---|
province | xx0000 | 34 |
prefecture | xxxx00 | 336 |
county | any other | 2 873 |
all zooms 0–11. 香港, 澳门 and 台湾 are one outline each under 810000,
820000 and 710000 (the release draws them at every level from the
same file), and Hong Kong’s eighteen districts (810001 …) are counties.
The national outline (100000) is not in the set. 沙湾市 is drawn under
its code since 2021, 654203, beside the county code the release files it
under (654223). 新林区 and 呼中区 (232703, 232704), 大兴安岭’s
management districts, have no division in the release, which draws their
land inside 呼玛县 (232721): both are drawn as 呼玛县’s outline under
their own codes, so a warning for either lights about twice the district.
cma-areas.20261112b.pmtiles: 21 166 362 bytes, CRC32 c1f9f588;
cma-areas.20261112b.bbox.json: 144 021 bytes, CRC32 7f44b60f. The
20261112 build before it lacked the two districts. Views (measured on
20261112, which differs only by the two districts):
all China z3 (73,18,135,54) 127 303 bytes, z4 162 563, z5 209 112; the
Pearl River Delta at z9 (113,22,114.5,23.5) 20 893; a 1° box around
Beijing at z11 80 105.
Terms. Wherever the set or a map drawn from it is shown it carries “边界:高德地图 (Amap), via cnmaps-data; GCJ-02 → WGS84 and tiling by xue”. The outlines are a commercial map provider’s, packaged by cnmaps-data under its MIT licence without a licence from the provider for redistribution; they are boundaries to place warnings by.
9.5 tw-areas
Taiwan’s counties and special municipalities, each feature’s id its
five-digit code (65000 新北市, 10013 屏東縣, 09020 金門縣), and its
townships and districts by their eight digits (65000260 貢寮區,
10013040 恆春鎮): the Ministry of the Interior’s town boundaries
(鄉鎮市區界線, TWD97 longitude and latitude), release 1120317
(2023-03-17), as the National Land Surveying and Mapping Center serves
them (https://data.gov.tw/dataset/7441; the zip from
https://maps.nlsc.gov.tw/download/鄉鎮市區界線(TWD97經緯度).zip, whose
TOWN_MOI_1120317.shp the tool reads). The county release the same
portal lists is served from TGOS, which answered 403 to a download on
2026-12-01; the towns carry COUNTYCODE, so the counties are dissolved
from them instead (ogr2ogr -dialect sqlite, ST_Union by code), the
same outlines without the town borders inside:
| layer | codes | features |
|---|---|---|
county | COUNTYCODE, five digits | 22 |
town | TOWNCODE, eight digits | 368 |
all zooms 0–11. TWD97 is realised on ITRF and taken as WGS84, as GDAL does: no shift. The release draws 高雄市旗津區 with the islands of the South China Sea it administers, so 高雄市’s box and 旗津區’s reach 10°N.
tw-areas.20261201.pmtiles: 1 270 219 bytes, CRC32 2826bd6a;
tw-areas.20261201.bbox.json: 18 168 bytes, CRC32 2637e6e0. Views:
Taiwan z5 (114,10,125,27) 14 247 bytes, z7 (118,21.5,122.5,26.5)
22 419; Taipei at z11 (121.4,24.9,121.7,25.2) 108 253.
Terms. The boundaries are government open data under the Open Government Data License, Taiwan, version 1.0 (政府資料開放授權條款-第1版, https://data.gov.tw/license), which asks that the source be named. Wherever the set or a map drawn from it is shown it carries “界線:內政部國土測繪中心「鄉鎮市區界線」(政府資料開放授權條款第 1 版);縣市合併與切片 by xue”.
10. Networks
10.1 nws — US National Weather Service
Every alert the US National Weather Service has in force, from
nws-alerts — https://api.weather.gov/alerts/active?status=actual, one
GeoJSON FeatureCollection of CAP 1.2 alerts nationwide (about 1.7 MB,
115 KB gzipped, on 2026-10-31). The service requires a User-Agent that
says who is asking and how to reach them; every request carries
xue/<version> (+https://github.com/ringsaturn/xue). No rate limit is
published; one request every five minutes is far inside what it expects.
Reading:
- A feature whose
statusis notActual, or whosemessageTypeisCancel, is not in force. The alerts aCancelreferences end ascancelled; those any other message references (anUpdate’s predecessor) are itsreplacesand end asreplaced. expiresis CAPends(when the event ends) where the alert states one, else CAPexpires. The API keeps listing an alert until its event ends, long after its last message expired — a third of the alerts on 2026-10-31 were marine and flood alerts whose message had expired days earlier — so filtering on the message’s expiry would drop alerts the service itself shows as in force. The message’s own expiry is innative.expires.onsetis CAPonset, elseeffective.native:event;code, the NWS event code (eventCode.NationalWeatherService, e.g.SCY,TOW);level, CAPseverity;urgency;certainty;vtec, the first P-VTEC string;expires, the message’s expiry.texts.en:headline,description,instruction, andarea(CAPareaDesc).areas:geocode.UGC, in the service’s order — public zones, counties and marine zones, drawn bynws-zones(§9.1).geometry: the storm-based polygon where there is one.url: the alert’s API document (@id);sender:senderName.
latest is the collection’s updated.
Terms. Works of the US federal government; the API’s documentation
describes its data as open data, free to use for any purpose. license
public-domain, licenseUrl https://www.weather.gov/disclaimer,
attribution US National Weather Service, url https://www.weather.gov/.
10.2 jma — Japan Meteorological Agency
The agency’s warnings and advisories (気象警報・注意報) as its own warning
map reads them; there is no published API and no service commitment.
jma-warning:
https://www.jma.go.jp/bosai/warning/data/r8/map_time.json—{"latestControlDatetime": …}, the time of the newest report. Recorded asmapTime.https://www.jma.go.jp/bosai/warning/data/r8/map.json— every forecast office’s latest report per element group, nationwide (about 900 KB, 40 KB gzipped). Not fetched whenmapTimeequals the network’slatestin the previous round: the source is thenokwithunchanged: trueand the previous lines carry over (§7).
The r8 documents follow the warning system in force since late May 2026
(レベル2注意報 … レベル5特別警報, with the new レベル4危険警報); the
earlier bosai/warning/data/warning/ documents stopped updating on
2026-05-28.
Health. If mapTime is more than six hours before the fetch, the source
is ok: false with the error map_time.json has not advanced since … and
the network carries over: the map has moved once already, and a frozen
map must not pass for a calm country. The map only moves when a report
changes, and quiet nights leave it still for well over half an hour, so
the threshold is hours, not minutes.
Reading. A report lists, for each municipality-level area (class20,
seven digits) of its office, the kinds in it with a status: 発表
(issued), 継続 (continued), 解除 (lifted), 危険警報から注意報 (a 危険警報
lowered to 注意報) or 発表警報・注意報はなし (none). A kind is in force in
an area when it has a code and its status is anything but 解除; a kind
whose status is 危険警報から注意報 is the 注意報 now in force, and its line
replaces the office’s 危険警報 for the element (unless that is still in
force elsewhere in the office). One alert
is one (office, kind) in force anywhere, with every area it is in force
in:
idjma:<office>-<kind>, the office being the forecast office’s area code (130000Tokyo), matched by the report’spublishingOfficename inxuebuild/alerts/jma_offices.json— theofficeslevel of the agency’sbosai/common/const/area.json, 58 entries, committed. A report from an office the table does not know is skipped and counted.eventandnative.event: the agency’s own name with its レベル prefix where it has one (レベル2大雨注意報,雷注意報);native.codethe kind code;native.levelthe page’s level number (20,30,40,50);native.elementthe page’s element name (rain,landslide, …).sent: the report’sreportDatetime;onsetandexpires:null.texts.ja.headline: the report’sheadlineText, the only text the map carries (it covers the office’s whole report, not this kind alone).areas: the class20 codes, sorted; drawn byjma-class20(§9.2).url: the office’s page on the warning map;sender: thepublishingOffice.
latest is mapTime.
Terms. The agency’s website content is reusable, commercially included,
under the Public Data License v1.0 with the source credited —
「出典:気象庁ホームページ」 — and, for edited content, a statement that it
was edited; it must not be presented as the agency’s own publication
(https://www.jma.go.jp/jma/kishou/info/coment.html). The lines are
edited content (the agency’s map reorganised by office and kind). The
boundary set the network names carries its own credit and the survey
approval notice (§9.2).
license PDL-1.0, licenseUrl
https://www.jma.go.jp/jma/kishou/info/coment.html, attribution
出典:気象庁ホームページ (Japan Meteorological Agency), url
https://www.jma.go.jp/bosai/warning/.
10.3 eccc — Environment and Climate Change Canada
Environment and Climate Change Canada’s public weather alerts, from
eccc-alerts — the MSC GeoMet OGC API collection
https://api.weather.gc.ca/collections/weather-alerts/items?f=json&limit=1000,
following next links if there are any (pages). The collection is every
alert in force nationwide, one feature per alert and forecast region,
each with the region’s polygon and English and French texts.
Reading:
- One feature is one alert,
ideccc:<feature id>(the CAP identifier and the region), so the texts and the polygon stay together. A feature whosestatus_enisendedorcancelledis not in force and ends ascancelled. eventandnative.event:alert_name_en(fog advisory).native:codealert_code(FGA),levelrisk_colour_en,typealert_type,impactimpact_en,confidenceconfidence_en,statusstatus_en,province,endsevent_end_datetime.sentpublication_datetime,onsetvalidity_datetime,expiresexpiration_datetime.texts.enandtexts.fr:headline(alert_name_*),description(alert_text_*),area(feature_name_*).areasis empty andgeometrythe region’s polygon: every alert draws its own area, so the network has no boundary set (areas: null).urlandsender:null; noreplaces, since the collection’s features carry no references to earlier alerts.
latest is the collection’s timeStamp.
Terms. Open Government Licence – Canada
(https://open.canada.ca/en/open-government-licence-canada). license
OGL-Canada-2.0, licenseUrl the same page, attribution
Contains information licensed under the Open Government Licence – Canada (Environment and Climate Change Canada),
url https://weather.gc.ca/.
10.4 meteoalarm — EUMETNET – MeteoAlarm
The awareness warnings of Europe’s national meteorological and
hydrological services (the MeteoAlarm Participants) as MeteoAlarm
aggregates them, one JSON feed per country:
https://feeds.meteoalarm.org/api/v1/warnings/feeds-<country>, CAP 1.2
under the MeteoAlarm CAP profile v2.0, one alert per warning and one
info block per language. Each country is a source,
meteoalarm-<country> (§8), for the 38 feeds of andorra, austria,
belgium, bosnia-herzegovina, bulgaria, croatia, cyprus, czechia, denmark,
estonia, finland, france, germany, greece, hungary, iceland, ireland,
italy, latvia, lithuania, luxembourg, malta, moldova, montenegro,
netherlands, norway, poland, portugal, republic-of-north-macedonia,
romania, serbia, slovakia, slovenia, spain, sweden, switzerland, ukraine
and united-kingdom. Israel’s feed is not read.
The feeds are uncompressed, carry no ETag or Last-Modified, and are slow (Germany’s 1.5 MB takes 20–30 s), so every round fetches every feed, eight at a time, each within two minutes, retries included; a feed that fails or is late fails alone and its country carries over (§7). On 2026-11-01 07:30 UTC the fetch took 10.0 MB in 54 s and under 90 MB resident.
Reading:
- A feed lists messages that have expired; a message is in force while
the latest
expiresof itsinfoblocks is after the round. A cancelled warning is not in the feed at all (the profile keepsCancelmessages out of it), so it ends asgone; a message whosestatusis notActualor whosemsgTypeisCancelis skipped all the same. - Green messages (
awareness_level1) are skipped (§3.4). eventandnative.event: the firstinfoblock’sevent, in the service’s first language (STURM,Avertissement vent).native:codetheawareness_typeandleveltheawareness_level, verbatim (7; coastalevent,3; orange; Severe); CAPseverity,urgency,certaintyandmsgType;country, the feed’s ISO 3166 code (DE).sentthe alert’ssent;onsetthe first block’sonset, elseeffective;expiresthe latestexpires.texts: every language’s block under its ownlanguagetag as the service gives it (de-DE,en,sr-Latn), withheadline,description,instructionandarea(the block’sareaDescs joined by;), verbatim. A tag that is not BCP 47-shaped is dropped.- Areas. An area with a
polygonis drawn by it (unless the message setsuse_polygon_over_geocodetoFalse):geometryholds every such area’s polygon. An area without one is named by one of its geocodes as<valueName>:<value>: its DWD warn cell where it has one (WARNCELLID:501000005; Germany gives anEMMA_IDbeside it), else itsEMMA_ID(EMMA_ID:IT001), else its first geocode (France, Bulgaria, Romania and North Macedonia name NUTS 3 regions,NUTS3:FR711; Belgium and Hungary NUTS 2; Ireland FIPS).areaslists those codes. The two are disjoint parts of the warned area — a service may draw some areas and name others — so a display draws both and the row’s box covers both (§5). The codes resolve againstmeteoalarm-areas(§9.3), which holds Germany’s warn cells and France’s départements; any other code has no box yet, and its line’s row has four nulls. url: the issuing service’s own warnings page, the first block’s CAPweb;sender: itssenderName, the issuing service.replaces: CAPreferences, space-separatedsender,identifier,senttriples, asmeteoalarm:<identifier>.
latest is the newest sent of any message the feeds that arrived
listed, expired ones included.
Terms. MeteoAlarm Terms and Conditions §5 (https://meteoalarm.org/en/live/page/terms-and-conditions): the warnings (“Information”) may be used and redistributed under terms equivalent to CC BY 4.0, with these further requirements, and the product and any display of it meets them so:
- modified Information must be redistributed with the same Information unmodified — every line keeps every language’s texts and the profile’s awareness parameters verbatim beside the derived category and level;
- Information that spans more than one country is credited
“EUMETNET – MeteoAlarm” (the network’s
attribution); Information for one country names its MeteoAlarm Participant — every line’ssenderis the issuing service, and a display shows it with the warning; - the time of issue is included — every row and line carries
sent, and a display shows it; - an internet application links to www.meteoalarm.org
(https://meteoalarm.org/en/live/, the network’s
url); - operational redistribution is real time: on average under five minutes and never more than ten behind MeteoAlarm. A round is built every five minutes and takes about a minute to fetch and publish, so a warning reaches the bucket about three and a half minutes after MeteoAlarm on average and under seven at most, while the publisher runs;
- every redistributor publishes this disclaimer, which this document, the STAC Collection and the display carry: “Time delays between this website and the www.meteoalarm.org website are possible. For the most up-to-date awareness information as published by the participating National Meteorological and Hydrological Services, please refer to www.meteoalarm.org.”
license MeteoAlarm-Terms, licenseUrl the terms page, attribution
EUMETNET – MeteoAlarm, url https://meteoalarm.org/en/live/.
10.5 cma — China Meteorological Administration
The warning signals (预警信号) China’s meteorological observatories
issue, as far as the WMO Severe Weather Information Centre aggregates
them. SWIC (https://severeweather.wmo.int/)
is WMO’s centre for official CAP warnings, developed and run by the Hong
Kong Observatory. The CMA’s own feed in the WMO Register of Alerting
Authorities (http://www.12379.cn/rss/china_rss.xml) answered 404 on
2026-11-12, and the national release centre’s site (12379.cn) publishes no
interface of its own (on 2026-11-14 its http site answered only a
“系统升级中” page dated 2024-01-17, its https site did not connect).
Coverage is SWIC’s, not the CMA’s. Between 2026-11-12 and 2026-11-14
(1 166 messages) SWIC carried prefecture and county observatories from
21 provinces, but of the province-level offices only the municipalities
Beijing (110000), Tianjin (120000) and Chongqing (500000), no
provincial observatory and not the National Meteorological Centre. No
message at all came from Inner Mongolia (15), Liaoning (21), Fujian
(35), Henan (41), Hunan (43), Guangxi (45), Hainan (46), Sichuan
(51), Shaanxi (61) or Gansu (62). The NMC’s own warning pages carry
the provincial warnings but forbid download without authorisation, so
they are not read. The credits say what is missing.
cma-swic:
https://severeweather.wmo.int/json/wmo_all.json— every alert SWIC has in force worldwide (1 802 on 2026-11-12, 903 KB), each with the path of its CAP file; China’s are those undercn-cma-xx/(cn-cma-xx/YYYY/MM/DD/hh/mm/ss-<md5>.xml). Saved as fetched.https://severeweather.wmo.int/v2/cap-alerts/<path>— one CAP 1.2 message per file, about 3.5 KB. A path carries the message’s digest, so a file never changes: fetched files are kept in<raw>/alerts-cache/cma/while the listing names them, a round fetches only the ones it has not seen (eight at a time) and copies every listed file into its owncma/cap/asYYYYMMDDhhmmss-<md5>.xml. The status recordsnew, the files fetched this round, andmissing, those that failed.
Reading:
- A message whose
statusis notActualor whosemsgTypeisCancelis not in force, nor one whoseexpiresis at or before the round. SWIC lists no cancels: a lifted signal leaves the listing and ends asgone. AnUpdatenames the message it updates inreferences(sender,identifier,sent, the sender possibly holding a comma itself, so the identifier is read second from the end); that is itsreplaces. - The primary block is the
zh-CNone.eventandnative.event: itsevent(大雾).native:codenull;levelCAPseverity;colourthe signal’s colour (blue,yellow,orange,red, §3.5);eventEn, the English block’sevent(Dense fog); CAPurgency,certaintyandmsgType;geocodes, the area’s twelve-digit CPEAS codes as given. sentthe message’ssent;onsetonset, elseeffective;expiresexpires.texts:zh-CNanden-US, as given, withheadline,description,instructionandarea(areaDesc).areas: the first six digits of eachCPEAS Geographic Code(the administrative code of the county, prefecture or province), drawn bycma-areas(§9.4). A township’s code (its last six digits not zero) is drawn by its county, andnative.geocodeskeeps the twelve digits. A prefecture observatory often codes a city-wide warning to its seat county alone (Langfang’s 大雾 to 安次区131002, its text saying 全市): when the identifier’s first six digits, the issuing office’s code, are a prefecture’s (XXYY00, not a province’sXX0000) and the message’s one code is a county of that prefecture,areasis the prefecture (131000). Several codes, or the prefecture’s own, are kept as given.geometryisnull: the messages carry no polygon.url: the message’s CAP file at SWIC;sender: CAPsender, its underscores as spaces (Nongan County Meteorological Observatory). The person named insenderNameis not published.
latest is the listing’s lastUpdated (UTC, written without a zone).
Terms. SWIC’s notes to users (https://severeweather.wmo.int/note.html):
the information “is free for re-use by media or other websites. When doing
so, it should be indicated that they are issued by the respective …
NMHSs.” Every line names its issuing observatory in sender, and the
network’s attribution names the CMA and SWIC. license WMO-SWIC,
licenseUrl the notes page, attribution
China Meteorological Administration, via the WMO Severe Weather Information Centre,
url https://www.12379.cn/.
10.6 hko — Hong Kong Observatory
The warnings and signals the Observatory has in force, from its open data
API on DATA.GOV.HK. hko-warnings fetches six documents a round,
https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=<kind>&lang=<lang>
for warnsum (the summary: one entry per warning statement in force, its
code, type, actionCode, issueTime, expireTime and updateTime)
and warningInfo (each statement’s text), in en, tc and sc; a
round reads them together, and any one failing fails the source.
Reading:
- One entry of the English
warnsumis one alert,idhko:<code>-<issueTime>(the issue time in UTC,YYYYMMDDThhmmssZ): the API has no identifier, and a warning issued again, or raised to another signal or colour (a new code), is a new alert; the one it follows ends asgone. An entry whoseactionCodeisCANCEL, or the tropical cyclone codeCANCEL(all signals lowered), is not in force; the alert it names ends ascancelled. eventandnative.event: the Englishname(Rainstorm Warning Signal).native:codethe warning’s code (WRAINR,TC8NE),levelthe Englishtype(Red,No. 8 North East) ornull,statementthe summary key (WRAIN),actionactionCode.sentupdateTime, elseissueTime;onsetissueTime;expiresexpireTime, ornull(most warnings stay in force until cancelled).texts:en,zh-Hant(tc) andzh-Hans(sc);headlinethe language’sname, with itstypein parentheses where there is one (暴雨警告信號 (黃色));descriptionthe statement’swarningInfocontents, paragraphs joined by blank lines.areas:["810000"], the Hong Kong SAR’s code: every warning covers the territory, drawn bycma-areas(§9.4).geometrynull.url: the Observatory’s warnings page;sender:Hong Kong Observatory.
latest is the newest updateTime (or issueTime) of the English
summary, null when nothing is in force.
The Observatory’s CAP feed (https://alerts.weather.gov.hk/V1/cap_atom.xml,
registered with WMO) carries the same warnings with a polygon, but it is
website material, whose commercial use needs the Observatory’s prior
written authorisation; the API is a DATA.GOV.HK dataset.
Terms. DATA.GOV.HK terms and conditions of use
(https://data.gov.hk/en/terms-and-conditions), with the source and its
ownership acknowledged. license DATA.GOV.HK, licenseUrl the terms
page, attribution Hong Kong Observatory, HKSAR Government (DATA.GOV.HK),
url https://www.hko.gov.hk/en/wxinfo/dailywx/wxwarntoday.htm.
10.7 cwa — Central Weather Administration
The weather warnings (天氣特報: rain, strong wind, low and high
temperature, dense fog …) and typhoon warnings Taiwan’s Central Weather
Administration has issued, from its open data bucket. cwa-warning
lists https://cwaopendata.s3.ap-northeast-1.amazonaws.com/?list-type=2&prefix=Warning/
(an anonymous S3 ListObjectsV2, saved as cwa/listing.xml) and fetches
every Warning/W-C<4 digits>-<3 digits>.cap it names into cwa/cap/,
about ten files of a few kilobytes; any one failing fails the source. The
bucket keeps one file per warning product (W-C0033-003 rain,
W-C0033-006 strong wind, W-C0034-001 typhoon …), the product’s latest
message, overwritten in place by the next: most are an expired message or
a Cancel. The REST interface of the same open data platform
(opendata.cwa.gov.tw/api/…) needs a member’s key; the bucket does not.
Reading:
- A message whose
statusis notActualis skipped. ACancelis not in force: the alerts itsreferencesname, and its own identifier, end ascancelled(each with every colour suffix, so a message of several blocks is lifted whole). Any other message names the messages it updates inreferences(sender,identifier,senttriples, newest first); that is itsreplaces. - Each
infoblock in force (itsexpiresafter the round) is a line. All blocks are inzh-TW; a message holds several when the warning has several tiers at once (the heat information’s orange and yellow towns), and each block is thencwa:<identifier>/<colour>, its colour fromalert_color(or its position,/2, without one), withreplacesnaming the same colour of the messages it references. eventandnative.event: the block’sevent(強風).native:codetheeventCodevalue of theprofile:CAP-TWP:Event:1.0scheme (strongWind);leveltheseverity_levelparameter (強風黃色燈號), else CAPseverity;colourthe tier’s colour (yellow,orange,red,purple, §3.7) ornull; CAPseverity,urgency,certaintyandmsgType;geocodes, every geocode as given,<valueName>:<value>.sentthe message’ssent;onsetonset, elseeffective;expiresexpires.texts:zh-TW, withheadline,description,instructionandarea(theareaDescs,;-joined).areas: each geocode as thetw-areascode (§9.5) it is drawn by.Taiwan_Geocode_103names a special municipality by two digits (65→65000), any other county by its five, and a town by seven: a municipality’s district is its two digits,0, the district’s two and00(6502600→65000260), another county’s town is the county’s five and the town’s two (1001304→10013040).Taiwan_Geocode_112, in typhoon warnings, is the eight-digit town code, a county’s ending000(10017000→10017). A geocode of another form is kept innative.geocodesand drawn by nothing.geometryisnull: the messages carry no polygon.url: the block’sweb, the CWA’s page for the warning, else the warnings overview;sender:senderName(中央氣象署).
latest is the newest sent of any CAP file the bucket holds, in force
or not.
The same messages reach the National Science and Technology Center for
Disaster Reduction’s CAP feed (https://alerts.ncdr.nat.gov.tw/RssAtomFeed.ashx,
which also carries other agencies’ alerts and earthquakes); the bucket is
read because it is the issuing agency’s own.
Terms. Open Government Data License, Taiwan, version 1.0
(https://data.gov.tw/license), with the CWA named as the source.
license OGDL-Taiwan-1.0, licenseUrl that page, attribution
中央氣象署 (Central Weather Administration, Taiwan) open data, url
https://www.cwa.gov.tw/V8/C/P/Warning/FIFOWS.html.
11. Validation
The JSON Schemas of §5 and §6 are normative for shape: a file that does
not match them is not an alerts file. tests/test_schemas.py holds
the committed golden to them, and the shell’s validators are generated
from them (web/src/schema/generated/). xuebuild/alerts/schema.py
checks, as every file is written and read, what a schema cannot say: file
names and the boundary sets’ climb, unique networks, categories, area
codes and replaces, columns against the v1 layout, the rows sorted
under their network with a category the index lists, four bounds or none
to four decimals and not inverted, the spans in row order inside the
network file, the ended[] rules of §7, a line’s network that of its id
and a category of §2, its language tags, and closed four-decimal rings.
tests/test_alerts.py holds two consecutive rounds built from the fetched
fixture (tests/fixtures/alerts/alerts.202611010000/ and …0005/, the
raw rounds, which stay flat under the raw root, with
the boundary sets’ box files in alerts-areas/) to the
committed golden (tests/fixtures/alerts/expected/), regenerated by
tests/prepare_alerts_golden.py. The second round exercises every
ended[] reason (an NWS Update for replaced), an NWS cancel, a stale JMA map carried over, a failed
ECCC fetch carried over with an expiry, a failed MeteoAlarm country
carried over beside two that arrived, a CMA message whose file did not
arrive carried over beside an Update (replaced), an expiry and a code
the boundary set lacks, and an HKO rainstorm raised from amber to red
(gone), a cancel and an expiry; every index row’s span is checked
against the network file it addresses. Admission is structural: a
network, an event or a native field a reader has never seen is not an
error; the categories are the index’s own list, the levels 1 … 5, the
times ISO 8601 UTC, the geometry closed four-decimal rings. A reader
validates the same shapes on read and rejects a schemaVersion above the
one it implements.
Sizes on a calm day (2026-10-31 15:20 UTC): nws.jsonl 380 alerts,
578 KB (61 KB gzipped); jma.jsonl 46, 33 KB (3 KB); eccc.jsonl 5,
31 KB (10 KB); index.json 89 KB (11 KB). A stormy day is five to ten
times that, mostly NWS text and polygons. MeteoAlarm on 2026-11-01 07:30
UTC: 221 warnings in force (1 222 unexpired messages, 1 001 of them
green), meteoalarm.jsonl about 450 KB (35 KB gzipped) — every language
kept — and 38 source entries in the index. CMA on 2026-11-12 02:35 UTC:
152 warnings in force, cma.jsonl 391 KB (49 KB gzipped), Chinese and
English kept; the round’s raw directory holds the 903 KB SWIC listing and
624 KB of CAP files, all but the new ones copied from the cache.
12. The archive
A round is a snapshot that lives three hours. The archive is the record:
every alert that was in force in some round of a UTC month, once, as the
last version of it a round of that month published, with when it ended
and why. It is a separate tree under the data root, written by the
publisher (xue alerts-archive) and never pruned.
12.1 Layout
catalog.jsonis requested withCache-Control: no-cache, as the pointer is (§1). Each entry names a month’s index bypath(relative to the catalog),byteLengthandcrc32; the index names its.jsonlthe same way. Every file but the catalog is requested as<path>?v=<crc32>.- A month is the UTC month of a round. An alert in force across the turn of a month is in both months’ files, each holding the version that month last published.
- The month in progress is rewritten in place at most once an hour (the first round of each hour folds in the rounds before it), and its CRC32 changes with it; a month is final once the first hour of the next has been folded in. Nothing in the files records when they were built: the same records give the same bytes.
12.2 Records
A line of alerts.jsonl:
idandnetworkare the alert’s (§4), repeated so a slice read by range identifies itself.alertis the alert’s line (§6) as the month’s last round that listed it published it, byte for byte the same object: a later version under the same id replaces an earlier one.firstis the first round of the month whose snapshot listed the alert (itsissued): for an alert carried in from the month before, the month’s first round.endedisnullwhile the alert was still in force at the month’s last round (or, for the month in progress, at the last round folded in); elsetime, the round whoseended[](§7) listed it,reason, andbyforreplaced, as that entry gave them. An alert listed again after it ended (a network carried over again) is in force once more and itsendedisnull. An end found in the first round of a month is recorded in the month the alert was last in force.
12.3 Indexes
A month’s index.json:
networks are the ids of the networks the month holds, sorted. A row is
[id, network, category, level, event, first, ended, reason, offset, length]: network the position in networks, category, level and
event the alert’s (§5), first the record’s, ended and reason its
ended.time and ended.reason or two nulls, and offset and length
the byte span of the record’s JSON object in alerts.jsonl, without the
newline. Rows are sorted by id and unique and their spans tile the file
in order.
columns (optional) names the columns of rows, and a reader finds a
column by its name there. In archive v1 it is always the layout above, so
a reader that indexes by position reads it too; month indexes written
before it (every month up to 2026-11-05) do not carry it, and a reader
takes their rows in the layout above.
catalog.json:
months are sorted and unique. A reader rejects an archiveSchemaVersion
above the one it implements.
The shapes are normative in
schemas/alerts-archive-catalog.schema.json,
alerts-archive-index and, for a
line of §12.2’s files,
alerts-archive-line, whose
alert is alerts-line;
tests/test_schemas.py holds an archive it folds from the committed rounds
to them. What they cannot say, the order, uniqueness and tiling above, a
row’s network position and its two nulls together, columns against the
v1 layout, and by for replaced alone, is each reader’s own check.
12.4 The producer
The rounds on the bucket last three hours, so the archive is fed by the publisher as it goes, from the state it keeps on its own disk:
- After each round is published,
xue alerts-archive --round <round>compares the round with the one before it (the live round the build measuredended[]against): every line that is new or whose bytes changed, and everyended[]entry, is appended to a journal in the publisher’s state directory. A round with no round before it in the same month journals every line. - When the journal holds a round of an earlier hour than the current one
(or with
--compact), it is folded into the month files under the state directory, in journal order: a line replaces the record’salertand clears itsended,firststays the earliest, an end setsended. The month file is merged as a stream, so the journal, not the month, bounds the memory it takes. The files that differ from what the published catalog names are listed in the report, each before the file naming it, the catalog last, and uploaded in that order (make upload-r2-alerts-archive); a failed upload is listed again by the next fold. - A month the state directory lacks but the published catalog names is pulled from the data origin first (CRC32 checked), so a new host or a lost disk continues the published record rather than restarting it. A catalog the origin cannot serve (other than not existing) stops the fold, and the journal waits for the next one.
- Months before the previous one that the published catalog already holds as they are on disk are removed from the state directory.
What a reader cannot learn from the archive: the versions of an alert
between the first and the last of a month (an NWS Update is a new id
and so a new record; a change under the same id keeps only the last
version), and anything that happened in a round the publisher missed.
Part of the Xue specification, licensed under CC BY 4.0.
15 - The nexrad product
In the viewer: the WSR-88D sites over the MRMS mosaic (/mrms?type=radar&radar=on), one site’s sweep with ?radar=<site>, and the Rolling Fork case /showcase/rolling-fork-2023.
A single weather radar sees what no mosaic shows: the wind along its own
beams, and the reflectivity close to the antenna at a quarter of a
kilometre. The US WSR-88D network publishes both for every site as Level 3
products, and nexrad carries two of them for every site — the lowest
sweep’s reflectivity (n0b) and radial velocity (n0g) — as a rolling
three-hour window of polar stores, one
immutable store per product per five-minute round. Reflectivity mosaics
stay the mrms source’s; velocity cannot be mosaicked at all, since each
radar measures it along its own beams. This document is the normative
description of the product, schema v1.
The shell’s live view does not read those stores: it reads the source’s
own Level 3 objects straight out of the source bucket (§7), so nothing is
built for a site nobody opens. The stores are what xue nexrad-build
writes and what a showcase case keeps.
1. Delivery
Everything is a static file under the data root, beside the run pointers and the point products.
latest-nexrad.jsonis the one mutable object; fetch it with caching disabled. It names the newest round’s window manifest:The shape and the
?v=<crc32>rule are the point products’ pointer (tc.md§1);pathis alwaysnexrad.<round>/index.json.nexrad.<YYYYMMDDHHMM>/is one immutable directory per round: the UTC minute the round was built for, a multiple of five. It holds one polar store per product,n0b.zarr/andn0g.zarr/, the round’sindex.json(§4) and its STACitem.json. Nothing in it changes once the pointer has named it. Rounds are flat under the data root.A round’s stores hold the sweeps that became available since the previous round (§3), not the whole window: a round is written once and never rebuilt, and the window is the list of rounds its manifest names. Rounds older than the window are pruned after the pointer has moved past them.
Deployment is one-sided: a new pointer and new directories, which a shell that does not know the product never requests.
A showcase case is a closed window, rebuilt never: it is written as
one window store per product for the whole
case instead of one round store per round, beside one window manifest:
showcase/<id>/radar/n0b.zarr/, n0g.zarr/ and index.json. The rounds
are the same rounds (§3), replayed over the case’s interval with a window
as long as the case; only where their sweeps are stored differs (§4). A
case has no pointer and no per-round directories or STAC items: the
showcase catalog names its index.json.
2. Products, codes and geometry
| product | source | quantity | unit | beams × gates | quantization | reserved codes |
|---|---|---|---|---|---|---|
n0b | Level 3 N0B (153) | base reflectivity, lowest sweep | dBZ | 720 × 1840 | linear, scale 0.5, offset −33.0, codes 2–255 (−32.0 … 94.5 dBZ) | 0 below threshold, 1 range folded |
n0g | Level 3 N0G (154) | base radial velocity, lowest sweep | m/s | 720 × 1200 | linear, scale 0.5, offset −64.5, codes 2–255 (−63.5 … 63.0 m/s) | 0 below threshold, 1 range folded |
- The codes are the source’s own: the product’s data levels are copied
byte for byte, so the codebook above is the source’s (
value = −32.0 + 0.5 × (code − 2)for N0B,−63.5 + 0.5 × (code − 2)for N0G, written ascode × scale + offset). A file whose threshold header describes any other codebook is refused rather than requantized. - Velocity sign: positive is motion away from the radar
(
signConvention: "positive_away"). The source’s velocity is already dealiased; range-folded gates keep code 1. - Geometry: beams every 0.5° from 0° (true north, clockwise), each source radial binned by its centre azimuth; gates every 0.25 km of slant range from the antenna, the first gate starting at 0. N0B therefore reaches 460 km and N0G 300 km.
scan_timeis the sweep’s own start time from the product header. For a supplemental low-level sweep (SAILS / MESO-SAILS) it is that sweep’s start, not the volume’s, so every sweep of a site has a distinct time; it equals the time in the source object’s key.elevationis the sweep’s elevation angle from the product header (nominally 0.5°).
3. Rounds
A round R (UTC, minute divisible by five) takes, per site and product,
every source sweep with scan_time ≤ R that no earlier round of the
window carries — the window manifest records each site’s newest sweep, and
the next round starts after it. A sweep that arrives late therefore lands
in the next round rather than being lost, and no sweep is in two rounds.
n0b and n0g are assembled independently; a site may have a sweep in
one product’s store and not yet in the other’s.
A round’s store lists only the sites with at least one sweep in it, in the order of the window’s site table (§4). A round in which no site has a new sweep for a product writes no store for it.
4. index.json, the window manifest
A round’s index.json is the window manifest: a read accelerator over the
round stores, which are complete without it. It takes the place a point
product’s index takes, so the pointer is the point products’ exactly.
sitesis the window’s site table:[id, icao, latitude, longitude, height], the source’s three-letter id, the four-letter ICAO, the antenna’s WGS84 position and its height above mean sea level in metres. Every index below is a position in it.roundsis oldest first, every round insidewindowSecondsbeforeissued.pathis the directory holding the round’s stores, relative to this manifest:../nexrad.<round>/for a round store,./for a window store beside the manifest (a case, §1).- Per product:
groupmeasures the store’s rootzarr.json(its?v=),shardthe data array’s one shard object (<product>/c/0/0/0/0), andchunksgives one[site, offset, length, sweeps]per site the store holds, in store order: the byte span of that site’s inner chunk in the shard and how many of itsscanslots are real sweeps. A reader fetches[offset, offset + length)of the shard directly, without the shard index, decompresses it todepth × 720 × gatesbytes and keeps the firstsweepsslots.depthis the store’s inner chunk depth: in a round store the largestsweepsof the round’s rows; in a window store the product block says it as"depth": 3, the same in every round, since the store’s chunk is padded to its busiest site’s busiest round. In a window store every round’sgroupandshardmeasure the same two objects, and a round’schunksare spans in that one shard. scansgives, per site in the store, the sweeps’ start times (Unix seconds UTC, ascending) — the store’sscan_timerow without its padding, so a player builds a site’s timeline from the manifest alone. It is per product, since the two products of a round are assembled independently (§3).- A product with no store in a round (no site had a new sweep) is absent from that round’s entry.
sourcesis the point products’sources[](tc.md§1): one entry per source withok,errorwhere not ok, andreports(sweeps read).
Reading one site’s window: the pointer, the manifest, then one range per
round per product — 37 requests for three hours of one product at a
five-minute cadence, about 7 MB of n0b for a typical site.
5. Sources
unidata-nexrad-level3 (AWS Open Data, us-east-1, maintained by Unidata),
keys <SITE>_<PRODUCT>_<YYYY>_<MM>_<DD>_<HH>_<MM>_<SS>: the source id
unidata-n0b / unidata-n0g. Only the WSR-88D sites are read: the
terminal Doppler radars share the bucket under airport codes and never
publish N0B or N0G. Sites and positions come from the NCEI station list
(nexrad-stations.txt, station type NEXRAD); the product header’s own
position is used where the list has none.
Terms: NOAA data disseminated through the NOAA Open Data Dissemination program, open to the public with attribution requested and no endorsement implied (https://registry.opendata.aws/noaa-nexrad/). Attribution: “NOAA / NWS NEXRAD Level III via Unidata”.
6. Validation
The builder validates every store against the polar store
rules and every manifest against §4 as it writes them; a reader validates
the same shapes on read, refuses a schemaVersion or xue_polar version
above the one it implements, and treats an unknown site id or source id as
data, not an error.
7. The live view
The shell’s live single-site view reads the source (§5) directly; no pointer, round or store is published for it.
- Sites. The marks are a static table in the shell,
web/src/products/radar/sites.json: the window manifest’s site rows (§4) for every station in NCEI’s table that published N0B on the day beforexue nexrad-siteswrote it. Rerun it when the network changes. They are offered only while the field on screen is the reflectivitycref; a case’s radar stays on whatever field is up. - Timeline. An open site lists
<SITE>_<PRODUCT>_<YYYY_MM_DD_HH>for every UTC hour of the newest three hours — the current hour first, the rest together — then once a minute from its newest key on (start-after); its newest sweep is read before any other, then the rest outward from the playhead; a hidden page skips the minute and catches up when shown. A sweep’s time is its key’s (§2); a sweep older than three hours leaves the timeline. Only the product shown is listed. - Sweeps. Each sweep is one object read whole and decoded by the
WASM
decodeLevel3, a port of the builder’s reader (level3.py) held to it by a pinned digest of the fixture’s sweeps (tests/fixtures/nexrad/expected/level3.json). It yields the same codes on the same beam grid a polar store holds, so §2 applies unchanged. - Cross-origin. The bucket answers objects, listings and
Rangepreflights withAccess-Control-Allow-Origin: *. Should it stop, the bucket URL inweb/src/products/radar/live.tsis the one place a pass-through proxy would go.
Part of the Xue specification, licensed under CC BY 4.0.
16 - The fire product
In the viewer: the last day’s detections over the map with ?stations=fire (/gfs?stations=fire), and a case’s own fire round in /showcase/arxan-fire-2026.
An active fire is a point: a satellite pixel hotter than its surroundings,
with a position, a time and a radiative power. A day of the world’s fires
is about 180 000 such points from the polar orbiters — a few megabytes,
not a raster — so active fires are a point product published beside the
runs and the station products (docs/synop.md). The detections are NASA
FIRMS’s near-real-time VIIRS and MODIS products, aggregated every hour by
xue fire-build (xuebuild/fire/) into a seven-day window and taken live
by the same pointer → immutable directory contract the other point
products use. Xue retrieves nothing itself: no fire detection, no FRP, no
re-gridding. This document is the normative description of that product,
schema v1.
1. Delivery
Everything is a static file under the data root, beside the run pointers and the other point products’ pointers.
latest-fire.jsonis the one mutable object. Fetch it with caching disabled. It names the newest round’s directory and the index inside it:pathis relative to the pointer and alwaysfire.<round>/index.json;byteLengthandcrc32(zlib CRC32 of the file’s bytes, eight lowercase hex digits) are the index’s, so it can be requested as<path>?v=<crc32>through an immutable cache.fire.<YYYYMMDDHHMM>/is one immutable directory per round: the UTC hour the product was aggregated at, so the minute is always00. It holdsindex.json(§4), one<sensor>.jsonlper sensor (§5) anditem.json, the round’s STAC Item (docs/stac.md§“Point products”). Nothing in it changes once the pointer names it. The rounds sit flat under the root: each carries the whole window and lives six hours (make prune-r2-fire,FIRE_KEEP=6).Paths inside
index.jsonare file names beside it; request each as<name>?v=<crc32>with the CRC the index carries.
Two ways to read a sensor:
- A time span. The index’s
hours[]rows (§4) are sorted by sensor, then hour, and each ends in the byteoffsetandlengthof that sensor-hour’s line. The rows of one sensor address consecutive lines, so any span of hours of one sensor is one request:GET fire.<round>/<sensor>.jsonl?v=<crc32>withRange: bytes=<first offset>-<last offset + last length - 1>. The bytes are the lines of that span, separated by\nand without the last one. - A whole sensor. Fetch
<sensor>.jsonland read it line by line: one UTC hour per line, oldest first.
The publisher builds every hour (publish-fire.yml). FIRMS refreshes its
files as granules arrive, about three hours after the overpass, so every
round fetches only the last-24-hour files and merges them into the
previous round’s window (§5). A source that fails is recorded (§6) and its
sensors keep their history; the round publishes with the rest. The pointer
is withheld only when no source answered, in which case the previous
round stays live. A round the pointer already names is finished; the
workflow’s force input is the manual rebuild.
Deployment is one-sided: the product is new files under a new pointer, so
a shell that does not know it never asks for it. A new sensor is a new
entry and a new file, which a v1 reader admits (§7); a schemaVersion
bump follows the runs’ rule (ship the shell first).
2. Detections
Every sensor is converted to one set of per-detection fields:
| key | quantity | encoding | range |
|---|---|---|---|
t | acquisition time | seconds after the line’s hour, a multiple of 60 | 0 … 3540 |
lat | pixel centre latitude | integer, 1e-4 degrees | −900000 … 900000 |
lon | pixel centre longitude | integer, 1e-4 degrees | −1800000 … 1800000 |
frp | fire radiative power | integer, 0.1 MW | ≥ 0 |
bt | brightness temperature of the fire channel (VIIRS I4 3.74 µm, MODIS band 21/22 3.96 µm) | integer, 0.1 K | 2000 … 6000 |
conf | detection confidence | one character: l low, n nominal, h high | |
dn | day or night overpass | one character: D or N |
- VIIRS confidence is FIRMS’s own class. MODIS confidence is FIRMS’s
0–100 percentage, classed as FIRMS’s documentation does: below 30
l, 30–79n, 80 and aboveh. - The acquisition time is FIRMS’s
acq_date+acq_time(UTC, to the minute), the start of the granule, not the pixel’s own time. - A row whose position, time or day/night flag does not parse, or whose
value falls outside the ranges above, is dropped and counted (§6,
rejected). Anfrporbtthat is missing in the CSV drops the row. - Times in the index are ISO 8601 UTC with a
Zsuffix; times in the sensor files are epoch seconds, UTC.
The files are written compactly with ASCII escaping, and a file’s identity
is its bytes: the CRC32 in the index, and the pointer’s, is of the file
exactly as served. Given the same inputs a round is byte-identical; only
the index’s generated and the sources’ fetched depend on when the
build ran.
3. Sensors
A sensor is one instrument on one platform. The id is lowercase,
^[a-z][a-z0-9]*(-[a-z0-9]+)*$. v1 publishes five, in this order:
| id | name | FIRMS file | satellite column | resolution |
|---|---|---|---|---|
viirs-snpp | VIIRS S-NPP | suomi-npp-viirs-c2/csv/SUOMI_VIIRS_C2_Global_24h.csv | N | 375 m |
viirs-noaa20 | VIIRS NOAA-20 | noaa-20-viirs-c2/csv/J1_VIIRS_C2_Global_24h.csv | N20 | 375 m |
viirs-noaa21 | VIIRS NOAA-21 | noaa-21-viirs-c2/csv/J2_VIIRS_C2_Global_24h.csv | N21 | 375 m |
modis-terra | MODIS Terra | modis-c6.1/csv/MODIS_C6_1_Global_24h.csv | T | 1000 m |
modis-aqua | MODIS Aqua | the same file | A | 1000 m |
All files are under https://firms.modaps.eosdis.nasa.gov/data/active_fire/
and need no key. The VIIRS columns are
latitude,longitude,bright_ti4,scan,track,acq_date,acq_time,satellite,confidence,version,bright_ti5,frp,daynight;
MODIS names the fire channel brightness and the background bright_t31,
and gives confidence as a number. A row whose satellite is not the
sensor’s is dropped and counted. A sensor with no detection in the window
is not listed.
4. index.json
The shape — every field, its type and range — is
schemas/fire-index.schema.json; the
pointer’s is schemas/pointer.schema.json.
This section says what the fields mean and the rules across them.
issuedis the round,generatedwhen the build ran.windowis the span the files hold:startis seven days beforeissued(longer for a showcase case’s round, built to hold its whole event; readers take the window as written). A detection is kept when its acquisition time is at or afterstart; nothing later is cut, so a granule acquired before the build ran but after the round’s hour is published.sensors[]is one entry per sensor with a detection in the window, in §3’s order: its id, displaynameand nominalresolutionin metres; theattributiona display must show, thelicensethe data is reused under and the producturl;latest, the newest acquisition time in the file;count, its number of detections; andfile, the sensor file’s name (always<id>.jsonl), length and CRC32.hours[]is one row per sensor-hour that has a detection, sorted by sensor (its position insensors[]), then hour:0 1 2 3 4 5 sensorhourcountfrpMaxoffsetlengthsensoris the index intosensors[];hourthe UTC hour the line covers;countits detections;frpMaxthe largest FRP among them in MW, to a tenth;offsetandlengththe byte span of the line in the sensor’s file, the JSON object alone. The spans of one sensor are in row order, consecutive (each starts one byte — the newline — after the previous ends), and lie inside the file’sbyteLength.sources[]is §6.
The index is a few tens of kilobytes: enough for a reader to pick the hours it wants and draw a per-hour activity strip without touching the detections.
5. <sensor>.jsonl
Each line’s shape is schemas/fire-line.schema.json.
One line per UTC hour with at least one detection, oldest first, each the
compact JSON object below followed by \n:
houris epoch seconds of the hour,nthe number of detections; every array and both strings arenlong, one position per detection.- Detections are sorted by (
t,lat,lon), and unique on that key. - A line repeats
sensorandhourso a slice read by range identifies itself.
A sensor’s window is a merge, not a snapshot. Each round lays the newest
24-hour file’s detections over the previous round’s file, keyed by
(sensor, acquisition time, lat, lon) in the integer encoding of §2,
the new one replacing the old whole — FIRMS revising a detection is
believed — and drops what is before the window’s start. The previous
round’s file is read only when its CRC32 matches the previous index; a
mismatch starts that sensor’s window from the new file alone.
6. sources[]
One entry per FIRMS file, in §3’s order:
A source’s id is firms- and FIRMS’s directory name with any dot
spelt as a hyphen (modis-c6.1 → firms-modis-c6-1), since a source id
is ^[a-z][a-z0-9-]*$. ok: false always carries error. reports is the rows read, rejected
the rows dropped by §2 and §3.
7. Validation
The JSON Schemas of §4 and §5 are normative for shape: a file that does
not match them is not a fire file. tests/test_schemas.py holds the
committed golden (tests/fixtures/fire/expected/, two consecutive rounds
built from the fetched fixture tests/fixtures/fire/fire.202610120400/ and
…0500/ by tests/prepare_fire_golden.py) to them, and the shell’s
validators are generated from them (web/src/schema/generated/).
xuebuild/fire/schema.py checks, as every file is written and read, what
a schema cannot say: each sensor file is <id>.jsonl and listed once; the
hours[] rows are sorted by sensor then hour, lie in the window, and each
sensor’s spans are consecutive and end exactly at its file’s
byteLength; each sensor’s count is the sum of its rows’; every column
of a line is n long and its detections sorted and unique on
(t, lat, lon); and tests/test_fire.py checks every span against the
sensor file it addresses. Admission is structural: a sensor a reader has
never seen is not an error. A reader validates the same on read and
rejects a schemaVersion above the one it implements.
8. Terms
FIRMS data are NASA Earth science data, free to use and redistribute
without restriction (NASA Earth Science Data and Information Policy).
NASA asks for the acknowledgement: “We acknowledge the use of data and
imagery from LANCE FIRMS operated by NASA’s Earth Science Data and
Information System (ESDIS) with funding provided by NASA Headquarters.”
The attribution string carries the short form, which a display shows
with the data; the STAC Collection carries the full acknowledgement.
Near-real-time detections are not the science-quality archive and are not
replaced by it here.
Part of the Xue specification, licensed under CC BY 4.0.
17 - Geostationary satellite imagery
In the viewer: /himawari, /himawarijp, /goeseast, /goeswest and /meteosat; a composite through ?type=, e.g. /himawari?type=dustrgb.
How a geostationary imager’s channels become Xue bundles: the himawari,
goeseast, goeswest and meteosat sources, the himawarijp box over
Japan, their Dust RGB and true colour composites and dust confidences, and the seams a further satellite, a second
channel and another composite product go through. The bundle format is
unchanged (bundle.md); what this document fixes is the fetch stage,
xuebuild/satellite/, and the metadata a satellite variable carries.
Shape
A satellite source is a series_file observation source, the shape of
the JMA nowcast and the CMA mosaic: the fetch stage writes one NetCDF
series per window on a regular latitude/longitude grid, and the converter
downstream — cropping, quantization, temporal grouping, the container,
the Zarr store, the manifest — is the observation path unchanged in both
encoders. What the fetch stage does is:
- list the scan’s files on the agency’s public bucket or data store (a slot: one scan of one channel);
- fetch them when the slot is complete (every tile has landed);
- open them as one GDAL dataset on the geostationary projection;
- warp that dataset onto the published grid, once, into a cached frame;
- run each producer on the slot’s warped channels, once, into cached frames of its own;
- stack the window’s frames into one series per variable.
The geostationary projection is implemented once, in GDAL, on the fetch
side. Neither encoder learns the sweep angle or the ellipsoid; the native
encoder reads the series the Python stage wrote, and
tests/test_native.py holds the two byte-identical from there.
The platform registry
xuebuild/satellite/platforms.py is one row per spacecraft at an orbital
slot:
| Field | Himawari-9 | GOES-19 | GOES-18 | Meteosat-12 | Meteosat-9 |
|---|---|---|---|---|---|
role (the source id) | himawari | goeseast | goeswest | meteosat | meteosatiodc |
spacecraft | Himawari-9 | GOES-19 | GOES-18 | Meteosat-12 (MTG-I1) | Meteosat-9 (MSG2) |
satellite_number (WMO C-5) | 174 | 273 | 272 | 71 | 56 |
instrument / instrument_type (WMO C-8) | AHI / 297 | ABI / 617 | ABI / 617 | FCI / 210 | SEVIRI / 207 |
sub_longitude | 140.7 | −75.2 | −137.0 | 0.0 | 45.5 |
sweep_axis | y | x | x | y | y |
channels | the sixteen AHI bands | the sixteen ABI channels | the sixteen ABI channels | the sixteen FCI channels | the twelve SEVIRI channels |
reader | isatss | cmipf | cmipf | fci | seviri (none) |
bucket / prefix | noaa-himawari9 / AHI-L2-FLDK-ISatSS | noaa-goes19 / ABI-L2-CMIPF | noaa-goes18 / ABI-L2-CMIPF | api.eumetsat.int / EO:EUM:DAT:0662 | api.eumetsat.int / EO:EUM:DAT:MSG:HRSEVIRI-IODC |
tile_count | 88 | 1 | 1 | 40 | 1 |
cadence_seconds (the scans') | 600 | 600 | 600 | 600 | 900 |
region (west … east) | 80.7 … 200.7 | −135.2 … −15.2 | 163 … 283 | −60 … 60 | −14.5 … 105.5 |
A source is named by the orbital role, never by the spacecraft: the
pointer (latest-himawari.json, latest-goeseast.json,
latest-meteosat.json), the run directories (himawari.<run>/) and the
manifest model (HIMAWARI, GOES-EAST, GOES-WEST, METEOSAT)
outlive a handover. When Himawari-10 takes the slot, or GOES-19 hands
East to its successor, the platform row changes (spacecraft,
satellite_number, bucket) and nothing published does; the spacecraft
is in each file, as the band block below. The reference_channel
(ir104, which every imager here has) is the one a listing walks to find
a bucket’s slots. bucket and prefix name where the files are in the
terms of the reader: a public bucket and a key prefix, or a data store’s
host and a collection id. Meteosat-9 at 45.5°E (the Indian Ocean service)
is a row and nothing more: its SEVIRI Level 1.5 native file has no reader
yet (GDAL’s MSGN driver gives radiances and the brightness temperatures
would be a Planck fit per channel, as for FCI below), and no source names
it.
Platform.region is 60° either side of the sub-satellite longitude and
±60° of latitude. A disk that crosses the antimeridian is spelled with the
west edge inside −180 … 180 and the east edge past 180 — Himawari’s 80.7 …
200.7, GOES-West’s 163 … 283 — the one shape the encoders’ crop_grid and
the shell’s viewport arithmetic take; GOES-East stays on negative
longitudes like the regional radar grids; Meteosat’s −60 … 60 sits on
the prime meridian. The four sources publish the same core variables
(ir104, ir039 and dustrgb; the ABI composite takes the Quick Guide’s
stretches, FCI has no 11.2 µm window and its green gun reads the 10.5 µm
one) and the true colour composite, the three NOAA-hosted ones the dust
confidences besides, and every seam below is
shared: what differs between
them is the platform row and the reader — and, for Meteosat, the cadence
the source publishes at, which the data policy sets (§“Rounds”).
A channel is a bundle. Its id is the nominal wavelength,
instrument-neutral: ir104 is AHI band 13 and ABI channel 13 alike, an
infrared window at 10.4 µm; the exact central wave number is in the
band block. The registry carries every channel the instrument has;
sources.py says which a source publishes (bundle_scalar_ids) and
carries their band blocks (bands, from Platform.bands). The three
NOAA-hosted sources fetch six infrared windows and the solar bands (four
on AHI, three on ABI) and publish ir104, ir039, the Dust RGB, the
dust confidences and the true colour; Meteosat fetches four windows and
the four solar channels and publishes ir104, ir039, the Dust RGB and
the true colour (§“The dust confidences” says why not the confidences).
| id | wavelength | AHI | ABI | FCI | quantity | codebook |
|---|---|---|---|---|---|---|
ir104 | 10.4 µm (FCI 10.5) | 13 | 13 | 14 (IR 10.5) | brightness temperature, K (the shell reads it in °C) | 180–331.8 at 0.6 |
ir086, ir112, ir123 | 8.6, 11.2, 12.3 µm (FCI 8.7, —, 12.3) | 11, 14, 15 | 11, 14, 15 | 12, —, 15 | brightness temperature; fetched for the Dust RGB (and, but for 11.2 µm, for the dust confidence), registered variables, not published by any source | 180–331.8 at 0.6 |
ir039 | 3.9 µm (FCI 3.8) | 7 | 7 | 9 | brightness temperature, published to show fires (§“The 3.9 µm window”); also read by the dust confidence’s cloud mask and the true colour’s night side | 180–407.7 at 0.9 |
wv062 | 6.2 µm (FCI 6.3) | 8 | 8 | 10 | brightness temperature; fetched for the dust confidence’s cloud mask, a registered variable, not published by any source | 180–331.8 at 0.6 |
vis047, vis051, vis064, nir086 | 0.47, 0.51, 0.64, 0.86 µm (FCI 0.44, 0.51, 0.64, 0.87) | 1, 2, 3, 4 | 1, —, 2, 3 | 1, 2, 3, 4 | top-of-atmosphere reflectance factor, 0–1 (the product’s, not yet divided by the cosine of the solar zenith); fetched for the true colour composite, registered variables (GRIB2 3/0/1, the satellite-image albedo, with the band block), not published by any source | −0.01–1.255 at 0.005 |
ir096, ir133 | 9.6, 13.3 µm | 12, 16 | 12, 16 | 13, 16 | brightness temperature | registered on the platform; not yet a variable |
wv069, wv073 | 6.9, 7.3 µm | 9, 10 | 9, 10 | —, 11 | brightness temperature | same |
nir161, nir226, … | 1.61, 2.26 µm | 5, 6 | 5, 6 | 7, 8 | reflectance | same |
An FCI channel takes the id of the window it is nearest to (IR 10.5 is
ir104, IR 8.7 ir086; the exact wave number is in the band block, and
the shell classifies by it), so the Dust RGB’s inputs keep their ids
across the three imagers.
Adding a channel is: a VariableSpec in variables.py and its entry in
the registry document (parameter block, codebook, label), the id in the
source’s input_variable_ids and bundle_scalar_ids, the regenerated
registry snapshots (xue registry --output rust/xue/registry.json --shell web/src/data/registry.ts), and a row of the shell’s variable table with a
palette. Nothing in the fetch
stage, the converter or the format changes: the fetch warps every channel
a source lists, and the ingest reads one series file per variable. A
channel is warped by its kind (fetch.resampling_for): a brightness
temperature bilinearly, a reflectance — delivered at 0.5 or 1 km, four
to eight times finer than the grid — as the block mean, so a cloud edge
is the mean the eye sees from orbit and not a speckle of the four source
pixels a bilinear sample would pick out of sixty-four. The frame’s
record says which.
The 3.9 µm window
ir039 is published to show where it burns. A fire is a few hundred
metres across and lifts one 2 km pixel tens of kelvin above its
neighbours, up to AHI band 7’s saturation near 400 K; three choices keep
that pixel in the bundle:
- Its own codebook, 180–407.7 K at 0.9 K (compact: to 406.8 K at 1.8 K), where the other windows stop at 331.8 K. Linear like theirs, so no reader learns a new codebook type; a hot spot is tens of kelvin, and the coarser step costs it nothing.
- A peak frame. The published series is warped with GDAL’s
max(fetch.PEAK_RESAMPLING) — the warmest source pixel under each 0.04° cell — instead of the bilinear sample, which spreads a 2 km hot spot over four cells and loses most of its contrast. The composites read the channel as a radiance field and keep the bilinear frame: a source that publishesir039(fetch.PEAK_CHANNEL_IDS∩bundle_scalar_ids) warps the slot’s downloaded tiles twice and caches the second frame beside the first as the variableir039peak, and only the series is stacked from it. The composites’ inputs, and so their bytes, are what they were. - A peak-keeping ladder. The reduced tiers keep, at each decimated
site, the largest code within
factor / 2rows and columns of it (ladder.decimate_peak_codes, mirrored inladder.rs), not the site’s own: a one-cell hot spot lies on a kept row and column one time in four at the half. The windows overlap by a row and a column, so every cell reaches a site and a peak moves at most half a reduced cell. The other variables keep the plain decimation.
Which pixel is a fire is the shell’s decision, not the encoder’s: it has
ir039 and ir104 on one grid and compares them per cell.
The Dust RGB
dustrgb is the classic Dust RGB (Lensky and Rosenfeld 2008, as
EUMeTrain’s recipe compilation and the GOES-R Quick Guide fix it): three
stretches of the infrared windows, no ancillary data, no cloud mask —
lofted mineral dust reads pink to magenta over dark blue-green surfaces,
day and night; thick ice cloud dark red, thin cirrus near black, mid-level
cloud ochre.
| gun | recipe | stretch (AHI and FCI: the SEVIRI set) | stretch (ABI: the Quick Guide’s) |
|---|---|---|---|
dustr | BT 12.3 − BT 10.4 µm | −4 … +2 K, γ 1 | −6.7 … +2.6 K |
dustg | BT 11.2 − BT 8.6 µm (FCI: BT 10.5 − BT 8.7, the imager has no 11.2 µm window; the original SEVIRI IR10.8 − IR8.7) | 0 … +15 K, γ 2.5 | −0.5 … +20 K, γ 2.5 |
dustb | BT 10.4 µm | 261 … 289 K, γ 1 | 261.2 … 288.7 K |
Which channels a platform feeds the recipe is Producer.inputs_for
(DustRGBProducer: the four windows, or three where 11.2 µm is missing
and 10.4 µm stands in for it); bundle_input_ids asks it for the
source’s platform, so a --bundles dustrgb build and the workflow fetch
what that imager has.
Each gun is a number in 0–1 and the three are one bundle, variables 1, 2
and 3 in that order (bundles.COMPOSITE_BUNDLES,
SourceSpec.bundle_composite_ids). A composite has no GRIB2 parameter:
each gun takes a local-use one — discipline 3 (space products), category
192, parameter number 1, 2 or 3, on surface 8 — that means nothing
without the producer block beside it, {"id": "shachen", "version": …}. The id is registered on the variable (VariableSpec.producer_id,
in the registry document); the version is whatever ran, stamped
on the series by the fetch stage and copied into the metadata by
whichever encoder converts, so a shachen upgrade changes the files it
produces and no registry.
The codebook is one for every profile: linear, offset −0.004, step
0.004, codes 0–251, so code 1 is 0.0, code 251 is 1.0 and code 0 —
one step below zero — is “no data”: a cell the disk does not cover, or
one an input channel lacked, is code 0 in all three guns at once, and
black (0, 0, 0) stays a value at code 1. The shell paints nothing where
any gun is code 0 and otherwise shows the three guns straight as the
pixel’s colour; there is no palette. The composite has no poster; it has the reduced-resolution variants and the Zarr store
(three arrays) like a vector bundle. A satellite source publishes two
rungs where most sources publish one (SourceSpec.variant_factors
(2, 4)): .half and .quarter (1500 and 750 cells a side, tiles 32
and 16), each decimated from the full plane — every f-th row and column
from the origin, the poster’s own sampling — because the half of a
3000 × 3000 disk is still twice a full GFS plane and a shell with a frame
budget needs a rung it can hold. There is no .eighth: it was a quarter of
a disk’s objects on the bucket, and the trade is that the coarsest zoom
(and a constrained connection) now downloads the quarter, four times the
bytes of the eighth. The shell reads whichever tiers a manifest lists, so
a window published with an eighth plays to the end of its life.
The true colour
truecolor is one picture by day and by night: the visible picture —
the 0.64, 0.51 and 0.47 µm reflectances of a slot as red, green and
blue — where the sun is up, white cloud from two infrared windows over a
dark ground where it is down, blended across the terminator. It is this
pipeline’s own recipe (TrueColorProducer, no package behind it), in a
fixed order that the tests hold step by step:
- every input reflectance clipped at 0 from below (the products carry small negative values in the dark);
- the cosine of the solar zenith on every cell at the slot’s start (pyorbital, on the grid’s own coordinates), and the zenith θ from it;
- each reflectance divided by
max(cos θ, cos 85°)— the products are the reflectance factor, not yet normalised for the sun, and the floor keeps the last degrees of a day from amplifying noise; 3a. the molecular sky taken out of each reflectance at its band’s own wavelength λ (rayleigh_corrected):(ρ − ρ_R) / T, with the single scattering path reflectance over a black surface, lifted for the light scattered more than once,ρ_R = 0.75 (1 + cos² Θ) / (4 (μs + μv)) × (1 − exp(−τ m)) × (1 + 0.25 τ m), the air massm = 1/μs + 1/μv, the optical depthτ = f × 0.008569 λ⁻⁴ (1 + 0.0113 λ⁻² + 0.00013 λ⁻⁴)(Hansen and Travis 1974; 0.19 at 0.47 µm, 0.05 at 0.64 µm) times the sharefof the column above the cell (rayleigh_column_fraction): 1 up to a sun-normalised 0.64 µm reflectance of 0.2, 0 from 1.0, linear between, since a cloud top hides the air beneath it (pyspectral’s red-band reduction). The attenuated form saturates where the slant path is optically thick; the thin limitτ P / (4 μs μv)takes out several times the sky near the terminator and the limb and strips cloud of its blue, and single scattering alone leaves a blue haze; the lift of 0.25 keeps the sea navy and the cloud white to the limb. The scattering angle iscos Θ = −μs μv − sin θs sin θv cos(φs − φv)from the sun and the satellite as seen from the cell (pyorbital; the satellite over the platform’s sub-satellite longitude at 35 786 km), and the two-way transmittance isT = exp(−τ m / 2), both cosines floored at 85°; faded out linearly between 70° and 88° of the larger of the two zeniths, where single scattering overestimates the sky and the picture falls back to the uncorrected reflectance; - the green:
0.93 × 0.51 µm + 0.07 × 0.86 µmon an imager with a green band (AHI, FCI; the hybrid green that lifts vegetation to the colour the eye expects, Miller et al. 2016), or0.45 × 0.47 µm + 0.45 × 0.64 µm + 0.10 × 0.86 µmon the ABI, which has no green band (the CIMSS blend); - the day guns: red, green and blue through one brightness curve — reflectance 0–1.1 spread over 0–255, knots 0, 30, 60, 120, 190, 255 to 0, 110, 160, 210, 240, 255, linear between, NASA Worldview’s corrected-reflectance stretch — clamped to 0–1;
- the night guns:
ground + (1 − ground) × won each, with the ground(0.03, 0.035, 0.05)and the cloud whitenessw = max(w_ir, w_low):w_ir = clip((280 K − T₁₀.₄) / 60 K, 0, 1)^0.75andw_low = 0.7 × clip((T₁₀.₄ − T₃.₉ − 2 K) / 5 K, 0, 1); a × day + (1 − a) × night, with the day weighta = clip((90° − θ) / 10°, 0, 1)— 1 to a zenith of 80°, 0 from 90°, linear between — clamped to 0–1;- no data in all three guns wherever a side that carries weight lacked
an input: a reflectance where
a > 0, the 10.4 or 3.9 µm window wherea < 1.
| gun | day, AHI and FCI | day, ABI | night |
|---|---|---|---|
truer | 0.64 µm | 0.64 µm | 0.03 + 0.97 w |
trueg | 0.93 × 0.51 µm + 0.07 × 0.86 µm | 0.45 × 0.47 µm + 0.45 × 0.64 µm + 0.10 × 0.86 µm | 0.035 + 0.965 w |
trueb | 0.47 µm | 0.47 µm | 0.05 + 0.95 w |
The night constants are named in producers.py and are one set for
every imager, so the disks of the geo mosaic meet without a seam after
dark (AHI, ABI and FCI read their own 10.4/10.3/10.5 and 3.9/3.9/3.8 µm
channels under the family ids ir104 and ir039); only the day side’s
green differs by imager:
| constant | value | why |
|---|---|---|
TRUE_COLOR_TERMINATOR_DEG | 80°, 90° | the day picture alone to 80°, the night alone once the sun is down; about the span GeoColor fades its layers over |
TRUE_COLOR_NIGHT_GROUND | 0.03, 0.035, 0.05 | near black with a faint cool cast: a clear night reads as night, not as missing data (code 0), and cloud stands out on it |
TRUE_COLOR_CLOUD_TEMPERATURE_K | 280 K → 0, 220 K → 1 | warmer than 280 K is the ground or the warmest low cloud, colder than 220 K a deep or high top; about the range of GeoColor’s night-side infrared cloud |
TRUE_COLOR_CLOUD_EXPONENT | 0.75 | below 1, so mid-level cloud is already light grey and high cloud white rather than a flat linear grey |
TRUE_COLOR_LOW_CLOUD_DIFFERENCE_K | 2 K → 0, 7 K → 1 | small droplets emit poorly at 3.9 µm, so fog and stratus, as warm as the ground and invisible at 10.4 µm alone, read several kelvin colder there; clear sea and vegetated land stay under 2 K (the fog products’ threshold) |
TRUE_COLOR_LOW_CLOUD_WHITE | 0.7 | low cloud a softer grey than high cloud, so the two stay apart as on GeoColor’s night side |
The missing-input rule follows the weight: on the full day side
(a = 1) a missing infrared window costs nothing and the day picture
stays; on the full night side (a = 0) the reflectances are not read; in
the terminator band both sides’ inputs must be there. Outside the disk
every input is missing, so code 0 there as before.
The Rayleigh correction is what makes the ground readable. Under a
morning sun near backscatter the sky’s own path reflectance at 0.47 µm
is 0.15–0.18, most of what a forest or the sea returns at the top of
the atmosphere; left in, every surface sits under the same blue-grey
veil and a city barely parts from the fields around it. Taken out, sea
and vegetation sit at a few per cent and a city at ten to fifteen, which
is why the brightness curve has a steep foot (a cloud-oriented curve
such as CIRA’s leaves that range near black). The correction is
analytic, not a lookup table, so no package or downloaded table stands
behind the recipe; inside the fade it is within a few thousandths of
reflectance of the tabulated corrections, below what the curve resolves.
Aerosol is not corrected: a hazy day stays hazy. The night side reads the infrared alone, so it has known
failures it does not try to fix: a cold clear surface (a winter
continent, the ice sheets near the disk’s edge) is colder than 280 K and
reads as thin grey cloud; a desert at night, whose quartz emits poorly
at 3.9 µm, can show a 10.4 − 3.9 µm difference of several kelvin and a
grey low-cloud veil; and the 3.9 µm window’s noise over very cold tops
is hidden by the infrared ramp, which is already white there. Which
channels a platform feeds the recipe is TrueColorProducer.inputs_for
(the four solar bands, or three without the 0.51 µm one, then ir039
and ir104), mirrored by convert.rs::composite_input_ids the way the
Dust RGB’s missing 11.2 µm window is.
The guns are the Dust RGB’s shape: three variables of one composite
bundle, local-use parameters 3 / 192 / 7, 8, 9 on surface 8, the
guns’ codebook (code 0 no data, 0.0 at code 1, 1.0 at code 251), no
poster, the three-rung ladder. The producer block beside each
is {"id": "xue", "version": "5"}: the id names this pipeline, and the
version is the recipe’s (producers.TRUE_COLOR_VERSION), bumped when a
constant above changes and never with the package, since a cached slot is
recomposed when the version it was composed under differs. Numbers 10,
11 and 12 under xue are left unused: earlier windows carried a night
microphysics composite (nightmicro) there, which readers now treat as
an unknown bundle.
What it costs: the solar bands are the big ones. An AHI slot’s 0.5 km red
band is 390 MB of tiles by day and 230 at night, the three 1 km bands 100
MB each; an ABI slot’s 0.5 km red file is 430 MB by day and 200 at night,
the two 1 km ones 100 MB. A Himawari round therefore downloads some 700 MB
of tiles against the windows’ 140, a GOES round some 630 against 140,
warps the 0.5 km band (22 000 × 22 000 cells) once, and caches the frames
like any channel’s. The night side reads two windows every source already
fetches, so it costs no download. On Meteosat the solar channels cost no
download (an FCI chunk carries every channel); the reader turns their
radiances into the same reflectance factor the NOAA products carry, π L d² / E_sun (§“The FCI reader”), FCI’s own 0.51 µm band takes the AHI’s
hybrid green, and the hourly 24-hour window holds some twelve sunlit
frames. FCI’s blue band is 0.444 µm, bluer than the AHI’s 0.47, under
the family id vis047 (the band block carries its wave number); the recipe is not changed for it.
The dust confidences
dustcf is DEBRA (Miller et al. 2017, doi:10.1002/2017JD027365 — the
Dynamic Enhancement Background Reduction Algorithm for dust), Eqs. 1–22
as the shachen package implements them: an infrared cloud mask, three
dust tests against a clear-sky background, and a confidence factor in
0–1 blended across the terminator, which reads high where lofted mineral
dust is likely and 0 where nothing suggests it. zhouye is ZHOUYE (昼夜,
“day and night”), the diurnally consistent scheme the same package
builds on that chain (§“The ZHOUYE scheme” below): the same confidence
by day, and at night a reading that stays at the day’s level instead of
fading. They are two products — two bundles of one variable each — from
one pass of the producer seam (DebraProducer), computed per slot in
the fetch stage like the guns and brought into these stores as scalar
fields the shell paints with one ramp.
| input | what it feeds |
|---|---|
ir039, wv062 | the cloud mask’s night thin-cirrus and deep-convection tests (Eqs. 4, 6) |
ir086, ir104, ir123 | the mask’s split-window tests and restorals, the dust tests DT1 (12.3 − 10.4 µm) and DT2 (8.6 − 10.4 µm) against the background, the thermal contrast DT3 |
| a skin temperature | CM1 and DT3 (how cold the window reads against the ground), and the Planck curve of the background |
| an infrared emissivity | the background: BT_bg = B⁻¹(ε · B(T_skin)) per window, whose differences are what DT1 and DT2 measure against |
The ZHOUYE scheme. DEBRA’s three confidence sums (Eqs. 16–18, day,
terminator and night) are normalized (Eq. 19) and blended by solar
zenith (Eqs. 20–22). ZHOUYE (shachen.constants.ZHOUYE,
shachen.pipeline.run_zhouye) changes three things, all in the
terminator and night sums and none in the daytime one: DT2 is read on a
fixed (−0.5, +1.5) K interval of the 8.6 − 10.4 µm difference instead of
Eq. 14’s dynamic one, so the clear-sky side of the signal that Eq. 14
clips away — where most of the night-time ranking lives — is kept; the
thermal-contrast test DT3 needs corroboration from a split-window test,
so a cell lit by DT3 alone (mid-level cloud, or a skin-temperature
error, far more often than dust) contributes nothing; and the two sums'
Eq. 19 intervals are fitted so that lit dust reads at night and across
the terminator as it does by day. The daytime sum and its interval are
DEBRA’s ABI retune, on every imager. Below a solar zenith of 75° the
Eq. 20 weight is 1 and the two confidences are one, bit for bit; the
scheme is a night-side extension that blends into DEBRA across 75–90°,
built so that one dust reads one confidence around the clock — no
fading at dusk, no brightening after dark. What it costs, on 30 no-dust
days: the night false-alarm rate at confidence 0.2 doubles (0.0029 →
0.0054); over quartz sand seas it is on the miss side. The numbers and
the ground truth are shachen’s, and the paper in preparation that
describes them. The two are kept as separate products because they are
different claims: dustcf is the published algorithm as retuned, with
a known night; zhouye is a new scheme whose night is its own.
The two ancillary fields are not what the algorithm was built against
(MERRA-2 skin temperature, which lands weeks late, and the CAMEL
climatology behind Earthdata credentials), so ancillary.py takes two
stand-ins, in the same shape:
- Skin temperature is GFS
TMP:surface, the one record of NOAA’s 0.25° file nearest the slot’s whole hour, located through the file’s.idxand fetched by byte range (a megabyte) from the newest cycle that reaches the hour, walking back over the cycles the bucket does not have yet (a cycle lands some four hours after its analysis, so the walk back is the normal path). Cached underdata/raw/ancillary/gfs/gfs_tmpsfc_<cycle>_f<hhh>.grib2; a later slot of the same hour asks nothing. Read through GDAL with the unit left in kelvin (GRIB_NORMALIZE_UNITS=NO; GDAL would hand the field back in Celsius) and the raster shifted onto −180 … 180 as GDAL does itself. - Emissivity is the CAMEL monthly climatology (CAM5K30EM V003),
staged on this bucket by
xuebuild/satellite/staging.py(§“Staging the emissivity”): one NetCDF per region and operational month, already interpolated to the DEBRA band centres (emis_tir_86…emis_tir_123), cropped to the region’s box with a degree of margin, named for the month it serves (the record ends in 2023; the file’ssource_monthsays which year’s same calendar month it carries).make pull-r2-ancillarymirrors that prefix whole intodata/raw/ancillary/camel/<region>/<YYYYMM>.nc(the rounds script does it before the first build underANCILLARY=true); a round touches neither Earthdata nor the staging prefix. A region with no file for the slot’s month is served by its newest staged month with a warning — the product is a climatology, and a region dropping out at a month’s turn would be the worse failure; a region with nothing staged is not a region; nothing staged at all is an error, since the confidence over water alone is not the product.
Both are put on the target grid by one bilinear interpolation
(ancillary.regrid) done in the grid’s own copy of the world: a global
field is re-based column by column onto a grid that runs past 180° and
wrapped (its first column repeated a turn later), a regional file is
moved whole by the turn that lays it over the grid, and nothing is
extrapolated. The chain is composed here from shachen’s per-equation
modules (background_signals, cloud_mask, dust_tests, confidence,
blend_confidence) rather than through shachen.pipeline.run_debra /
run_zhouye, because those entry points take a pyresample area and do
the regrid, the sun and the land mask themselves; on these grids those
three are this module’s (the regrid above, pyorbital’s zenith on the
grid’s own coordinates, the land mask on wrapped ones), and
tests/test_debra.py holds the composition equal to both pipelines on
a plate carrée area cell for cell. The background, the mask and the
tests are computed once per slot and both confidences read them (the
ZHOUYE dust-test constants differ from the ABI retune’s only by the
second DT2 reading they add, which DEBRA’s sums are not shown); the
constants are shachen’s ABI retune on every imager (the Eq. 19 daytime
floor at 0.40 rather than the printed 0.25, which keeps clear-sky DT3
noise over vegetation from colouring, and the night branch on an
interval of its own), as the former operational pipeline ran both AHI
and ABI.
Where the confidence is defined. A cell is computed wherever every input channel and the skin temperature have data and the ground is either water — DEBRA takes the water surface’s emissivity as unity and needs no climatology there — or inside the extent of a staged CAMEL file. Land no staged file reaches is no data (code 0), never a confidence computed against an emissivity that was never read: staging a region is what extends the product over it, and a whole-disk staging would fill the disk with no code change. Today the staged regions are three — the Gobi and Taklamakan through the North China Plain to Japan (Himawari), the Chihuahuan Desert and the US Southwest (GOES-East and GOES-West both see it), and the Saharan transport corridor from the Cape Verde longitudes to the Caribbean and the Gulf (GOES-East) — plus every sea the three disks cover. Meteosat publishes no confidence: no staged region lies on its disk, the Sahara itself is exactly what a climatology is for, and its window is hourly besides.
The gate. What is published as dustcf is cf_comb with the
split-window gate applied (producers.split_window_gate): a cell where
neither split-window test responded (dt1 = dt2 = 0) reads 0, since
cloud has no split-window signal and dust nearly always does. The
failure it removes is mid-level cloud too warm for CM1 and too thin for
CM3, which the thermal-contrast test alone reads as dust; on 42 dust
days of East Asian station data it costs a daytime detection rate at
confidence 0.1 of 0.411 → 0.373 for a false-alarm ratio of 0.422 → 0.23.
It is not part of DEBRA (Eqs. 1–29) and not in shachen. zhouye takes
the same gate on its normalized day factor alone, then shachen’s Eq. 22
blend again (Eq. 19 maps a zero sum to 0 on the day interval, so gating
the factor is gating the sum): ZHOUYE’s own corroboration rule already
acts on the terminator and night sums with its DT2 reading, and gating
the blended ZHOUYE on Eq. 14’s DT2 — which is 0 over nearly all clear
ground at night — would erase the night it was built for. A second gate
on the 0.64 µm reflectance is not applied to either: it would cost a
0.5 km visible channel per slot for a false-alarm ratio of 0.23 → 0.21,
and there is no reflectance at night.
The result is two bundles of one variable each, dustcf and zhouye,
on the channel’s axis and grid: composite bundles in the encoders'
terms (bundles.COMPOSITE_BUNDLES, SourceSpec.bundle_composite_ids)
— produced in the fetch stage, read off the series with their producer
stamp, never derived by a converter — whose one component is the bundle
itself.
Their identity is the guns’ pattern: a local-use parameter, discipline
3, category 192, number 4 for dustcf and number 6 for
zhouye, on surface 8, meaningful only with the producer block beside
it ({"id": "shachen", "version": …}, the id registered on the
variable, the version whatever ran), no band. Their codebook is the
guns’ (linear, offset −0.004, step 0.004, codes 0–251, code 0 no data,
0.0 at code 1, 1.0 at code 251), the same ladder, no poster. A produced frame’s record names, beside the
producer and the input frames, the ancillary it was computed against
(the staged directory and the GFS record by name, whose name is the
cycle and forecast hour). Like every produced frame it is composed once:
a slot’s confidence is the first computation’s, and a GFS cycle landing
later for the same hour does not recompute a cached slot.
Staging the emissivity
xuebuild/satellite/staging.py writes the CAMEL months §“The dust
confidence” reads, and stage-ancillary.yml is the one job that holds
Earthdata credentials: at 03:00 UTC on the 25th it stages the month in
progress and the next for every region in the module’s table (the 1st
is the retry), and pushes them with make push-r2-ancillary (a
--size-only sync, so an unchanged file costs nothing). A month is cut
from the granule shachen.io.emissivity.fetch_emissivity serves for it
— the record ends in 2023-12, so the same calendar month of the newest
year that has one, never a different month — interpolated to the DEBRA
band centres by load_band_emissivity, sorted ascending on both
coordinates (CAMEL stores latitude north to south, and a slice against
a descending coordinate selects nothing, silently), cropped to the
region’s box plus MARGIN_DEG (1°, so the bilinear regrid never
extrapolates at the box’s edge), cast back to float32 and written
zlib-compressed with the attributes the reader keys on (region,
month, source_month, source, bbox, margin_deg). An empty crop
is an error; an existing file is overwritten, since restaging is how a
bad subset is fixed. The regions are a table (a key, a box, a
description) rather than a derivation from the disks, because staging a
region is a decision about where the product is defined over land. The
table holds one row, global, the whole granule: the confidence is
defined over every disk’s land, and the reader wraps a global field
across the antimeridian itself. A margin past the granule’s edge
selects nothing extra. Locally, make stage-ancillary MONTHS="2026-11" REGIONS="global" does
the same against your own ~/.netrc (the staging dependency group;
no GDAL), and tests/test_staging.py holds the crop, the month
resolution and a staged file’s read-back through ancillary.py on a
synthetic granule, never the network.
Regional boxes
A disk at 0.04° (4.4 km at the equator) is limited by the grid, not the
sensor: AHI samples 0.64 µm at 0.5 km, the other solar bands at 1 km and
the infrared at 2 km at the sub-satellite point, some 0.7–1 km and 2.8 km
effective over Japan at its 42° viewing angle. The whole disk at 0.01°
would be 144 M cells a plane; a box is a few million. So a finer grid is a
source of its own on the same platform — a regional source, the way
hrrr sits beside gfs — and not a finer rung of the disk’s ladder,
since a variant is the same extent decimated.
SourceSpec.region is the box as (west, south, east, north), edges on
whole cells of grid_step; the fetch warps onto it instead of
Platform.region, and production_grid must be the box at the step.
himawarijp is the one such source today:
himawarijp | |
|---|---|
| platform | himawari (the same files, band blocks and producers) |
| box | 24–46°N, 122–148°E (whole degrees: the JMA nowcast’s 0.005° cells nest 2:1) |
| grid | 0.01°, 2600 × 2200, tile 64 × 64 (0.64°, 1435 a plane), ladder 0.02 / 0.04 / 0.08° |
| fetched | ir039, ir086, ir104, ir112, ir123, vis047, vis051, vis064, nir086 |
| published | ir104, ir039, dustrgb, truecolor (no confidences: their CAMEL months are staged on the disk grids) |
| window | 600 s, 3 h |
The ISatSS reader narrows a slot to the box (ISatSSReader.tiles_covering).
A tile’s position on the disk’s 10 × 10 grid of tiles is a fixed table
(ISATSS_TILE_ROWS: rows of 6, 8, 10 × 6, 8, 6 tiles, the twelve corners
that hold no Earth left out; T020 is row 2, column 5, as its own
tile_row_offset / tile_column_offset say), and its footprint is the
box around a 56 × 56 lattice of its scan angles put through PROJ’s
ellipsoidal geos inverse (geostationary_lonlat), with the tiles'
own projection constants. Over a whole slot of real tiles the footprints
match those computed from each tile’s own geotransform to 1e-10°, and
the fixture tiles’ corners as GDAL reads them to 0.01°. A tile is needed
when its footprint, widened by 0.1° (more than a 2 km pixel wherever a
box is useful, so a bilinear sample at the edge finds its neighbours),
overlaps the box: for Japan, six of the 88 (T009–T011, T018–T020). Only
those make a slot complete, are downloaded and are mosaicked — some 60
MB a slot over the eight channels other than 3.9 µm by day and 35 MB by
night (2026-10-11 03:00 and 2026-10-10 15:00 UTC), against 870 and 500
MB for the disk’s ten; the 3.9 µm window the true colour’s night side
reads adds one more 2 km channel’s six tiles. A CMIPF slot is one file and an FCI download already crops
its chunks to the disk’s rows, so those readers do not narrow
(tiles_covering is None).
The frame cache is keyed by the source, <source>-frames, since the
box and the disk warp the same slot onto two grids; a disk’s source id is
its platform’s role, so the disks’ caches kept their names. A slot of the
box is eighteen frames of 3–7 MB (some 95 MB). Measured on one sunlit
hour (2026-10-11 03:00–04:00 UTC, seven slots, under true colour recipe
1): the stores are 8.4 MB of ir104, 35 MB of dustrgb and 65 MB of
truecolor at full resolution and a third more for the ladder, some
170 MB, near 0.5 GB for a sunlit three-hour round; that is why the
window is three hours and not the disks’ six. The true colour’s night
side is white cloud over a flat dark ground, smoother than the sunlit
picture, so a night hour costs less than a sunlit one but no longer next
to nothing.
Metadata
A satellite variable’s identity is its parameter block, brightness
temperature at the nominal top of the atmosphere (GRIB2 0 / 4 / 4 on
surface 8), which every infrared band of every imager shares, plus the
band block beside it (bundle.md §“Band, Producer and Aerosol”), template
4.31’s five fields:
The shell classifies a channel by the band’s central wave number (10–11 µm
is the infrared window, ir104), never by the spacecraft, so GOES-19’s
10.35 µm channel and Himawari-9’s 10.41 µm one draw with one palette. A
brightness temperature with no band, or in a band the shell has no chart
for, renders generically.
Cells the disk never covers arrive as the product’s fill (-32767) and
become the bottom of the codebook, 180 K — below any cloud top a 10 µm
channel reports — which the shell paints as nothing, the way the radar
mosaics’ no-coverage cells are handled. The format carries no bitmap.
The fetch stage
Reader
A reader (readers.py, Reader) lists a platform’s slots and a slot’s
objects, downloads them, and opens them as one thing GDAL can open: a
dataset on the geostationary CRS whose values are the physical quantity or
carry a scale and offset to it. Its responsibility ends there.
ISatSSReader is NOAA’s ISatSS product: each channel of each scan as 88
Sectorized CMI NetCDF tiles (550 × 550 at 2 km) under
AHI-L2-FLDK-ISatSS/YYYY/MM/DD/HHMM/, named
OR_HFD-<res>-B<bits>-M1C<channel>-T<tile>_GH9_s<start>_c<created>.nc. The
bit-depth field varies by channel (B11 for most, B12 for channels 10–15,
B14 for channel 7), so the listing prefix spells the channel’s own and
never guesses. The tiles are already calibrated (Sectorized_CMI, Int16
with scale_factor 0.064208984375 and add_offset 69, kelvin) on the CF
geostationary projection with x/y in microradians; GDAL warns about the
unit and computes the geotransform from them faithfully. The coordinates
themselves are one pixel off: a tile’s first pixel centre is written half
a pixel west of the edge its tile_column_offset names, where it belongs
half a pixel east of it (T020 of the 0.5 km band starts at x = −500 m where
the offset says 0), and half a pixel north of its row edge the same way,
in every band at that band’s own pixel. Read as written,
the 0.5, 1 and 2 km bands of one slot land 0.5, 1 and 2 km north-west of
their ground and up to 1.5 km apart from each other (measured on a clear
Korean coast against the coastline: 0.85 grid cells at 0.01° between the
1 km bands and the 0.64 µm band, 2 cells for the infrared), which fringes
every edge of the true colour with cyan and red. The reader moves its
mosaic back one pixel east and one south (_shift_one_pixel_south_east),
after which the bands agree to 0.02 cells. A day’s slots are
the directory listing (delimiter=/), a slot’s tiles one listing under
the channel’s prefix, a reissued tile the later c stamp. The slot opens
as a gdalbuildvrt mosaic of the tiles by georeference. For a source with a
region of its own the reader also says which tiles reach into it
(tiles_covering, §“Regional boxes”); only those make the slot complete,
are fetched and are mosaicked.
CMIPFReader is NOAA’s ABI-L2-CMIPF product, the GOES-R full disk:
each channel of each scan as one netCDF-4 file under
ABI-L2-CMIPF/YYYY/DDD/HH/ (year, day of year, hour), named
OR_ABI-L2-CMIPF-M<mode>C<channel>_G<nn>_s<start>_e<end>_c<created>.nc
with YYYYDDDHHMMSSs stamps. CMI is unsigned 16-bit, 5424 × 5424 at
2 km for the infrared channels, with the band’s own scale and offset to
kelvin (C13: 0.06145332 and 89.62) and 65535 where the disk is not; the
goes_imager_projection is the CF geostationary mapping with sweep x
and x/y in radians, which GDAL turns into a metre geotransform on its own
(its warning about the radian axis unit concerns the SRS’s axis, not the
georeference). A scan in mode 6 starts twenty seconds past every ten-minute
mark and its slot is that mark (the start floored to the cadence); the
listing accepts any mode digit. A slot is complete once its file is listed
(tile_count 1), the file lands some ten minutes after the scan starts,
and a reissue is the later c stamp. The slot opens as a one-source VRT
over the CMI variable, so the no-data floor is applied the way it is to
a mosaic. Listing is per hour directory: list_hours reads a day’s hour
prefixes in one request, list_hour one hour’s files for a channel, and
recent_slots walks the hours newest first and stops once it has the few
slots latest_slot asks about — two or three requests a round rather
than a whole day’s twenty-four. The DQF quality flags are not read
(99.9996 % of a sampled disk is flag 0).
FCIReader is EUMETSAT’s MTG FCI Level 1c full-disk product (FDHSI, the
Data Store collection EO:EUM:DAT:0662): one product per ten-minute
repeat cycle, cut into forty netCDF-4 chunk files, each a strip of some
140 rows of the 5568 × 5568 2 km grid carrying every channel as
12-bit radiance codes with a scale and offset
(/data/<channel>/measured/effective_radiance, mW m⁻² sr⁻¹ (cm⁻¹)⁻¹, fill
65535). Three things stop GDAL opening a chunk as the other readers'
files are opened, and the reader does them itself:
- the chunks are compressed with an HDF5 filter (JPEG-LS, filter 32018)
a stock GDAL cannot decode: the plugin comes with the
hdf5plugindistribution (thesatellitedependency group) and is handed to each GDAL subprocess the reader runs asHDF5_PLUGIN_PATH(hdf5_plugin_environment; an environment that already names one is left alone); - the values are radiances: the reader reads the channel’s codes with
gdal_translate, unpacks them, and converts them by the channel’s kind. An infrared channel takes its own Planck coefficients, scalar variables of itsmeasuredgroup read throughgdalmdiminfo—BT = (c2 ν / ln(1 + c1 ν³ / L) − b) / a, the conversion the product documents — into an Int16 strip in steps of 1/128 K above 100 K (FCI_BT_SCALE/FCI_BT_OFFSET; IR 3.8, which reads past 356 K over a sunlit desert, about 200 K instead). A solar channel takes its effective solar irradiance at 1 AU (channel_effective_solar_irradiancein the same group, mW m⁻² (cm⁻¹)⁻¹) and the mean Earth–Sun distance of the chunk’s rows (/state/celestial/earth_sun_distance, km, over 1.495978707e8 for AU):reflectance_factor = π L d² / E_sun, not divided by the cosine of the solar zenith (the ISatSS and CMIPF reflectances are not either; the true colour producer divides), into an Int16 strip in steps of 1/4096 from zero (FCI_REFL_SCALE; −0.01 … 1.26 is codes −41 … 5161). Either way a raw file and a VRT that carries the packing and the unit (Kor1), and the frame’s record carries the channel’skind. The steps are binary fractions on purpose: a decimal one such as 0.01 K puts some values an ulp either side of a codebook half-step depending on whether a platform fusescode × scale + offset, and the two encoders then disagree by one code on one cell. A solar channel’s group carries the Planck variables too, holding their fill value, so asking it for Planck coefficients is an error (“not an infrared channel?”), as is asking an infrared group for a solar irradiance; - the grid mapping (
/data/mtg_geos_projection: sweepy, height 35786400 m, WGS84, longitude 0) sits in a parent group GDAL does not connect to the variable, so the strip’s VRT carries the geostationary SRS built from those fields and an extent in scan angles (radians, a column or row number packed with a scale and offset) times the height. East to west the extent comes from the file’s own column packing: column i, from 1, is the scan angleoffset + step × i, and the product measures that angle positive towards the west, the negative of PROJ’s geos x (offset +0.156 rad, a negative step, column 1 the western limb). Taken at face value, as GDAL’s geotransform takes it, the disk comes out mirrored about the sub-satellite meridian — every Meteosat frame until reader version 3 did, Arabia over the Atlantic. North to south GDAL’s row origin is the chunk’s, its row step checked against the grid. The strip is written west to east and north to south whichever way the file runs. A frame’s record names the reader version that placed it (frameVersion, 3 for FCI), and a cached frame of another version is warped again, its slot’s composites recomposed. The infrared channels are on a 2 km grid (5568 columns, row step 5.5887e-5 rad), the solar ones on a 1 km grid (11 136 columns, half the step, the same disk); a chunk is a fortieth of the rows of either. The reader checks the packing of the rows and columns and the grid’s width against the constants of the grid the channel’sresolution_kmnames (FCI_GRIDS), and plans chunks with them, so a product change is an error.
The strips of a channel are mosaicked with gdalbuildvrt; the projector
warps that. A chunk carries every channel, so a slot’s files are shared
by its channels (Reader.files_per_channel is false: fetch_frame puts
them under the slot’s directory rather than a channel’s, and the window
removes the directory once the slot’s channels are done), and only the
chunks whose rows reach into ±60° of latitude are downloaded
(needed_chunks: 60° on the sub-satellite meridian is seen 0.1402 rad up
from the disk’s centre, against the disk’s 0.1556, so the outermost two
chunks at either end — 2 through 39 remain — are never fetched, some
900 MB a cycle). A slot is complete when the product lists all forty
chunks; a cycle’s slot is its sensing start floored to the ten-minute
cadence (15:20:07 is 15:20).
The store is eumetsat.py: search is the anonymous OpenSearch query
(…/search-products/1.0.0/os?format=json&pi=<collection>&dtstart=…&dtend=…,
each product’s date interval, updated stamp and sip-entries — one
link per file, entry?name=<file>), list_slots one search over a day,
recent_slots one search back over six hours, list_slot one over the
cycle. download_bytes fetches one file with a bearer token minted by
POST https://api.eumetsat.int/token from a registered account’s
consumer key and secret — EUMETSAT_CONSUMER_KEY /
EUMETSAT_CONSUMER_SECRET in the environment, the workflow’s secrets of
the same names — renewing it when the store refuses it, waiting out a
rate limit as the store’s retryAfter asks (capped at two minutes), and
failing by name when the two variables are unset, so a build without an
account stops at the first download. The listing gives no file sizes; a
file present on disk at all is taken as complete, since a download lands
under a .part name until it is.
A further reader would be HSDReader, for the raw Himawari Standard
Data segments should the ISatSS product ever stop, or SEVIRIReader for
Meteosat-9’s Level 1.5 native file.
Projector
A projector (projector.py, Projector) writes the reader’s dataset
resampled onto a TargetGrid — edges and step, cell centres half a step
inside, longitudes allowed past 180 — as an Int16 GeoTIFF with the
source’s nodata, scale and offset on the band. GdalWarpProjector is
gdalwarp -t_srs EPSG:4326 -te … -tr … -r bilinear (average for a
reflectance, max for a peak frame), deterministic for one GDAL version,
multithreaded. A NumPy projector with a cached lookup table
(for parallax correction, or exact alignment with a producer’s grid) is
the same interface.
The published grid is the platform’s region at the source’s grid_step:
60° either side of the sub-satellite longitude and ±60° of latitude, past
which the view is too oblique to read. For Himawari that is 80.7°E to
200.7°E at 0.04°, 3000 × 3000 cells, first cell centre 80.72°E, 59.98°N —
a grid that crosses the antimeridian, which the encoders’ crop_grid and
the shell’s viewport arithmetic take in the grid’s own copy of the world
(a box spelled -170 is at 190 on it); GOES-West’s is 163°E to 283°E the
same way (first cell centre 163.02°E), GOES-East’s 135.2°W to 15.2°W
(first cell centre 135.18°W). A scene that lies wholly outside the grid is
refused rather than written blank, since a blank warp is also what a lost
projection produces.
Frames and the cache
A frame is one slot of one variable on the target grid, at
data/raw/<source>-frames/<variable>/<variable>_<YYYYMMDDHHMMSS>.tif
(keyed by the source, since two sources of one platform warp the same
slot onto two grids; a full-disk source’s id is its platform’s role): a
channel’s, warped by the projector, or a produced one, written by
assemble.write_frame (Int16 at 1e-4 with the same fill, through an ENVI
header and gdal_translate, no raster library). Inside every frame is its
record, one JSON object in the GeoTIFF’s XUE_FRAME metadata item (GDAL’s
default domain, the GDAL_METADATA tag) — the scale, offset and unit the
frame’s codes mean, read off the source tile before the warp for a
channel, the tiles and reader version it came from, and for a produced
frame also the producer’s id and version and its inputs — so a frame is
one object on the bucket. gdalwarp takes no metadata option, so the
projector warps to an uncompressed scratch file and gdal_translate
writes the frame from it with the item. Frames cached before the record
moved inside carry it in a <variable>_<YYYYMMDDHHMMSS>.json sidecar;
assemble.frame_record reads the embedded item first and the sidecar
only when there is none, so both kinds meet in one window until the old
ones are pruned. A slot is warped once and
composed once: the rounds script pulls the window’s hours of frames from
the bucket before the first build and pushes new ones after every upload
(make pull-r2-frames / push-r2-frames / prune-r2-frames, MODEL=himawari;
the targets take every variable directory), so a round downloads one
slot’s tiles (26 MB per channel) and runs the producers on one slot
whatever the window’s length. A channel’s frame is a pure function of its
tiles and the GDAL version, a produced one of its input frames, its
ancillary and the producer’s version (produce_frames recomposes a
cached slot whose record names another version); a GDAL upgrade may
resample the next frame differently, and the cached older frames stay as
they are, each under its own ?v= once published. A producer’s ancillary
fields live beside the frames under data/raw/ancillary/ (the staged
CAMEL months, mirrored from the bucket by make pull-r2-ancillary; the
GFS records the dust confidence producer fetches per slot, never mirrored), which
_fetch_satellite_run hands to fetch_window as the ancillary root.
The series
assemble.write_series stacks one variable’s frames into its series
file of the window, <stem>.<variable>.nc (himawari.2026091703.ir104.nc,
….dustr.nc, …): a VRT over the frames carrying the netCDF driver’s
extra-dimension metadata (NETCDF_DIM_EXTRA={time},
NETCDF_DIM_time_DEF, NETCDF_DIM_time_VALUES, one NETCDF_DIM_time
per band, NETCDF_VARNAME=<variable>), translated with
gdal_translate -of netCDF into <variable>(time, lat, lon), packed
Int16 with the frames’ own scale and offset and fill, time in seconds
since the run, units the registry’s (K, or 1 for a gun), and on a
produced variable the producer_id and producer_version attributes
(the band metadata keys of the VRT become the variable’s attributes).
One file per variable because the netCDF driver stacks a VRT’s bands into
one extra-dimensioned variable only when the bands are exactly that axis;
given two variables’ bands it writes one variable per band instead. Every
series of a window carries the same axis: a slot is in the window only
when every channel landed whole, and every producer’s outputs exist
exactly when its inputs do. The reference pipeline needs no NetCDF
library; GDAL writes the file, and the same GDAL reads it back through
xuebuild/observation.py (series_files resolves a run directory to a
file per variable, or to the one file the radar sources write;
inspect_observation reads each variable with its own packing and fill,
holds the axes equal, returns the producer stamps), which snaps each time
to its 600 s slot and takes the first slot’s hour as the run. The
converter reads only the variables the requested bundles carry: the five
unpublished channels are never quantized.
Rounds
fetch.fetch_window walks every slot from the run’s hour through hours
past it at the source’s cadence: a cached frame is read back, a complete
slot on the bucket is fetched and warped, an incomplete or absent slot is
left out (the axis allows the gap, and the next round takes it if it
lands). The live window’s end is the newest slot whose tiles have all
landed (latest_slot: the reader’s recent_slots — a day’s slot
directories at once for ISatSS, the newest hour directory for CMIPF, one
search for FCI, yesterday’s as well around midnight — then the newest
three slots asked for their tiles, the rest trusted). resolve_run("latest")
is the six whole hours (window_hours) ending with that slot’s hour, as
for MRMS and JMA with their own lengths.
Meteosat is hourly. The imager scans every ten minutes and the store
lists every cycle, but the meteosat source’s cadence_seconds is 3600
against the platform’s 600, its window 24 hours (25 frames), and
window_slots and latest_slot keep the slots on the source’s cadence:
the cycle on each hour alone. The reason is the EUMETSAT data policy
(2025): the Level 1 repeat cycle referenced to each clock hour is Core
data, released under CC-BY-4.0 and redistributable at any latency; the
cycles between are licensed data whose operational use within an hour of
sensing is not free and whose numbers may not be redistributed after it.
A store with hourly frames is what that policy allows this site to
publish. The attribution it requires (“Contains modified EUMETSAT
Meteosat data [year of publication or distribution]”) is in the shell’s
credit, the year stamped at render time, and in the catalog prose, the
year of the run’s first frame filled in when the Collection is written. The tiles of a Himawari scan are generated about eight
minutes after it starts and listed some fifteen after, a GOES file lands
some ten minutes after its scan starts; a round is a listing, one scan’s
files, one warp per channel, one composition, one stack per variable and
a conversion, three to four minutes, so the live window ends fifteen to
twenty minutes behind real time; an FCI cycle is in the store some five
minutes after its sensing ends, and its round downloads 900 MB and
converts 38 strips per channel for eight channels — the four solar ones
on the 1 km grid, which read no slower than an infrared one, since a
strip’s time is opening the chunk — some ten to fifteen minutes once an
hour.
.github/workflows/publish-himawari.yml, publish-goeseast.yml,
publish-goeswest.yml and publish-meteosat.yml each run one round per
job on a half-hour cron (a round fetches every slot its frame cache lacks,
so the window keeps its ten-minute step) and install gdal-bin whichever encoder
converts, since the wheel’s GDAL is a library with no GeoTIFF driver; the
three NOAA ones pull the staged CAMEL months before the first build
(ANCILLARY=true in the rounds script, make pull-r2-ancillary); the
Meteosat one also proves the runner’s GDAL loads the JPEG-LS plugin on the
fixture chunk before a round spends a download, and warns and builds
nothing when the two EUMETSAT_* secrets are absent.
Producers
A composite product (a dust index, a split-window difference, an RGB) is
a Producer (producers.py): its input is one slot’s channels, already
warped — float planes in the channel’s unit with NaN where no data — plus
the ancillary fields it names (ancillaries, resolved and fetched per
slot by ancillary_for(platform, slot, root) under the fetch’s
ancillary root), the slot and the grid, its output one or more new
planes on the same grid, each written as a frame of its own and cached
beside the channels’ (fetch.produce_frames), so a round composes the
slot it warped and reads the rest back. It never touches quantization, the
container, the store or the manifest: its outputs are stacked into series
like channels and the converter reads them as the components of one
composite bundle. Two kinds share the interface: an in-process NumPy
function with a fixed operation order, which can be held to a golden, and
an external one that runs elsewhere and writes to the shared bucket, read
back the way the CMA archive is. A produced variable’s identity is a
local-use GRIB2 parameter with the producer block beside it, the id
registered on the variable, the version taken from the frames the
producer wrote.
DustRGBProducer is the first: id shachen, bundle_id dustrgb,
inputs ir086, ir104, ir112, ir123 (inputs_for(platform): the
three without ir112 on an imager that lacks it), outputs dustr,
dustg, dustb, no ancillaries, version the installed shachen
distribution’s. It builds an xarray scene of the planes (the 10.4 µm one
standing in for 11.2 µm where there is none) and calls
shachen.dustrgb.dust_rgb with the stretch set the platform’s instrument
takes (DUST_RGB for AHI and FCI, DUST_RGB_ABI for ABI — the rule
shachen applies by satpy reader, made here by Platform.instrument), then
marks every cell any input lacked as no data in all three guns.
DebraProducer is the second (§“The dust confidences”): id shachen,
bundle_ids dustcf and zhouye (bundle_id is the first, what the
logs name it by), inputs ir039, wv062, ir086, ir104, ir123
(all five required; no stand-in), outputs dustcf and zhouye in that
order, ancillaries camel (the staged months’ directory) and skin
(the slot’s GFS record, fetched by ancillary_for when not cached),
version shachen’s. run regrids the two fields, finds the sun and the
ground, composes shachen’s per-equation modules once, takes the DEBRA
confidence gated and the ZHOUYE confidence with its day factor gated and
re-blended, and leaves NaN wherever the confidence is not defined. A
producer’s outputs may be the components of more than one bundle:
PRODUCERS lists it under each, the fetch runs it once for all of them
(dict.fromkeys over the source’s listed composites) and caches every
output frame, so a source listing one of its bundles still composes
both. PRODUCERS is keyed by the
bundle produced; SourceSpec.bundle_composite_ids lists what a source
publishes, and _fetch_satellite_run runs every listed producer whose
channels the window fetches (asked for the Dust RGB’s four alone, it
composes that and not the confidence). TrueColorProducer is this
pipeline’s own (id xue, the version the recipe’s constant): §“The
true colour”. shachen is the satellite
dependency group (uv sync --group satellite), imported inside the
producers and nowhere else.
Fixtures and tests
tests/fixtures/himawari/ is forty real tiles — T020 and T021 of two
consecutive scans in bands 7, 8, 11, 13, 14 and 15, untouched, and the
same tiles in bands 1–4 cut to their north-west corner
(tests/prepare_himawari_fixture.py: a sixteenth of each, since a 1 km
tile is 1.3 MB and the 0.5 km one 4.7) — and tests/test_satellite.py
runs them through the whole stage — listing, completeness, download,
mosaic, warp (the solar bands as block means, the record saying so),
cache, the producers (the Dust RGB held cell for cell to
shachen.dustrgb.dust_rgb called directly, the true colour’s day side to
its recipe written out step by step, its night side to the night recipe
on the fixture’s windows — ground and white cloud, never no data, a cold
top whiter than a warm one, fog lit by the 10.4 − 3.9 µm difference —
and the terminator blend held monotone and continuous with the
missing-input rule on each side), series, ingest, conversion on the production grid with every
composite bundle, a crop past the antimeridian, a --bundles build that
reads one series alone — against a stand-in for the bucket, then through
both encoders. tests/fixtures/debra/ is two crops of a staged CAMEL month
(the Gobi, land; a box of water south of Japan inside the tiles’ grid)
and four crops of one cached GFS record, and tests/test_debra.py holds
the ancillary readers, the regrid across 180°, the GFS candidate walk and
byte-range fetch against fakes, the composed chain equal to
shachen.pipeline.run_debra and run_zhouye on the same grid (and the
two confidences one by day), the definition and gate rules, and the producer in the fetch stage (composed once, the record
naming its ancillary); the satellite and GOES suites stage the same
fixtures under the raw root (stage_ancillary) so no test reaches the
GFS bucket.
The registry document (rust/xue/registry.json, and its trimmed shell
copy web/src/data/registry.ts) holds each channel’s and gun’s label, unit,
parameter block, band block or producer id and codebooks, and each
composite’s components in order, identical across the Python encoder,
the Rust encoder and the shell (docs/registry.md).
tests/fixtures/goes/ is eighteen windows cut from real GOES-19 CMIPF
files (tests/prepare_goes_fixture.py: the six dust channels and the
three solar bands of two consecutive scans, 220 × 220 cells at 2 km and
the same ground at each band’s own resolution, cut with gdal_translate -of netCDF -srcwin, which keeps the geostationary mapping, the band’s
packing and fill — the Venezuelan coast and Trinidad, 66–62°W, 7–11°N),
and tests/test_goes.py runs them the same way under the goeseast
source: the hour-directory listing and its request count, the slot rule,
the reissue rule, the single-file download, the warp, the Dust RGB with
the ABI stretches (and that they differ from the SEVIRI set on the
scene), the true colour with the synthetic green, the series, the ingest,
the conversion on the East disk with the ABI band block, and the native
encoder byte for byte. GOES-West is the same reader on its own
bucket and grid; its tests are the registry’s.
tests/fixtures/meteosat/ is one real FCI chunk (chunk 20 of a
full-disk cycle from EUMETSAT’s public MTG test data, the spectrally
representative FDHSI cycle of May 2022: simulated 2017 radiances in the
operational format, rows 2645–2784 of the grid, the strip from the
equator to 2.5°S) and a trimmed real search response, and
tests/test_meteosat.py runs them under the meteosat source with the
chunk standing for every chunk of every slot (the reader’s
needed_chunks narrowed to it): the store’s own response parsed, the
token minted, refused and renewed and a rate limit waited out against a
fake opener, the chunk names, the cycle’s slot, the needed chunks and
the elevation angle behind them, the Planck conversion against the
formula, the strip’s footprint and its numbers read back through GDAL’s
own unscaling, the vis_06 strip on the 1 km grid held to
π L d² / E_sun off the file’s own constants cell for cell (the algorithm, not
the 2017 test product’s absolute values), the solar frames and the true
colour composed from them by day, the IR 3.8 strip in kelvin and the true
colour’s night side composed from it and IR 10.5, the producer with
three inputs held to dust_rgb with the 10.5 µm plane as the green
minuend, the hourly slots against a store that lists ten-minute cycles,
the series, the ingest, the conversion with the FCI band block and the
hourly axis, and the native encoder byte for byte when the wheel knows
the source. The GDAL-backed cases skip without hdf5plugin.
Part of the Xue specification, licensed under CC BY 4.0.
18 - River flow in a showcase case
In the viewer: the network case /showcase/guadalupe-2025 and the grid cases /showcase/valencia-2024-efas and /showcase/valencia-2024-efaswb.
A flood is told by its rivers: how much water each reach carried, hour by
hour, against what it usually carries, and what the gauges on it measured.
A showcase case may carry that beside its weather field, in a river/
directory of its own named by the case’s river block
(showcase/README.md). There are two kinds. A
network case has a hydrological model’s output on a river network —
one value per reach per frame, the National Water Model on the Guadalupe
in July 2025 — and publishes the reaches as GeoParquet and each track as a
network store. A grid case has its
model’s discharge as the case’s own gridded field (EFAS on the Valencia
DANA of October 2024, built by the ordinary case pipeline), and its
river/ directory carries only what the field does not: the gauges'
observed series, their reported peaks and the mapped flood extents. Xue
models nothing itself; it carries what the model, the gauge operators and
the mapping service published. This document is the normative description
of that directory, version 1.
1. Delivery
Everything is a static file inside the case’s directory,
showcase/<id>/river/, built once (python -m xuebuild.river build showcase/river-cases/<id>.json) and never rewritten.
index.jsonis the directory’s entry point (§2). The catalog row’sriverblock names it and carries itsbyteLengthandcrc32(zlib CRC-32 of its bytes, eight lowercase hex digits), so it is requested asriver/index.json?v=<crc32>.- Every other path is in the index, relative to it: no leading
/, no.., no.component. Request each as<path>?v=<crc32>with the CRC the index carries; a store’s CRC is that of its groupzarr.json(zarr-profile.md, “Attributes”) and is the?v=of every object in the store. - A network case holds
reaches.parquet(the GeoParquet), one<track id>.zarrper track,gauges.jsonlandindex.json; a grid casegauges.jsonl, anextent/directory of GeoJSON files andindex.json.
2. index.json
versionis1; a reader refuses any other.kindisnetworkorgrid. No key outside those this section names may appear.geometry(network only, required there): the GeoParquet (zarr-profile.md, “Network store”): itspath(a.parquetfile),byteLengthandcrc32, its row countfeatureCountand its row group lengthrowGroupRows. Every store of the case names the same file with the same four numbers.tracks(network only, required there, non-empty): one network store each, in the order the viewer offers them.idis a unique slug (lowercase letters, digits,_,-,.) and the store is<id>.zarrby convention;kindisanalysis(the model’s best estimate of what happened, one window) orforecast(one cycle); itsrunTimeequals the store’s ownrunTime— the cycle of a forecast, the first frame of an analysis. A forecast’s frames start where its product does (the NWM short range at +1 h).storeis{path, byteLength, crc32}: the store’s path (a.zarrdirectory), the sum of its objects' lengths and the CRC-32 of its group document.gauges(optional, default empty): observation points, each with a uniqueid(the operator’s own), aname,lonandlat(WGS84 degrees), thesourceoperator, theunitof its values (m3/s), and:feature(network only, required there): the GeoParquet row of the reach the gauge sits on, which is also the store’s feature index. A grid gauge has none: the viewer samples the case’s own field.sample(grid only, optional):[lon, lat]of the model cell the gauge was snapped to, where the viewer samples the field instead of at the gauge itself; a gauge on a narrow river can fall a cell off it.series(required):{path, offset, length}, the byte span of the gauge’s line ingauges.jsonl(§3).pathis alwaysgauges.jsonl.outflow(optional): the same span for a second line, the outflow of a gauge on a dam (the Forata reservoir): its line’sidis the gauge’s followed by.outflow.peaks(optional): reported peak values, each{time?, value, unit?, note?}: the time as ISO 8601 UTC ending inZwhere the report gives one, the value, the unit where it is not the gauge’s (a stage inmorft), and a short note saying what the value is and who reported it (USGS, estimated;peak inflow (CHJ SAIH)).
extent(optional, default empty): mapped flood extents, each{path, byteLength, crc32, at, credit}: a GeoJSON FeatureCollection of polygons in WGS84 (a.geojsonfile), the time of the imagery it was mapped from (at), and the credit line its producer requires.credits: the attribution lines the case must show, as given by the data’s publishers.disclaimer(optional): one line the viewer shows beside the river data.- A grid index with neither gauges nor extents says nothing and is refused.
3. gauges.jsonl
One file per case, one gauge series per line, each line one JSON object in the compact serialisation of the point products (no spaces, ASCII, keys as below):
time: strictly increasing ISO 8601 UTC times ending inZ;value: one number ornull(no reading) per time, in the gauge’sunit.stageandstageUnit(together or not at all): the water level, one number ornullper time. The times are the union of the discharge and stage readings, so a time with only one of them hasnullin the other.- A gauge’s
seriesspan in the index is its line’s JSON object exactly, without the newline (the synop contract,synop.md): issueRange: bytes=<offset>-<offset + length − 1>againstgauges.jsonl?v=<crc32 of the index>— the file is immutable with the directory — and parse the bytes on their own. The lines are in the index’s gauge order.
The series are what the operators published, unedited: the USGS’s
instantaneous values with their provisional and estimated spans (the
Guadalupe at Hunt stopped reporting stage at its peak and the USGS
estimated the discharge after it), or a series digitised from an
operator’s report where no download exists (the CHJ’s SAIH hydrographs of
October 2024, about 1 % of full scale). A case’s README and the peaks
notes say which.
4. Reading
- Fetch the catalog row’s
river.indexunder itscrc32, and validate it (§2). A viewer that does not know the block plays the case without river data. - A network case: fetch
reaches.parquet— or, for one area, its footer and the row groups whosebboxstatistics meet the view — and open the chosen track’s store (zarr-profile.md, “Network store”). A frame is one range of the shard; colour each reach by its ratio tobaseflow, or, when the row’s block namescolor(one of the case’s variables), by its value through that bundle’s palette and codebook, as the field draws it. - A gauge: one range of
gauges.jsonl. On a network case its modelled series is the store’s columnfeature; on a grid case, the case’s field sampled atsample(or atlon/lat). - An extent: fetch its GeoJSON and draw it from
aton, with its credit.
5. Writing
python -m xuebuild.river build showcase/river-cases/<id>.json reads the
work directory a definition names (its case.json lists the frames, the
gauges with their series files and the extents) and writes the case’s
river/ directory whole, the index last, then reads the index back
through the validator (xuebuild/river/schema.py::read_index), which
checks every file it names against what is beside it. The definition:
work and output are relative to the working directory (--work and
--output override them); a network case names its model and its
tracks — an analysis track takes the whole analysis window, a forecast
track the frames of one cycle — and either kind picks its gauges by id and
its extents by path from the work directory. credits defaults to the
work directory’s. Writing GeoParquet needs pyarrow.
Part of the Xue specification, licensed under CC BY 4.0.
19 - The indicators product
Agriculture indicators are crop-area-weighted daily weather quantities over
the main soybean regions of the United States, Brazil and Argentina,
computed from the forecast runs Xue already publishes. They are not a
raster and not a new source: xue indicators-build
(xuebuild/indicators/) reads each source’s newest run through the
public stores, exactly as any outside reader does
(zarr-profile.md, “Reading”), aggregates it over each
region with fixed weights, and appends one line per run to a static file.
The product holds physical quantities only: temperatures, precipitation,
soil temperature and water, area fractions and degree days. This document is the normative
description of that product, schema v2.
1. Delivery
Everything is a static file under indicators/ at the data root.
index.jsonis served with caching disabled. Every other object is read as<path>?v=<crc32>, with the CRC-32 (zlib, eight lowercase hex digits) the index gives for it.- A month file only grows. A new run is one line appended to the file of
its run time’s UTC month; bytes already written never change, so every
offset the index has ever published stays valid. Appending changes the
file’s CRC-32 and so its
?v=: the new length is a new URL, and an edge cache holding the old URL holds a consistent prefix of the new file. A reader takes?v=from the index it just read; a range past the end of a stale cached copy answers 416, which means the index read was older than the file. - Write order. Month files, then season files, then
index.jsonlast. An object exists before anything names it. - Reading one run. The index row for a run gives
offsetandlengthinto its month file;Range: bytes=<offset>-<offset + length − 1>returns exactly that run’s line, its newline included, the same way the point products’ JSONL is read (docs/contribution/point-products.md). A whole month file is newline-delimited JSON, one run per line in the order they were appended. - Serialisation. Every object is compact JSON with ASCII escapes, keys
in the order this document lists them, so a file’s CRC-32 is a function
of its content (
pointproduct.encode_json). A line is that encoding followed by\n. - The product is kept forever; nothing prunes it.
2. Regions
Three country composites and thirteen sub-regions. A region’s weight on a grid cell is the soybean physical area on that cell inside the region’s admin-1 units (§7). Local days are taken at a fixed UTC offset per region, never a time-zone table: the boundary does not move with daylight saving (in the United States summer, local civil midnight is 05:00 UTC, the indicators’ day begins at 06:00 UTC).
| id | name | ISO 3166-2 units | UTC offset |
|---|---|---|---|
us-soy | United States soybean belt | US-IA, US-IL, US-MN, US-IN, US-NE, US-OH, US-MO, US-SD, US-ND, US-KS, US-WI, US-MI, US-AR | −6 |
us-ia us-il us-mn us-in us-ne | Iowa, Illinois, Minnesota, Indiana, Nebraska | one each | −6 |
br-soy | Brazil soybean states | BR-MT, BR-PR, BR-RS, BR-GO, BR-MS, BR-MG, BR-BA, BR-MA, BR-TO, BR-PI | −3 |
br-mt br-pr br-rs br-go br-ms | Mato Grosso, Paraná, Rio Grande do Sul, Goiás, Mato Grosso do Sul | one each | −3 |
ar-soy | Argentina soybean provinces | AR-B, AR-X, AR-S, AR-E, AR-L | −3 |
ar-ba ar-cb ar-sf | Buenos Aires, Córdoba, Santa Fe | one each | −3 |
The index’s regions[] lists each with id, name, country (ISO
3166-1 alpha-2), subdivisions, utcOffsetHours and parent (the
composite a sub-region belongs to, null on a composite).
3. Crop calendar
Each region has a season window, over which §4.2 accumulates, and a
flowering window inside it (flowering and pod set). Windows are
month-day ranges, inclusive at both ends. A season inside one calendar
year is named by its year (2027); one that runs over the new year by
both (2026-27).
| regions | season | flowering |
|---|---|---|
us-* | 05-01 → 09-30 | 07-01 → 08-31 |
br-soy | 10-01 → 03-31 | 11-15 → 02-28 |
br-mt | 10-01 → 03-31 | 11-15 → 01-31 |
br-pr, br-go, br-ms | 10-01 → 03-31 | 12-01 → 02-15 |
br-rs | 10-01 → 03-31 | 12-15 → 02-28 |
ar-* | 10-15 → 04-30 | 01-01 → 02-28 |
Sources: USDA NASS Agricultural Handbook 628 (United States planting and
harvest dates), CONAB crop progress (Brazil), Bolsa de Comercio de Rosario
and Bolsa de Cereales de Buenos Aires (Argentina). The index publishes the
table as calendar with its version (§8).
4. Features
4.1 One run: features/<source>/<yyyy-mm>.jsonl
Sources: gfs, ecmwf, aifs (0.25° grid) and ifshres (0.1° grid),
each read from its live pointer. Inputs are the tmp2m (°C) and prate
(mm/h) bundles. A temperature frame is an instant; a rate frame is taken to
hold over the step that ends at it ((previous offset, offset], the first
from the run time). GFS’s rate is instantaneous and the others’ a mean
over that step; the indicators treat both alike.
Where the run publishes them, the soil bundles tsoil1…tsoil4 (°C) and
soilw1…soilw4 (m³/m³) are read as well. A layer number is the source’s
own layer, counted from the surface; the depths are the centres’, not one
set:
| source | layers | depths |
|---|---|---|
gfs | 1–4 | 0–10, 10–40, 40–100, 100–200 cm (Noah) |
ecmwf | 1–4 | 0–7, 7–28, 28–100, 100–289 cm (HTESSEL) |
aifs | 1–2 | 0–7, 7–28 cm |
ifshres | none | — |
Volumetric soil water is the land model’s own state, held to its own
field capacity and wilting point: the same number is not equally wet in
two models. Compare a model with itself (a run with the previous one, a
day with an earlier day), not across sources. A soil field a run does not
publish is null on every day.
A line:
| field | meaning |
|---|---|
source, run, runTime | the run, run as YYYYMMDDHH |
manifest | the run’s manifest path under the data root and the ?v= it was read at (null for a run read by name, which has no pointer) |
weights | the weights file’s version, grid and CRC-32 |
calendar | the calendar version |
horizon_days | the last temperature frame’s lead, in days |
frame_step_hours | the temperature axis as [through_hour, step_hours] segments: the daily maximum and minimum are over these frames, not true extremes |
regions | per region present in the weights, in §2 order: days and summary |
Each day, one object per local calendar date the run’s temperature frames reach:
| field | unit | definition |
|---|---|---|
date | — | the local date, YYYY-MM-DD |
t2m_mean | °C | mean over the day’s frames of the area-weighted 2 m temperature |
t2m_max | °C | area-weighted mean of each cell’s highest 2 m temperature among the day’s frames |
t2m_min | °C | area-weighted mean of each cell’s lowest 2 m temperature among the day’s frames |
precip | mm | area-weighted precipitation total over the local day |
dry_frac | 1 | crop-area fraction whose daily precipitation is below 1 mm |
hot30_frac | 1 | crop-area fraction whose daily highest 2 m temperature is above 30 °C |
hot35_frac | 1 | crop-area fraction whose daily highest 2 m temperature is above 35 °C |
gdd | °C d | growing degree days, max(0, min(t2m_mean, 30) − 10) |
tsoil1 … tsoil4 | °C | mean over the day’s frames of the area-weighted soil temperature of the source’s layer, or null |
soilw1 … soilw4 | m³/m³ | mean over the day’s frames of the area-weighted volumetric soil water of the source’s layer, or null |
complete | boolean | every frame the source’s axis places in the day is present |
The eight soil fields, one row per id for the index’s features:
| id | layer |
|---|---|
tsoil1 | soil temperature, layer 1 |
tsoil2 | soil temperature, layer 2 |
tsoil3 | soil temperature, layer 3 |
tsoil4 | soil temperature, layer 4 |
soilw1 | volumetric soil water, layer 1 |
soilw2 | volumetric soil water, layer 2 |
soilw3 | volumetric soil water, layer 3 |
soilw4 | volumetric soil water, layer 4 |
The operation order is part of the output:
- A temperature frame belongs to the local day containing its valid time; a frame exactly at local midnight opens the new day.
- Per day, in axis order: each frame’s area-weighted mean
Σ w·T(float64);t2m_meanis the plain mean of those; per cell the maximum and minimum over the day’s frames, then their area-weighted means; the hot fractions are the weight of the cells whose daily maximum exceeds the threshold. - Each rate frame’s step is split over the local days it overlaps in
proportion to the seconds in each,
rate × hoursper cell, accumulated in axis order;precipis its area-weighted mean anddry_fracthe weight of the cells below 1 mm. gddcomes from the unroundedt2m_mean(base 10 °C, cap 30 °C).- Soil, per field: a soil frame belongs to its local day as in step 1.
A cell is not soil where its water is at or below 0 m³/m³ (the
codebook’s bottom code, which the stores write where a record is
masked, or IFS’s 0 over the sea), where its temperature is the bottom
code (−61 °C), and, for a temperature, where the same layer’s water is
not soil. Each frame’s area-weighted mean is over the soil cells, the weights
renormalised over them; a frame whose valued cells carry less than half
the region’s weight has no mean. The day’s value is the plain mean of
its frames’ means,
nullwhen none has one. The soil axis is the bundle’s own and does not entercomplete. - Every number is rounded once, at the end, to two decimals; the soil water fields to three.
complete is true when the run starts at or before the day, every
temperature frame the source’s published axis places in [start, end) is
present, and every rate frame it places in (start, close] is present,
where close is the first axis offset at or after the day’s end. The first
and last days of a run are usually incomplete; a reader filters on it.
summary sums the first 7 complete days, which every source reaches, so
summaries compare across sources: days (how many there were),
precip_sum, gdd_sum and hot35_days (the sum of hot35_frac), from
the rounded daily values, and soilw1_change, the last of those days'
soilw1 less the first’s (null unless both have one).
A line stores raw values only. The change between two runs for the same date is the reader’s subtraction of two lines.
4.2 In-season totals: season/<region>.<season>.json
From ECMWF IFS (ecmwf) only, rewritten whenever an ECMWF run is added.
Each local day of the season is taken from the newest ECMWF run that
started at or before the day began and has that day complete: normally
the cycle within twelve hours before it (Xue publishes the 00 and 12 UTC
cycles), the first-day forecast standing in for an analysis. When that
cycle is missing an older one supplies the day and the day is partial. A
day is counted once the newest indexed ECMWF run is that cycle or a later
one, and is replaced only by a newer qualifying run.
One source keeps the totals from mixing models. Over the Brazilian cerrado
in the dry-to-wet transition GFS runs several degrees warmer and drier than
IFS and AIFS from the first day on, where airport observations side with
IFS; AIFS leaves almost no crop area below 1 mm on a wet day. IFS shows
neither, and it publishes all four soil layers. Its first day is three-hourly,
so t2m_max is the warmest of eight frames, not of twenty-four.
A season file of schema 1 (GFS) is not carried on: the first version 2 build rebuilds each season from the ECMWF lines on hand, which reach back to the product’s first day.
| field | meaning |
|---|---|
region, season, source | the file’s identity; source is ecmwf |
calendar, weights, windows | versions, and the region’s season and flowering windows as ["MM-DD", "MM-DD"] |
throughRun | the newest ECMWF run the file reflects |
days_counted, days_partial | rows in daily, and how many are partial |
precip_total (mm), gdd_total (°C d), hot35_days | sums over daily (hot35_days sums hot35_frac) |
cdd_current, cdd_max | consecutive days with precip below 1 mm, at the last row and the longest; a date missing from daily ends a spell |
days_counted_window, precip_window, hot35_days_window | the same over the rows inside the flowering window |
daily | one row per counted date: date, run, lead_hours (from the run to the day’s start), partial, flowering, then the §4.1 day fields |
The series exists from the day the product went live; no source used here is archived, so it is never backfilled.
5. index.json
| field | meaning |
|---|---|
schemaVersion | 2 |
product | indicators |
note | a fixed sentence: what the numbers are and that no agency issued them |
attribution | {name, data, license} per upstream (§10), plus citation (the form the upstream asks for) and notice (a sentence it requires on adaptations) where the upstream’s terms call for them |
regions | §2 |
features | {id, unit, definition} per day field, the table of §4.1 |
calendar | {version, source, regions: {<id>: {season, flowering}}}, §3 |
weights | {version, spam, files: [{grid, path}]} |
sources | per source: id, grid, cadence, latestRun (the newest indexed run, or null), ok, error (null when ok) |
files | every published object but the index and the weights, sorted by path: {path, byteLength, crc32}, and for a month file also runs: [{run, offset, length}], which tile the file from offset 0 |
A source that fails (an unreadable pointer, manifest, store or weights
file) reports ok: false with its error and adds nothing; the others go
on. A run already in files is not computed again.
6. context/oni.json
NOAA CPC’s Oceanic Niño Index (oni.ascii.txt): the three-month running
mean of the Niño 3.4 sea surface temperature (total, °C) and its
departure from CPC’s moving 30-year base (anomaly, °C).
{schemaVersion, id: "oni", name, unit, source: {name, url, license}, fetches: [{fetched, rows, crc32}], rows: [{season, year, total, anomaly}]}. rows is the newest table whole, since CPC revises its last
months; fetches records every fetch that changed it, with the CRC-32 of
the text as served. xue indicators-context refreshes it at the start of
every publish job; a failed fetch leaves the pulled file in place.
7. Weights: weights/<grid>.zarr/
One Zarr v3 group per grid (0p25 for GFS, ECMWF and AIFS, 0p1 for IFS
HRES, t126 for CFSv2), built once offline from SPAM 2020 v2r2 soybean
physical area (SOYB_A) and Natural Earth admin-1 polygons, with exact
area overlap between the SPAM cells and the published cells. Any Zarr v3
client opens it (xr.open_zarr(url, consolidated=False)); the build reads
it with NumPy alone, as below.
Group attributes:
| attribute | meaning |
|---|---|
version | the weights version (§8) |
spam | the SPAM release and layer, SPAM 2020 v2r2 SOYB_A |
citation | the citation IFPRI’s terms of use ask for, as in §10 |
notice | the sentence IFPRI’s terms of use require on adaptations, as in §10 |
grid | the grid id |
regions | region id → {"rows": [row0, row1], "cols": [col0, col1]}, the half-open box of the region’s non-zero cells |
lon_convention | how the grid points are laid out, in words: Grid points at cell centres: longitudes ascend from -180, latitudes run north to south. on the global grids |
Arrays:
weights:float32, shape[regions, ny, nx]over the whole published grid, zero outside the region; each region sums to 1.dimension_names["region", "lat", "lon"],fill_value0. Onesharding_indexedcodec with one shard per region: the outer chunk is[1, ⌈ny/180⌉·180, ⌈nx/180⌉·180]([1, 900, 1440]for0p25; Zarr requires whole inner chunks, and the cells past the grid are padding), the inner chunk[1, 180, 180]under[bytes little-endian, zstd]with no content checksum, and the index at the end under[bytes little-endian, crc32c], as inzarr-profile.md. Inner chunks that are all zero are never written (the index pair2^64 − 1) and read as zero.region: the region ids in the order of theweightsaxis, Zarr’sfixed_length_utf32(what zarr-python writes for a NumPy<U6).lat,lon:float64cell centres. Rows and columns are the bundle stores’ own:lon[i] = firstLongitude + i · longitudeStep,lat[j] = firstLatitude + j · latitudeStep, north to south.t126is the Gaussian grid taken as equidistant, as its bundles describe it.
Reading one region: the two documents and the coordinates, then the
region’s shard index as the suffix range bytes=-N (CRC-32C checked),
then only the inner chunks overlapping its box, neighbouring ones merged
into one range. A reader holds the box to summing to 1 (so nothing lies
outside it) and applies the weights only to a bundle store whose grid has
the same shape and cell centres. The weights.crc32 a line records is the
CRC-32 of the group and array documents followed by every region’s boxed
weights as read (float32, little-endian, in axis order).
8. Versions
schemaVersionis the layout of this document. A field added within it is a widening: readers ignore what they do not know, old lines are not rewritten.- Version 2 added the soil fields and
soilw1_change, cutsummaryfrom 14 to 7 days and moved the season files from GFS to ECMWF. Lines are never rewritten, so a month file can hold version 1 lines followed by version 2 ones: a reader takes each line’s ownschemaVersion(a version 1 line has no soil fields and a 14-day summary). The index and the season files are rewritten whole, so they are all of one version. calendar.versionchanges with any window;weights.versionwith any weight. Every line and season file records the versions it was computed under, and lines already written are never recomputed under new ones.- A line is reproducible: the same run, weights and calendar give the same
bytes (
xue indicators-build --forcechecks this instead of rewriting).
9. Validation and vocabulary
Before anything is written, the index, every line and every season file
are validated (xuebuild/indicators/schema.py): temperatures −60 … 60 °C,
daily precipitation 0 … 500 mm, fractions 0 … 1, degree days 0 … 20,
soil temperature −60 … 60 °C and soil water 0 … 1 m³/m³ or null,
t2m_min ≤ t2m_mean ≤ t2m_max, hot35_frac ≤ hot30_frac, dates
ascending, the run spans tiling each month file. A line that fails is
dropped whole and its source reports the error.
Words that never appear
The product describes the weather over farmland and nothing else. No key
and no string value in any file contains, as a word, signal, alert,
warning, watch, bull, bear, long, short, price, contract,
ticker, trade, hedge, position or yield (nor their plurals), and
the files carry no market data, no company and no direction. Thresholds
are named by their numbers (hot35_frac), never by a level of concern.
The validators enforce the list on every write. The one exception is an
attribution entry’s notice, an upstream’s own sentence quoted as its terms
require (§10).
10. Attribution
The index carries the credit for each upstream:
- NOAA NCEP — GFS forecasts; public domain (U.S. Government work).
- ECMWF — IFS and AIFS open data; CC BY 4.0.
- Open-Meteo — ECMWF IFS HRES as forwarded by Open-Meteo; CC BY 4.0.
- IFPRI — SPAM 2020 v2r2, doi:10.7910/DVN/SWPENT; CC BY 4.0.
- Natural Earth — admin-1 boundaries; public domain.
- NOAA CPC — Oceanic Niño Index; public domain.
IFPRI’s terms of use (Harvard Dataverse, the IFPRI Datasets Terms of Use
Statement of December 2019) release the dataset under CC BY 4.0 and ask two
things of any adaptation, which the weights are. The index entry and each
weights store carry both, as citation and notice:
International Food Policy Research Institute (IFPRI). 2024. Global Spatially-Disaggregated Crop Production Statistics Data for 2020 Version 1.0.0. https://doi.org/10.7910/DVN/SWPENT. Harvard Dataverse. Version 3.
This data was provided by the International Food Policy Research Institute (IFPRI). IFPRI bears no responsibility for the analyses or interpretations of the data presented here.
Nothing here is endorsed by IFPRI, and no IFPRI mark is used.
Part of the Xue specification, licensed under CC BY 4.0.
20 - The data API
Experimental. The API may change or break without notice, including routes, parameters and response shapes, and it has no versioning promise beyond the
/v1prefix. It runs on a best-effort basis with no guarantee of availability or of freshness: a run can reach the API late, or not at all. For anything that must keep working, read the static catalog and the Zarr stores directly (docs/stac.md,docs/zarr-profile.md), which are the published data contract.
In the viewer: /api is a console for these routes.
https://xue-api.ringsaturn.me is a read-only JSON service over the
published dataset. It resolves a run the way the STAC catalog does
(Collection → live pointer → manifest), reads the bundle’s Zarr store with
ranged requests and decodes the quantized codes with the same xue crate
the viewer’s wasm decoder uses. The point products — soundings, airports,
surface stations, air-quality stations, weather alerts, tropical
cyclones — it reads through their own pointer
and index, one station per ranged read, and answers in physical units. It
writes nothing. The viewer does not depend on it, so the site and the
catalog work when it is down.
This document is the contract (how the same routes run on a self-hosted
origin, and why, is in
contribution/api-origin.md). rust/xue-worker/static/openapi.json is
its machine copy, served at /v1/openapi.json with the live source list
filled in and rendered at /docs (Swagger UI). A test holds the two to the
same set of routes. https://xue.ringsaturn.me/api.html is a console
that builds and sends requests from a browser, and finds a /v1/cell
row and column from a latitude and longitude.
Everything a response says comes from the bucket at request time: the sources, a run’s variables, grids and codebooks. A new source, variable or run needs no deploy of the API.
Endpoints
All are GET (and HEAD), answer application/json; charset=utf-8 and
carry access-control-allow-origin: *, with
access-control-expose-headers naming the headers below (and
retry-after, age, cf-cache-status) so a page can read them.
OPTIONS answers the CORS preflight. Unknown query parameters are
ignored.
| Route | Answers | Cache-Control |
|---|---|---|
GET /health | {status, build, now}; never touches the bucket | no-store |
GET /v1/openapi.json | the OpenAPI 3.1 contract, its source enum the live Collections (also at /openapi.json) | max-age=60 |
GET /v1/catalog | {dataOrigin, collections: [{id, title, href}]}, one entry per child of the root catalog | max-age=60 |
GET /v1/sources/{source} | one source’s live run (§ Sources) | max-age=60 |
GET /v1/point | one cell’s series for one or more bundles (§ Point) | max-age=30, or a day with run= |
GET /v1/cell | one grid cell’s series in a named run (§ Cell) | a day |
GET /v1/soundings | the radiosonde stations of the live issue (§ Soundings) | max-age=60, or a day with issue= |
GET /v1/soundings/{station} | one station’s ascents | same |
GET /v1/airports | every airport’s newest observation (§ Airports) | same |
GET /v1/airports/{icao} | one airport’s METARs and TAF | same |
GET /v1/synop | every surface station’s current values (§ Surface stations) | same |
GET /v1/synop/{station} | one station’s 24-hour window | same |
GET /v1/aq | every air-quality station’s current values (§ Air-quality stations) | same |
GET /v1/aq/{station} | one air-quality station’s 24-hour window | same |
GET /v1/alerts | the weather alerts in force (§ Alerts) | same |
GET /v1/alerts/{id} | one alert’s full record | same |
GET /v1/storms | the tropical systems of the live issue (§ Storms) | same |
GET /v1/storms/{storm} | one storm’s tracks | same |
Every response carries x-xue-api (the build) and x-xue-ms (the
server’s own wall time, a diagnostic, not part of the contract). A point
or cell read carries x-xue-run, a product read x-xue-issue: what the request
resolved to.
Point
| Parameter | Required | Meaning |
|---|---|---|
source | yes | a Collection id: gfs, ecmwf, mrms, himawari, … |
lat | yes | degrees, −90 to 90 |
lon | yes | degrees, −180 to 360; a longitude past 180 wraps onto the same cell |
variables | no | bundle ids, comma-separated (tmp2m,wind10m) or repeated (variables=tmp2m&variables=wind10m); the run’s first bundle when absent |
time | no | an ISO 8601 instant; the frame nearest to it is returned. Without it the whole axis is |
run | no | pin a run instead of following the live pointer: a STAC Item id (gfs.2026092506, mrms.2026092509.1455), a run directory (mrms.2026092509/1455) or a run id |
The response:
variablesis a flat map keyed by variable id, whatever was asked for. A vector bundle answers as its components, each naming itsbundle. The API does not derive speed or direction.valuesfollowstime.timesone to one. Bundles of one run need not share an axis (ECMWF’s de-accumulatedpratehas no analysis frame), sotime.timesis the union of the requested bundles’ axes and a variable isnullat a time its bundle has no frame for; the order the bundles are listed in does not change the answer.nullis a missing code (the variable’snodataCode, or a chunk the store never wrote). Values are the codebook’s: a linear field is quantized to its step (0.1 °C fortmp2mread from a series store), a log1p field (prateon a map store, the aerosol fields) to its scale. A linear value is spelled with as many decimals as its codebook’soffsetandscaleneed (12.9, never12.900000000000006); a log1p value is spelled as computed.quantizationis that codebook, as the STAC Item’sxue:quantizationspells it (docs/stac.md). Alinearvalue isoffset + k × scale, withinscale / 2of the source field, and only in[offset, offset + maximumCode × scale]: a field beyond that range is clamped to it. Alog1pcodebook spaces its codes evenly inlog1p(value / scale)fromtracetomaximum, one step being(log1p(maximum / scale) − log1p(trace / scale)) / (maximumCode − minimumCode): a value well abovescaleis within half a step relative (about 3 % forprate), one well below it withinscale× half a step absolute. Belowtraceit is 0; abovemaximumit isnull(theoverflowCode).timesare UTC with milliseconds. On an observation window they are the frames’ own times; on the aurora window they are valid times about an hour ahead of the clock (docs/sources.md).cellis the grid cell the point falls in, by the rule the viewer’s probe and shader use (xue::zarr::probe_cell): nearest cell, longitude wrapped onto the grid’s origin. Itslongitudeandlatitudeare the cell’s true centre: through the projection on a projected grid, the Gaussian latitude on a Gaussian one.timezoneis the IANA zone of the requested point (not of the cell: on a coarse grid the cell centre can sit across a border from it), looked up in thetzf-rspolygon index compiled into the server. Open sea answers the nautical zone (Etc/GMT+10, whose sign is POSIX-inverted);nullonly where no polygon covers the point, which the bundled data does not have.timesstay UTC; the zone is for the client to convert them with.- A bundle whose manifest entry carries a
seriescompanion (docs/zarr-profile.md, “Series store”) is read through it: one chunk for the whole axis. Otherwise its map store is read, one chunk per time chunk. The response is the same either way.
Cell
The same read addressed by grid cell in a named run, for a client that
repeats a place: ask /v1/point once, then read the run, cell.row and
cell.column it answered. Every coordinate in a cell resolves to one URL,
and with the run fixed the answer never changes, so it caches for a day.
| Parameter | Required | Meaning |
|---|---|---|
source | yes | a Collection id |
run | yes | the run, spelled as for /v1/point; /v1/sources/{source} names the live one |
row, column | yes | the cell’s indices on the bundle’s grid, 0 at its first (north-west) cell. On a projected grid they count along the projection’s axes, so neither follows a parallel or a meridian |
variables | no | as for /v1/point; a bundle listed twice is read once |
time | no | as for /v1/point |
The response is /v1/point’s, with two differences: request echoes
{row, column, variables}, and timezone is the cell centre’s.
- Every requested bundle must be on one grid, since
row/columnindex it. A source’s bundles usually share a grid; a reduced-resolution variant or a wave field may not (400 grid_mismatch). Read those separately, each with the cell/v1/pointreports for it. - A cell’s address belongs to its run’s grid, which may change between runs
of one source (a model moved from a resampled to its native grid). Keep
run,cell.rowandcell.columntogether, and ask/v1/pointagain for a new run. - A
runthe prune jobs have deleted answers404 unknown_run: ask/v1/pointagain for the live run and its cell.
Sources
GET /v1/sources/{source} reads the source’s Collection and its live STAC
Item:
| Field | From |
|---|---|
source, title, description, license | the Collection |
run | the Item id, else the Collection’s xue:live |
runTime | the Item’s forecast:reference_datetime, else its datetime |
bbox, time | the Item’s bbox and cube:dimensions.time |
variables | the Item’s cube:variables as a flat table: {<variable id>: {bundle, label, unit, quantization}}, quantization its xue:quantization (null where the Item has none) |
The ids /v1/point?variables= accepts are the distinct bundle values of
variables. A source with no live Item answers an empty table.
kind says what the source is and endpoint which route reads it:
grid and /v1/point for a run or an observation window, point and the
product’s list route (/v1/soundings, /v1/airports, /v1/synop,
/v1/aq, /v1/alerts, /v1/storms) for a point product; null for a point product the API only
names (nexrad). Asking /v1/point for a point product is 400 not_a_grid, whose detail.endpoint is the right route.
Point products
The soundings (docs/sounding.md), airports (docs/airport.md), surface
stations (docs/synop.md), air-quality stations (docs/aq.md), weather
alerts (docs/alerts.md) and tropical cyclones (docs/tc.md) share one
shape on the bucket — a mutable latest-<product>.json naming an immutable
<product>.<issue>/index.json, the records beside it addressed by byte
span — and one shape here: a list route that answers the index, and a
record route that answers one station or storm. Each read costs the
pointer, the index (held in the isolate by its crc) and, for a record, one
ranged request of exactly that record’s bytes.
Every product answer opens with the same four fields:
| Field | Meaning |
|---|---|
product | sounding, airport, synop, aq, alerts, tc |
issue | the issue’s STAC Item id: sounding.2026091402, airport.202609161440 |
issued | the aggregation hour, or the ten-minute round |
generated | when the build ran |
and takes the same optional parameter:
| Parameter | Meaning |
|---|---|
issue | pin an issue instead of following the live pointer: <product>.<YYYYMMDDHH> for the hourly products, <product>.<YYYYMMDDHHMM> for the ten-minute rounds. The hourly products’ issues are found under their UTC day (sounding/2026/09/14/sounding.2026091402/), then flat; a pruned issue is 404 unknown_issue |
The four station lists (/v1/soundings, /v1/airports, /v1/synop,
/v1/aq) take the same spatial selection, and echo it as request:
| Parameter | Meaning |
|---|---|
lat, lon | together: sort the stations by great-circle distance from this point, nearest first, and add distanceKm (to a tenth) to each |
radius | with lat/lon: keep only stations within this many km |
bbox | west,south,east,north in degrees; west > east spans the antimeridian |
limit | at most this many stations: the nearest with lat/lon, the first in index order otherwise |
and count is the number of stations answered. The four record routes
take time, an ISO 8601 instant: only the record nearest to it is
answered (one ascent, one METAR, one observation time); without it the
whole window is. A station’s timezone is its IANA zone, as on /v1/point.
The lists are the index with its byte spans removed and nothing added but
distanceKm; sources is the build’s account of its inputs, verbatim.
Soundings
GET /v1/soundings answers stations[], each
{id, wmo, name, lat, lon, elev, latest, times, headline} as the index has
them (docs/sounding.md §4): id is the WIGOS identifier, wmo the
five-digit number, headline the newest ascent’s t500/td500 (°C),
freezingLevel (gpm), pw (mm) and levels.
GET /v1/soundings/{station} takes the WIGOS id or the WMO number and
answers:
soundingsis newest first, at most four nominal times (time=keeps one). The ascent’s fields are the product’s (docs/sounding.md§5).levelsare the product’s seven fixed-point arrays decoded:pPa → hPa,tandtdK × 100 → °C,wsm/s × 10 → m/s,z(gpm),wd(degrees the wind comes from) andsig(the BUFR 0 08 042 flag word) unchanged.-32768isnull. The arrays are parallel,nlong, andpis the axis: present on every level, strictly descending.derivedis the product’s, computed by the publisher from the fixed-point levels (docs/sounding.md§7), not recomputed here.
Airports
GET /v1/airports answers stations[], the index’s compact rows named:
{icao, lat, lon, elev, obsTime, t, td, wd, ws, gust, vis, qnh, category, tafPresent} (docs/airport.md §4), the values the newest observation’s,
tafPresent a boolean. category= keeps one flight category (VFR,
MVFR, IFR, LIFR). units names each value’s unit.
GET /v1/airports/{icao} takes the ICAO id in any case and answers
station (icao, name, lat, lon, elev, iata, wmo, timezone), units,
metars — the last 24 hours newest first, each a Metar of
docs/airport.md §5 verbatim (time, raw, t, td, wd, ws, gust, vis, qnh, slp, wx, cloud, category, auto, type) — and taf, the current Taf or
null. The product’s conventions hold: vis 10000 means at least 10 km,
wd is null for a variable wind, raw is the authority.
Surface stations
GET /v1/synop answers networks[] (each network’s entry of the index
without its file descriptors: id, name, cadence, prPeriod, attribution, license, url, latest, and whatever further fields the index gives a
network), elements (the element table, each {label, unit, cell, period}) and stations[]: {id, network, lat, lon, elev, rank, name, obsTime, values}, values keyed by element with the station’s
current value or null. network= keeps one network (404 unknown_network otherwise, detail.available listing them).
attribution is the credit a display of that network’s data must show.
GET /v1/synop/{station} takes <network>:<number> and answers in the
shape /v1/point does, so a client reads a station and a grid cell with
one type:
time.timesis the station’s window, oldest first, the product’s epoch seconds written as ISO instants;unitSecondsis the network’s cadence.variableshas one entry per element of the index, whether or not the station reports it (an element it never reported is allnull), withvaluesfollowingtimesone to one, and the element’slabel,unit,cellandperiod. There is nobundlefield.labelis the API’s own.unit,cell(point,mean,sum,max,min) andperiod(seconds a value covers, ending at its time;nullfor an instantaneous value;"network"for the network’s own period —prPeriod,wsPeriod) are the index’selementTable(docs/synop.md). A round written before the table has the API’s own unit andnullforcellandperiod.- The line’s further fields (quality codes, a WIGOS identifier) are not answered; read the product for them.
Air-quality stations
GET /v1/aq and GET /v1/aq/{station} read the air-quality product
(docs/aq.md) exactly as the surface-station routes read theirs, with the
same parameters, shapes and errors. The differences:
networks[]carryavgPeriod(seconds each value averages over) andpreliminary(unvalidated data, which a display must say) instead ofprPeriod; every element’speriodis the network’s ("network").- A list’s station carries
agencyaftername: the agency that runs the station and owns its data, which a display credits with the values where the network’s terms ask it to (AirNow). A record’sstationhasid, network, name, names, lat, lon, elev, rank, agency, timezone(nowmo). - The elements are
pm25,pm10(µg/m³),o3,no2,so2(ppb) andco(ppm), hourly means timed at the end of the hour; a station id is<network>:<the network's own id>(airnow:060371103).
Alerts
GET /v1/alerts answers the live snapshot (docs/alerts.md §5):
networks[] (each network’s entry of the index without its file
descriptor: id, name, attribution, license, url, latest, areas, with
areas.path resolved against the data root, /v1/catalog’s
dataOrigin), categories (the index’s list), alerts[] — {id, network, category, level, event, sent, onset, expires, bbox}, the index’s
rows named, in id order, bbox [west, south, east, north] or null —
and ended[], {id, network, reason, by} for each alert that left with
this round (reason expired, cancelled, replaced or gone; by
the id that replaced it, where the round names one, else null).
| Parameter | Meaning |
|---|---|
network | keep one network (nws, jma, eccc, meteoalarm, cma, hko, cwa); 404 unknown_network otherwise, detail.available listing them. Also filters ended[] |
category | keep one of the index’s categories; any other is 400 invalid_parameter, detail.available listing them |
level | keep the alerts at this level or above, an integer 1 … 5 |
lat, lon | together: keep the alerts in force at this point |
bbox | west,south,east,north; keep the alerts whose box meets it (west > east spans the antimeridian) |
limit | at most this many, the first in id order |
radius is refused (400 invalid_parameter): a point either is in an
alert’s area or is not. The point test has two tiers. An alert with its
own polygon (NWS storm-based warnings, every ECCC alert) is tested against
that polygon, read from its line; a MeteoAlarm alert that also names areas
by code (parts of its area the polygon does not draw) matches a point
outside the polygon by its box, as an area-coded alert does. An alert drawn only by area codes is
tested against its box, which is the union of its areas’ boxes and so
wider than the areas themselves: a point near such an alert’s edge can
match it without being in any of its areas. An alert with neither a
polygon nor a box (a network with no boundary set, such as jma, or a
round written before area boxes) matches no point and no bbox. A client
that needs the exact answer for coded alerts joins areas to the boundary
set (docs/alerts.md §9) itself. A point query costs one ranged read per
alert whose box holds the point.
GET /v1/alerts/{id} takes an alert id, percent-encoded where it carries
reserved characters (nws:urn:oid:…), and answers network and alert:
the alert’s line (docs/alerts.md §6) verbatim — id, network, category, level, native, sent, onset, expires, status, texts, areas, geometry, url, sender, and replaces where the round gives it — with bbox from its
row added. An id not in force in the issue is 404 unknown_alert; one
that ended with this round says how in detail.ended ({id, network, reason, by}), so a client following an alert sees what replaced it.
Storms
GET /v1/storms answers storms[], the index’s rows (docs/tc.md §4)
without their file descriptors: {id, level, basin, name, aliases, position, vmax, pmin, class, classAgency, agencies, models, best}, and crosswalk,
old id → current id. basin= and level= keep one basin (AL, EP,
CP, WP, IO, SH) or level (A, B, C), case-insensitive.
GET /v1/storms/{storm} takes a storm id, an id the issue’s crosswalk maps
onto a current one, or one of a storm’s aliases (EP97, ecmwf:70W), and
answers the storm document (docs/tc.md §5) with resolvedFrom naming
the id the request used when it was not the storm’s own:
id, level, basin, name, sid, intl, aliases, then best, agencies,
models, alert, impact and sources. include= (comma-separated
section names) answers only those sections; the seven identity fields are
always present.
A model’s ensemble (docs/tc.md’s Ensemble: leads, members and
flattened fixed-point arrays) is unpacked into one track per member:
lat/lon are degrees, vmax m/s, pmin hPa, time is base + lead;
a lead at which a member has no position is left out of its track, so a
member that never found the system has an empty points. Deterministic
forecasts and best tracks are passed through as the product writes them.
Errors
| Status | code | When |
|---|---|---|
| 400 | invalid_parameter | source, lat or lon missing or out of range; time not ISO 8601; run not a run name; issue not <product>.<digits>; /v1/cell without run, row or column, or a cell outside the grid (detail gives its rows and columns); lat without lon, radius without them, a malformed bbox, limit under 1; an include section that does not exist; an alerts level outside 1 … 5, a category the issue does not list, or radius on /v1/alerts |
| 400 | grid_mismatch | /v1/cell asked for bundles on different grids; detail.bundles names the first two |
| 400 | not_a_grid | /v1/point asked for a point product; detail.endpoint is the route that reads it |
| 404 | unknown_source | no such Collection |
| 404 | no_live_run | the Collection names no live pointer, the run publishes no bundles, or a product publishes no live issue |
| 404 | unknown_run | run= names no manifest |
| 404 | unknown_issue | issue= names no index (pruned, or never published) |
| 404 | unknown_variable | the run has no such bundle (detail.available lists those it has), or the bundle ships no store |
| 404 | unknown_station | the issue has no such sounding station, airport, surface station or air-quality station |
| 404 | unknown_network | network= names no network of the issue (detail.available lists them) |
| 404 | unknown_alert | the issue has no alert in force by that id (detail.ended says how it left, when it left with this round) |
| 404 | unknown_storm | no storm, crosswalk entry or alias by that id (detail.available lists the storms) |
| 404 | not_found | no such route |
| 403 | forbidden | a self-hosted origin set to answer only its proxy (XUE_API_REQUIRE_HEADER) was reached without it |
| 405 | method_not_allowed | anything but GET, HEAD, OPTIONS |
| 422 | point_off_grid | the point is outside a regional grid (HRRR, a satellite disk) |
| 502 | upstream_failed | a bucket read failed, or a document in it is not what the profile says |
| 429 | rate_limited | a self-hosted origin’s request budget is spent; retry after Retry-After seconds (also detail.retryAfter). Cached answers are not limited |
| 503 | overloaded | too many requests are being computed at once (on a self-hosted origin, possibly only this client’s, XUE_API_INFLIGHT_PER_CLIENT); retry after Retry-After seconds |
Errors are not cached.
Caching and freshness
- A
200from any/v1/data route is stored in the edge cache of the data center that served it, keyed by the full URL, for itsmax-age. A self-hosted origin also keeps it for that long and answers a repeat with the remaining lifetime asmax-age, so the two layers together never hold an answer longer than one would. - A live answer can therefore lag a new run by up to 30 s (60 s for the
catalog, the source summaries and the point products), and two data
centers can briefly answer from different runs. Pin
run=orissue=for a stable answer; it caches for a day because a run’s or an issue’s objects never change under it./v1/cellalways pins its run. - Inside an isolate (or the origin process), the manifest and a product’s index are held by their
pointer’s crc, store documents and shard indices by
path#crc32, and a station’s byte span bypath#crc32:offset+length. The Collection and the pointer are read on every uncached request, so the API never names a run or an issue the prune jobs have deleted.
Limits and attribution
- Requests are rate-limited per IP at the zone. The rule lives in the Cloudflare dashboard, not in this repository.
- There is no key, quota or SLA (see the experimental notice above).
- The data keep their sources’ licences. NOAA products are public domain
(attribution requested); ECMWF, EUMETSAT and JMA require attribution. The
Collection’s
licenseand itsproviders(/v1/sources/{source}, or the STAC Collection) say which applies to a source. - Every
timezonefield contains information from timezone-boundary-builder, which is made available here under the Open Database License (ODbL). The chain is © OpenStreetMap contributors → timezone-boundary-builder → the derived database tzf-dist →tzf-rs, which compiles it into the server; every link is ODbL. A client that shows or republishes those zones keeps that notice with them.
Not in this contract
- Spatial aggregates, area statistics, long-history stitching: those are the encoder’s job, published as products, not computed per request.
- Derived quantities over a product’s records (a skew-T index not in
derived, a METAR decoded further than the service decodes it, a storm’s impact area): the products define what is published and the API returns it; a client computes the rest. - Anything older than the live issue that the bucket no longer holds. The API reads what the prune jobs leave (seven days of hourly issues, three hours of ten-minute rounds); the archive is not its concern.
- The single-site radar (
nexrad): a polar Zarr product, named in/v1/sources/nexradand read from the catalog (docs/nexrad.md).
Part of the Xue specification, licensed under CC BY 4.0.