Indexing (rojak.core.indexing)#
Utilities for indexing into and reshaping xarray/dask/pandas coordinate arrays
This module provides standalone helper functions for working with coordinates and indices, namely: building
direction-aware value slices (make_value_based_slice()), detecting regular grid spacing
(get_regular_grid_spacing()), mapping data values to their nearest coordinate index on regular and irregular
grids (nearest_index(), map_values_to_nearest_coordinate_index(),
map_values_to_nearest_index_irregular_grid()) and back
(map_index_to_coordinate_value()), reordering a list according to a target order (map_order()),
combining an array with shifted copies of itself along a dimension (shift_and_combine()), masking values with
NaN (apply_nan_mask()), and concatenating arrays along a new dimension (concat_new_dim()).
Functions
|
Replace values in |
|
Concatenate a sequence of arrays along a new dimension |
|
Determines if array has a regular grid spacing |
|
Make a slice from coordinate while accounting for whether values are increasing or decreasing. |
|
Retrieve original value based on index |
|
Maps order of |
Assuming the coordinate is a regular grid, compute the closest index that the values in the series correspond to. |
|
Compute the closest index in |
|
|
Compute the index of the value in |
|
Combine each element along |
Classes
|
Convention for breaking ties when a value is exactly halfway between two coordinate values |