index

module of dascore.xarray source

A lazy xarray index over a DASCore coordinate.

xarray materializes every dimension coordinate into a numpy array and a pandas index, which for a long merged time coordinate costs 8 bytes a sample before any data loads — a year of millisecond sampling is a quarter terabyte of labels. CoordIndex holds the DASCore coordinate itself instead: an evenly sampled range (an exact integer grid for nanosecond time and integers, a scalar step for floats) or a segmented coordinate, whose segments may be ranges or monotonic arrays. Labels are the coordinate’s own, computed for the positions asked about; selection follows the rules Patch.sel follows, which are pandas’; and a slice or an abutting concatenation of an integer grid is again a coordinate, so laziness survives selection chains.

Everything here is imported only behind the optional xarray dependency.

Functions

Name Description
is_servable Whether CoordIndex can serve a coordinate’s labels.

Classes

Name Description
CoordIndex An xarray index serving a DASCore coordinate’s labels.
CoordTransform Positions to the labels of a DASCore coordinate, and back.