Skip to main content

Module column

Module column 

Source
Expand description

Reading the Zarr profile’s column store.

docs/zarr-profile.md, “Column store”, is normative. A column store holds the codes of a run’s published stores cut the other way: one array per quantity, [time, level, latitude, longitude] (a surface array has no level axis), whose inner chunk is the whole axis and every level of one small block of cells. One cell’s column over the run is then one chunk per quantity. An array is uint8, the map stores’ codes, except a surface array cut from a series store that widens its variable, which is uint16: decode_cells_u16 reads either, decode_cells the bytes alone.

Like crate::zarr, this module is IO-free: it takes the group document, the shard indices and the chunks’ bytes, and returns codes and values. The group’s consolidated metadata holds every array document and is authoritative, so the group is the only document read. The metadata rules, the codec chain, the shard index and the chunk payload are the grid store’s own; only the block, the dimensions and the cut are this branch’s.

Structs§

ColumnArray
One array of the store, its document held to the block.
ColumnGroup
A column store’s group document: the xue_columns block and every array document it consolidates, validated against one another.
ColumnLayout
How an array is cut: an inner chunk of the whole axis and every level of one block of cells, a shard of whole blocks across the grid’s width.
ColumnMember
One level of a levelled array, or a surface array’s one field: the bundle its codes come from and that bundle’s variable.
ColumnReader
A column store being read: the group and the shard indices handed over so far. The caller owns the requests and the chunks’ bytes.

Constants§

COLUMN_BLOCK_CELLS
The cells along each side of a writer’s block. A reader takes the block from the array document and never assumes this one.
COLUMN_SHARD_ROWS
The rows of a writer’s shard, whole blocks; a reader takes it likewise.
COLUMN_VERSION
The xue_columns block’s version this reader implements.

Functions§

chunk_range
Where the block a cell lies in sits within its shard, or None for a block the shard never held, which reads as the fill value. index is that of the cell’s shard (ColumnLayout::shard_of).
decode_cells
The codes of some cells, (row, column), of one block of a uint8 array: cells × frames × levels, cell by cell in the order given, each frame by frame. payload is the block’s chunk, None for one the shard never held. A uint16 array is refused: its codes are decode_cells_u16’s.
decode_cells_u16
decode_cells of an array of either type: a uint8 array’s codes widened, a uint16 one’s (little-endian, the delta modulo 65536) as they are.
decode_column
One cell’s codes, frames × levels, frame by frame: decode_cells of that cell alone.
decode_column_u16
decode_column of an array of either type, the codes widened: what a cell’s series is read with.
parse_column_index
Parse one shard’s index, CRC-32C verified, no chunk lying inside an index at the shard’s start. bytes is exactly the index.