hydromt.gis.DataArray.raster.rowcol#

gis.DataArray.raster.rowcol(xs, ys, mask=None, mask_outside=False, nodata=-1) tuple[ndarray[int], ndarray[int]]#

Return row, col indices of x, y coordinates.

Parameters:
  • xs (ndarray of float) – x coordinates

  • ys (ndarray of float) – y coordinates

  • mask (ndarray of bool, optional) – data mask of valid values, by default None

  • mask_outside (boolean, optional) – mask xy points outside domain (i.e. set nodata), by default False

  • nodata (int, optional) – nodata value, used for output array, by default -1

Returns:

linear indices

Return type:

ndarray of int