hydromt.DataArray.raster.nearest_index#

DataArray.raster.nearest_index(dst_crs=None, dst_res=None, dst_transform=None, dst_width=None, dst_height=None, align=False)#

Prepare nearest index mapping for the reprojection of a gridded timeseries file, powered by pyproj and k-d tree lookup.

Index mappings typically are used in reprojection workflows of time series, or combinations of time series

… Note: Is used by reproject() if method equals ‘nearest_index’

Parameters:
  • dst_crs (int, dict, or str, optional) – Target CRS. Accepts EPSG codes (int or str); proj (str or dict) or wkt (str) “utm” is accepted and will return the centroid utm zone CRS

  • dst_res (tuple (x resolution, y resolution) or float, optional) – Target resolution, in units of target CRS.

  • dst_transform (affine.Affine(), optional) – Target affine transformation. Will be calculated if None.

  • dst_width (int, optional) – Output file size in pixels and lines. Cannot be used together with resolution (dst_res).

  • dst_height (int, optional) – Output file size in pixels and lines. Cannot be used together with resolution (dst_res).

  • align (boolean, optional) – If True, align target transform to resolution

Returns:

index – DataArray with flat indices of source DataArray

Return type:

xarray.DataArray of intp