wradlib.georef.raster.create_raster_xarray

wradlib.georef.raster.create_raster_xarray#

wradlib.georef.raster.create_raster_xarray(crs, bounds, resolution, snap_bounds=False, snap_resolution=False)[source]#

Create empty raster as xarray dataset following CF conventions

Parameters:
  • crs – Coordinate Reference System (CRS) mapping geographic to x,y coordinates. Must be provided and can be one of:

  • bounds (tuple of int) – Bounding box as (min_x, min_y, max_x, max_y), as integer.

  • resolution (int or tuple of int) – Grid resolution in x and y directions. If a single int is provided, it applies to both axes.

  • snap_bounds (bool, optional) – If True, adjusts bounds to align with resolution grid.

  • snap_resolution (bool, optional) – If True, adjusts resolution to evenly divide the extent.

Returns:

xarray.Dataset – An xarray Dataset with ‘x’ and ‘y’ pixel center coordinates, ‘spatial_ref’ coordinate with crs_wkt and GeoTransform attributes