hydromt.gis.DataArray.raster.xy_to_idx#
- gis.DataArray.raster.xy_to_idx(xs, ys, mask=None, mask_outside=False, nodata=-1)#
Return linear index of x, y coordinates.
- Parameters:
xs (
ndarray
offloat
) – x coordinatesys (
ndarray
offloat
) – y coordinatesmask (
ndarray
ofbool
, optional) – data mask of valid values, by default Nonemask_outside (
boolean
, optional) – mask xy points outside domain (i.e. set nodata), by default Falsenodata (
int
, optional) – nodata value, used for output array, by default -1
- Returns:
linear indices
- Return type:
ndarray
ofint