resqpy.olio.box_utilities.trim_box_by_box_returning_new_mask

resqpy.olio.box_utilities.trim_box_by_box_returning_new_mask(box_to_be_trimmed, trim_box, mask_kji0)[source]

Reduces box_to_be_trimmed by trim_box; trim_box must be a neat subset box at one face of box_to_be_trimmed.

input/output argument (modified):
box_to_be_trimmed: numpy int array of shape (2, 3)

lower & upper indices in 3 dimensions defining a logical cuboid subset of a 3D cartesian grid indices protocol is python kji ordering with zero base modified to exclude space occupied by trim_box

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

lower & upper indices in 3 dimensions defining a logical cuboid subset of a 3D cartesian grid indices protocol is python kji ordering with zero base the volume to be removed from box_to_be_trimmed, must be a subset of box_to_be_trimmed completely covering one face of box_to_be_trimmed (thereby ensuring that after trimming, a valid cuboid box results)

mask_kji0: numpy 3D boolean array of shape matching extent of input box_to_be_trimmed

indices protocol is python kji ordering with zero base

returns: numpy 3D boolean array of shape matching extent of output box_to_be_trimmed

the return array is a version of mask_kji0 that has been trimmed in accordance with the box trimming