Skip to main content

Module temporal

Module temporal 

Source
Available on crate feature encoder only.
Expand description

Xue temporal grouping, tiling and residual coding — the port of xuebuild/temporal.py.

Residuals are 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.

Grouping is shared by both container versions: a group is a run of consecutive frames formed inside a segment of constant step. What differs is what a group is physically — v1 stores one plane per frame with a middle anchor, v2 packs the group into each tile’s chunk with the residuals chained against the previous frame.

Constants§

GROUP_LENGTH

Functions§

build_chunks
The v2 index tables and uncompressed chunks of one bundle.
encode_chunk
The stored bytes of one chunk, in place.
encode_residual
group_forecast_hours
Temporal groups, formed inside segments of constant step so no group straddles a change of cadence (an ANCHOR residual is then always a difference between frames one step apart).
split_segments
Maximal runs of constant step (docs/format.md “segment”): a boundary falls between two frames exactly where the step changes, so a uniform axis is one segment and the GFS 240-hour axis is two.
tile_stack
One tile’s block of a group’s planes, frame-major and clipped.