I just figured out that my rays are plotted on a different altitude than I’d expect. I am not sure if I did something wrong or if this is a bug in the cross_section_ppi function. Here is what I have:
fname = "/file/to/h5path"
sweeps = []
for sn in np.arange(5):
# load all sweeps and merge them
swp = xr.open_dataset(fname, engine="odim", group="sweep_"+str(sn))
sweeps.append(swp)
# round the azimuths to avoid slight differences in the different sweep rounds
sweeps[sn].coords["azimuth"] = sweeps[sn].coords["azimuth"].round(0)
nodata_mask = swp.DBZH.values == -327.68
swp.DBZH.values[nodata_mask] = np.nan
vol = xr.concat(sweeps, dim="sweep_fixed_angle")
vol = vol.set_coords(("sweep_mode", "sweep_number", "prt_mode", "follow_mode"))
vol["elevation"] = vol["elevation"].median("azimuth")
vol["time"] = vol["time"].min("azimuth")
azimuth = 84
rec_rhi = wradlib.util.cross_section_ppi(vol, azimuth)
rec_rhi.DBZH.plot(cmap='viridis', x="gr", y="z", ylim=(0,8000))
And if i zoom-in, the rays of the radar start in an altitude higher than given in the coordinate “altitude” in vol .
@lou How much is the height difference? If it is in the meter-range it could be related to the bin range. The height is sampled at bin center, not at bin start.
@kmuehlbauer It seems like that it gets doubled. In my meta-data, altitude was at 150m, but the rays started at 300m. If I change altitude to a different value, the radar rays start always at an altitude of 2*alt.
Hi @kmuehlbauer , how can this be fixed so the default behavior is the expected one? Should I just delete the crs keyword from the call to georeference?