boundingbox_to_indices

jwst.msaflagopen.msaflag_open.boundingbox_to_indices(data_shape, bounding_box)[source]

Translate a bounding box to image indices.

Takes a bounding_box (tuple of tuples: ((x1, x2), (y1, y2))) and a datamodel and calculates the range of indices in the X and Y dimensions of the overlap between the bounding box and the datamodel’s data array.

Parameters:
data_shapetuple

The data shape for the input science datamodel.

bounding_boxtuple of tuple

Bounding box returned from WCS object.

Returns:
xmin, xmax, ymin, ymaxint

Range of indices of overlap between science data array and bounding box.