resqpy.grid_surface.packed_bisector_from_face_indices

resqpy.grid_surface.packed_bisector_from_face_indices(grid_extent_kji: Tuple[int, int, int], k_faces_kji0: Optional[ndarray], j_faces_kji0: Optional[ndarray], i_faces_kji0: Optional[ndarray], raw_bisector: bool) Tuple[ndarray, bool]

Creates a uint8 (packed bool) array denoting the bisection of the grid by the face sets.

Parameters
  • grid_extent_kji (-) – the shape of the grid

  • k_faces_kji0 (-) – an int array of indices of which faces represent the surface in the k dimension

  • j_faces_kji0 (-) – an int array of indices of which faces represent the surface in the j dimension

  • i_faces_kji0 (-) – an int array of indices of which faces represent the surface in the i dimension

  • raw_bisector (-) – if True, the bisector is returned without determining which side is shallower

Returns

Tuple containing

  • array (np.uint8 array): packed boolean bisector array where values are 1 for cells on the side of the surface that has a lower mean k index on average and 0 for cells on the other side

  • is_curtain (bool): True if the surface is a curtain (vertical), otherwise False

Notes

  • the face sets must form a single ‘sealed’ cut of the grid (eg. not waving in and out of the grid)

  • any ‘boxed in’ parts of the grid (completely enclosed by bisecting faces) will be consistently assigned to either the True or False part

  • the returned array is packed in the I axis; use np.unpackbits() to unpack