hydromt.DataArray.raster.idx_to_xy#

DataArray.raster.idx_to_xy(idx, mask=None, mask_outside=False, nodata=nan)#

Return x,y coordinates at linear index.

Parameters:
  • idx (ndarray of int) – linear index

  • 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 np.nan

Returns:

x, y coordinates

Return type:

Tuple of ndarray of float