I am trying to convert RADKLIM binary data from Index of /climate_environment/CDC/grids_germany/5_minutes/radolan/reproc/2017_002/bin/ to a Geotif with EPSG 25832. Here is the relevant snippet from my script:
import os, warnings
import wradlib as wrl
from osgeo import osr, gdal
import numpy as np
warnings.filterwarnings('ignore')
# os.environ["WRADLIB_DATA"] = "C:/Temp/"
proj_stereo = wrl.georef.create_osr("dwd-radolan") # osr spatial reference
proj_utm = osr.SpatialReference()
proj_utm.ImportFromEPSG(25832) # osr spatial reference
binfile = 'raa01-yw2017.002_10000-2301012310-dwd---bin'
outf = 'test.tif'
xy_stereo = wrl.georef.get_radolan_grid(1100,900)
data_raw, attrs = wrl.io.read_radolan_composite(binfile, missing=0.0)
data, xy_stereo = wrl.georef.set_raster_origin(data_raw, xy_stereo, 'upper')
ds = wrl.georef.create_raster_dataset(data, xy_stereo, crs=proj_stereo)
ds_out = wrl.georef.reproject_raster_dataset(
ds, spacing=1000, resample=0, projection_target=proj_utm)
wrl.io.write_raster_dataset(outf, ds_out, 'GTiff')
os.remove(binfile)
I am getting this error:
File c:\utils\radklim_tmp\03_convert_radklim_tiff_test.py:31
ds_out = wrl.georef.reproject_raster_dataset(
File C:\utils\miniconda\Lib\site-packages\wradlib\georef\raster.py:556 in reproject_raster_dataset
dst_ds = mem_drv.Create("", cols, rows, 1, gdal.GDT_Float32)
File C:\utils\miniconda\Lib\site-packages\osgeo\gdal.py:3742 in Create
return _gdal.Driver_Create(self, *args, **kwargs)
RuntimeError: Attempt to create 0x1 dataset is illegal,sizes must be larger than zero.
Any ideas where my code is lacking?