TemporalRangeIndex

class of dascore.xarray.index
inherits from: xarray.core.indexes.CoordinateTransformIndex, xarray.core.indexes.Index
source

TemporalRangeIndex(
    transform: TemporalRangeTransform ,
)

An xarray index over a TemporalRangeTransform.

Selection answers exactly as the materialized segments of the same tree answer: a scalar label must land on a sample — nearer than half a step past either end counts — or method="nearest" takes the nearest sample within the span; a slice keeps every sample within its (inclusive) endpoints; and a partial datetime string names its whole period, as pandas reads it. A contiguous or strided isel returns a new lazy index, so laziness survives selection chains; anything fancier falls back to a materialized pandas index over just the selected labels. Asking for the pandas form (.indexes, .to_pandas()) materializes the labels, as reading .values does, and concatenating abutting segments stays lazy.

Not yet supported: aligning with a differently indexed coordinate (xarray raises), and sel with tolerance, with a method other than nearest, or with method on a slice.

Methods

Name Description
concat Concatenate segment indexes, staying lazy when the grids chain.
isel A sliced view keeps a lazy index; fancy indexing materializes.
rename A renamed coordinate keeps its lazy index under the new name.
sel Resolve label selection arithmetically.
from_coord Build from an evenly sampled temporal dascore coordinate.
to_pandas_index The materialized pandas form, computed on demand.