resqpy.olio.box_utilities.valid_box

resqpy.olio.box_utilities.valid_box(box, host_extent)[source]

Returns True if the entire box is within a grid of size host_extent.

input arguments (unmodified):
box: numpy int array of shape (2, 3)

lower & upper indices in 3 dimensions defining a logical cuboid subset of a 3D cartesian grid in python protocol of zero base, kji (normally) or ijk ordering same as for host_extent

host_extent: triple int

the extent (shape) of a 3D cartesian grid

returns: boolean

True if box is a valid box within a grid of shape host_extent, False otherwise