Available on crate feature
encoder only.Expand description
Build Xue v1 bundles from gridded input — the port of xuebuild/binconvert.py.
Each variable is packaged into its own single-variable .xue file so the
frontend can download exactly the fields it needs. A forecast source
arrives as one GRIB2 file per forecast hour; an observation source
(observation.rs) as one NetCDF file whose bands are the time axis.
Everything past frame discovery — crop, quantize, temporal grouping,
container write, manifest — is the same for both.
Structs§
- Convert
Options - Plane
Grids - One grid per variable of a frame: the run’s single grid for every source
with one, and — on a source with a grid family — the grid of the family
each variable is read from. Mirrors
_grid_forinxuebuild/binconvert.py, where the same thing is aGridInfoor a mapping.
Enums§
- Plane
Sources - How the planes of a frame are read: one file’s plane source (GRIB: the
same for every record) or an observation window’s per-variable ones.
Mirrors
_plane_source_forinxuebuild/binconvert.py.
Constants§
Functions§
- align_
packing_ steps - Round two run-total accumulations onto the coarser of their two packing
lattices before they are differenced, so a frame where the GRIB encoder
coarsened its step does not difference rounding. Returns the planes to
difference,
(current, previous), borrowing whichever is unchanged. Mirrorsalign_packing_stepsinxuebuild/derive.py, rounding half to even as NumPy does. - average_
window_ start - First hour of the window whose interval ends at
hour. - bundle_
grid_ family - The grid family one bundle is built on: the family every one of its inputs is read from, so the bundle’s grid, tile, variants and poster are that family’s.
- convert_
bin - Convert a GRIB run (or one observation NetCDF file) into per-variable Xue bundles.
- deaccumulate_
precipitation - Mean precipitation rate (mm/h) over the step ending at the current frame, from run-total accumulations in mm. The first frame has no preceding interval, so its rate is zero; packing noise can make the accumulation dip slightly, so negative differences clamp to zero.
- deaverage_
precipitation - Mean rate (mm/h) over the step ending at
hour, from GFS window-cumulative average rates (kg/m^2 s, sfluxPRATE ave). - decimate_
codes - Reduced copy of one quantized plane: every
factor-th row and column of the full plane from row and column 0 (rows/columns 0, 2, 4, … for the half tier), matching the poster decimation so every tier shares the same sample sites — sampling the full plane by 4 or 8 is the same as halving it twice or three times.gridis the full plane’s grid. - dewindow_
precipitation - Mean rate (mm/h) over the step ending at
hour, from totals in mm accumulated since the start of a window that resets everywindow_hours(the NAM’sAPCP:0-5 hour acc,12-13 hour acc). - grid_
family_ of - The id of the grid family one input is read from, or
Nonefor an input on the source’s own grid (SourceSpec::grid_family_of). Mirrorsgrid_family_ofinxuebuild/discover.py. - store_
dimensions - The dimension names a bundle’s arrays carry in its run’s shared store
(
docs/zarr-profile.md, “Coordinates”), and so the coordinate arrays the bundle uses there. Mirrorsstore_dimensionsinxuebuild/discover.py. - validate_
build - Whether this encoder builds
options.modelfromregistrywith the profile and bundlesoptionsasks for, decided from the document alone: the source, the profile, a codebook for every published variable and the requested bundles. Nothing is read or written.convert_binruns it first, so a build and the question asked before it cannot disagree. - zstd_
version