snap

method of dascore.core.coordmanager.CoordManager source

snap(
    self ,
    *coords ,
    array: ndarray | None = None,
    reverse: bool = False,
    step = None,
    max_shift = None,
)-> ‘tuple[Self, MaybeArray]’

Force the specified coordinates to be monotonic and evenly sampled.

Coordinates are first sorted, then snapped.

Parameters

Parameter Description
*coords Specify which dimensions to sort. If None, sort along dimensional
coordinates.
array The array to sort/snap.
reverse If true, sort in descending order, else ascending.
step Place the labels on this step’s grid instead of spreading them.
max_shift Raise where a label would move further than this many steps.