odc.geo.roi.roi_normalise

odc.geo.roi.roi_normalise(roi: Union[slice, int, odc.geo.types.NormalizedSlice], shape: Union[int, Tuple[int]]) odc.geo.types.NormalizedSlice[source]
odc.geo.roi.roi_normalise(roi: Tuple[Union[slice, int, odc.geo.types.NormalizedSlice], ...], shape: Tuple[int, ...]) Tuple[odc.geo.types.NormalizedSlice, ...]

Normalise ROI.

Fill in missing .start/.stop, also deal with negative values, which are treated as offsets from the end.

.step parameter is left unchanged.

Example

np.s_[:3, 4:  ], (10, 20) => np.s_[0:3, 4:20]
np.s_[:3,  :-3], (10, 20) => np.s_[0:3, 0:17]
Return type

Union[NormalizedSlice, Tuple[NormalizedSlice, …]]