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:
A
pyproj.crs.CoordinateSysteminstanceA
cartopy.crs.CRSinstanceA
osgeo.osr.SpatialReferenceinstanceA type accepted by
pyproj.crs.CRS.from_user_input(e.g., EPSG code, PROJ string, dictionary, WKT, or any object with a to_wkt() method)
bounds (
tupleofint) – Bounding box as (min_x, min_y, max_x, max_y), as integer.resolution (
intortupleofint) – 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