arte/types/domainxy.py
def _indices(self, xmin, xmax, ymin, ymax, boundary_check=True):
        '''Returns the outer indices that correspond to a bounding box'''

        # Indexes must be unitless
        assert_unit_is_equivalent(xmin, ref=self._xcoord)
        assert_unit_is_equivalent(xmax, ref=self._xcoord)
        assert_unit_is_equivalent(ymin, ref=self._ycoord)
        assert_unit_is_equivalent(ymax, ref=self._ycoord)

        xlo = np.argmin(np.abs(self._xcoord - xmin))
        xhi = np.argmin(np.abs(self._xcoord - xmax)) + 2
        ylo = np.argmin(np.abs(self._ycoord - ymin))
        yhi = np.argmin(np.abs(self._ycoord - ymax)) + 2

        if boundary_check:
            xlo = max(xlo, 0)
            ylo = max(ylo, 0)
            xhi = min(xhi, self._xcoord.size)
            yhi = min(yhi, self._ycoord.size)

        return xlo, xhi, ylo, yhi
Returns the outer indices that correspond to a bounding box
Returns the outer indices that correspond to a bounding box
Returns the outer indices that correspond to a bounding box
def _indices(self, xmin, xmax, ymin, ymax, boundary_check=True):
        assert_unit_is_equivalent(xmin, ref=self._xcoord)
        assert_unit_is_equivalent(xmax, ref=self._xcoord)
        assert_unit_is_equivalent(ymin, ref=self._ycoord)
        assert_unit_is_equivalent(ymax, ref=self._ycoord)
        xlo = np.argmin(np.abs(self._xcoord - xmin))
        xhi = np.argmin(np.abs(self._xcoord - xmax)) + 2
        ylo = np.argmin(np.abs(self._ycoord - ymin))
        yhi = np.argmin(np.abs(self._ycoord - ymax)) + 2
        if boundary_check:
            xlo = max(xlo, 0)
            ylo = max(ylo, 0)
            xhi = min(xhi, self._xcoord.size)
            yhi = min(yhi, self._ycoord.size)
        return xlo, xhi, ylo, yhi
def _indices ( self , xmin , xmax , ymin , ymax , boundary_check = True ) : assert_unit_is_equivalent ( xmin , ref = self . _xcoord ) assert_unit_is_equivalent ( xmax , ref = self . _xcoord ) assert_unit_is_equivalent ( ymin , ref = self . _ycoord ) assert_unit_is_equivalent ( ymax , ref = self . _ycoord ) xlo = np . argmin ( np . abs ( self . _xcoord - xmin ) ) xhi = np . argmin ( np . abs ( self . _xcoord - xmax ) ) + 2 ylo = np . argmin ( np . abs ( self . _ycoord - ymin ) ) yhi = np . argmin ( np . abs ( self . _ycoord - ymax ) ) + 2 if boundary_check : xlo = max ( xlo , 0 ) ylo = max ( ylo , 0 ) xhi = min ( xhi , self . _xcoord . size ) yhi = min ( yhi , self . _ycoord . size ) return xlo , xhi , ylo , yhi
Returns the outer indices that correspond to a bounding box
Returns the outer indices that correspond to a bounding box
'''Returns the outer indices that correspond to a bounding box''' # Indexes must be unitless
self
xmin
xmax
ymin
ymax
boundary_check