Hello Tim,
you are missing just one step to resample the curved grid data onto
cartesian grid. See below:
import os
import wradlib as wrl
from osgeo import osr
import numpy as np
# radolan ry grid
xy_stereo = wrl.georef.get_radolan_grid(900,900)
# radolan projection
proj_stereo = wrl.georef.create_osr("dwd-radolan")
# utm projection
proj_utm = osr.SpatialReference()
proj_utm.ImportFromEPSG(25832)
# open and read binary file
binfile = 'raa01-ry_10000-2203232330-dwd---bin'
data_raw, attrs = wrl.io.read_radolan_composite(binfile, missing=np.nan)
# process raster origin, move to origin upper, as tif is using it
data, xy_stereo = wrl.georef.set_raster_origin(data_raw, xy_stereo, 'upper')
#create raster dataset in original cartesian coordinates
ds = wrl.georef.create_raster_dataset(data, xy_stereo,
projection=proj_stereo)
# resample/reproject to UTM
ds_out = wrl.georef.reproject_raster_dataset(ds, spacing=1000,
resample=0, projection_target=proj_utm)
# write outfile
outf = 'result_wradlib.tif'
wrl.io.write_raster_dataset(outf, ds_out, 'GTiff')
There are still some differences between the wradlib approach and the
radolan2map-approach. Although both are using GDAL under the hood, the
outputs still differ a bit. It might be due to both using different
approaches (wradlib - gdal.ReprojectImage, radolan2map - gdal.Warp) but
it could also be due to using different parameterizations. Good chance
that there might be slight differences in other parts of the machinery.
If someone finds an inaccurracy within wradlib, please report here or
open an issue on github.
Best,
Kai
Am 28.03.22 um 12:26 schrieb Tim Schneider:
> --
> You received this message because you are subscribed to the Google
> Groups "wradlib-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
wradlib-user...@googlegroups.com
> <mailto:
wradlib-user...@googlegroups.com>.
> To view this discussion on the web, visit
>
https://groups.google.com/d/msgid/wradlib-users/2e7fe1cf-f156-4cb2-b207-7427b50c04fdn%40googlegroups.com
> <
https://groups.google.com/d/msgid/wradlib-users/2e7fe1cf-f156-4cb2-b207-7427b50c04fdn%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
Kai Muehlbauer
Institute of Geosciences, Meteorology Section, University of Bonn
Auf dem Huegel 20 |
+49 228 739083
D-53121 Bonn |
kai.mue...@uni-bonn.de