xdas.coordinates#

Coordinates#

Coordinates([coords, dims])

Dictionary like container for coordinates.

Methods

Coordinates.isdim(name)

Return True if name is a dimensional coordinate (i.e. its dim equals its name).

Coordinates.to_index(item[, method, endpoint])

Convert an item selector to a dict of per-dimension integer indices.

Coordinates.equals(other)

Return True if other is a Coordinates with identical coordinate values.

Coordinates.copy([deep])

Return a copy of this Coordinates container.

Coordinates.drop_dims(*dims)

Return a new Coordinates with dims and their associated coordinates removed.

Coordinates.drop_coords(*names)

Return a new Coordinates with the named coordinates removed.

Coordinate#

Coordinate([data, dim, dtype])

Base class and factory for all coordinate types.

Attributes

Coordinate.dtype

NumPy dtype of the underlying coordinate values.

Coordinate.ndim

Number of dimensions (always 1 for dimensional coordinates).

Coordinate.shape

Shape tuple (len(self),).

Coordinate.size

Number of elements along this coordinate's axis.

Coordinate.empty

True if the coordinate has zero length.

Coordinate.dim

Name of the dimension this coordinate is associated with, or None.

Coordinate.indices

Integer array [0, 1, ..., len(self) - 1].

Coordinate.values

Materialised numpy array of coordinate values.

Coordinate.start

Value at index 0 (first element).

Coordinate.end

Value at the last element.

Coordinate.name

The name under which this coordinate is stored in its parent container.

Methods

Coordinate.isscalar()

Return True if this is a ScalarCoordinate.

Coordinate.isdim()

Return True if this coordinate is a dimensional coordinate.

Coordinate.equals(other)

Return True if other is the same coordinate type with identical dim and data.

Coordinate.to_index(item[, method, endpoint])

Convert a label-based selector to an integer index or slice.

Coordinate.copy([deep])

Return a copy of this coordinate.

Coordinate.to_dataarray()

Convert this coordinate to a DataArray with a single dimension.

ScalarCoordinate#

ScalarCoordinate([data, dim, dtype])

Non-dimensional coordinate that carries a single scalar value.

DenseCoordinate#

DenseCoordinate([data, dim, dtype])

Coordinate backed by an explicit numpy array.

Attributes

DenseCoordinate.index

A pandas.Index view of the underlying data array.

Methods

DenseCoordinate.from_block(start, size, step)

Construct a coordinate from a start value, element count, and step size.

DenseCoordinate.get_sampling_interval([cast])

Return the average sample spacing (end-to-end distance divided by N-1).

DenseCoordinate.get_div_points([tolerance])

Return sorted split-point indices where consecutive differences exceed tolerance.

InterpCoordinate#

InterpCoordinate([data, dim, dtype])

Piecewise-linear coordinate described by tie points (CF convention).

Attributes

InterpCoordinate.tie_indices

Integer array of tie-point positions (starts at 0, strictly increasing).

InterpCoordinate.tie_values

Array of tie-point values (numeric or datetime64, strictly increasing).

Methods

InterpCoordinate.from_block(start, size, step)

Construct a coordinate from a start value, element count, and step size.

InterpCoordinate.get_sampling_interval([cast])

Return the nominal sample spacing for this coordinate.

InterpCoordinate.get_split_indices([kind, ...])

Return integer indices where this coordinate should be split.

InterpCoordinate.get_discontinuities([tolerance])

Return a DataFrame containing information about the discontinuities.

InterpCoordinate.get_availabilities()

Return a DataFrame containing information about the data availability.

InterpCoordinate.simplify([tolerance])

Return a simplified copy of this coordinate with redundant tie points removed.

SampledCoordinate#

SampledCoordinate([data, dim, dtype])

Coordinate sampled at a fixed interval, with optional gaps between segments.

Attributes

SampledCoordinate.tie_values

Start values of each regularly-sampled segment.

SampledCoordinate.tie_lengths

Number of samples in each regularly-sampled segment.

SampledCoordinate.tie_indices

Start integer index of each segment within the full coordinate array.

SampledCoordinate.sampling_interval

Fixed step between consecutive samples (shared across all segments).

Methods

SampledCoordinate.from_block(start, size, step)

Construct a coordinate from a start value, element count, and step size.

SampledCoordinate.get_sampling_interval([cast])

Return the nominal sample spacing for this coordinate.

SampledCoordinate.get_split_indices([kind, ...])

Return integer indices where this coordinate should be split.

SampledCoordinate.get_discontinuities([...])

Return a DataFrame containing information about the discontinuities.

SampledCoordinate.get_availabilities()

Return a DataFrame containing information about the data availability.

SampledCoordinate.simplify([tolerance])

Return a simplified copy of this coordinate with redundant tie points removed.