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.