wradlib.georef.raster.get_raster_coordinates

wradlib.georef.raster.get_raster_coordinates#

wradlib.georef.raster.get_raster_coordinates(ds, mode='center')[source]#

Generate a 2D array of raster coordinates and return it as a DataArray.

Parameters:
  • ds (xarray.Dataset) – A dataset containing 1D coordinates ‘x’ and ‘y’.

  • mode (str, optional) – Determines how coordinates are computed: - “center”: uses the center points of each grid cell (default). - “edge” : computes coordinates at the edges between cells.

Returns:

xarray.DataArray – A 3D DataArray of shape (y, x, 2), where the last dimension contains the spatial coordinates [x, y] for each grid cell.