odc.geo.roi.roi_intersect

odc.geo.roi.roi_intersect(a: Union[slice, int, NormalizedSlice], b: Union[slice, int, NormalizedSlice]) NormalizedSlice[source]
odc.geo.roi.roi_intersect(a: Tuple[Union[slice, int, NormalizedSlice], ...], b: Tuple[Union[slice, int, NormalizedSlice], ...]) Tuple[NormalizedSlice, ...]

Compute intersection of two ROIs.

Examples

s_[1:30], s_[20:40] => s_[20:30]
s_[1:10], s_[20:40] => s_[10:10]

# works for N dimensions
s_[1:10, 11:21], s_[8:12, 10:30] => s_[8:10, 11:21]
Return type

Union[NormalizedSlice, Tuple[NormalizedSlice, ...]]