coords.Coords.bounding_boxes#

Coords.bounding_boxes()#

Return the bounding boxes of all subsets of points in the Coords.

Subsets of points are 2-dim subarrays of the Coords, taken along the two last axes. If the Coords has ndim==2, there is only one subset: the full Coords.

Returns#

float array

Array with shape (…,2,3). The elements along the penultimate axis are the minimal and maximal values of the Coords along that axis.

Examples#

>>> X = Coords(np.arange(18).reshape(2,3,3))
>>> print(X)
 [[[ 0.   1.   2.]
   [ 3.   4.   5.]
   [ 6.   7.   8.]]

  [[ 9.  10.  11.]
   [12.  13.  14.]
   [15.  16.  17.]]]
>>> print(X.bounding_boxes())
[[[ 0.   1.   2.]
  [ 6.   7.   8.]]

 [[ 9.  10.  11.]
  [15.  16.  17.]]]