earthobservations / wetterdienst

Open weather data for humans.
https://wetterdienst.readthedocs.io/
MIT License
349 stars 54 forks source link

Follow up on improvements to wradlib v1.9.0 #251

Closed amotl closed 3 years ago

amotl commented 3 years ago

Hi there,

@kmuehlbauer mentioned at https://github.com/earthobservations/wetterdienst/issues/241#issuecomment-733736186:

FYI, @amotl, @gutzbenj wradlib v1.9.0 is released on PyPI ( and should be available later also on conda-forge). The use of tempfile can be removed. The wradlib reader functions are now able to consume file-like objects.

Thanks!

While being at it, we should also take care about adjusting the radar examples as mentioned within https://github.com/earthobservations/wetterdienst/issues/227#issuecomment-729882648 in order to compensate for the updates coming from #216.

With kind regards, Andreas.

P.S.: Just running brew upgrade gdal on my workstation...

amotl commented 3 years ago

Dear @kmuehlbauer,

thanks for the bump. I am seeing success with wrl.io.read_dx() as well as wrl.io.read_opera_hdf5() - thanks a bunch!

However, I am also just looking at

https://github.com/earthobservations/wetterdienst/blob/e8dc546aa586fd28424975057a57aa7b68b4fbb3/example/radar/radar_scan_precip.py#L100-L113

vs.

https://github.com/wradlib/wradlib/blob/1.9.0/wradlib/io/xarray.py#L2492-L2506.

Does wradlib.io.xarray.open_odim really support loading from a list of file-like objects already? When preparing them like

files = list(map(lambda item: item.data, results))

wradlib croaks like

  File "/Users/amo/Library/Caches/pypoetry/virtualenvs/wetterdienst-EkOFQaO8-py3.8/lib/python3.8/site-packages/wradlib/io/xarray.py", line 2536, in open_odim
    angles._ncfile = angles[0].ncfile
  File "/Users/amo/Library/Caches/pypoetry/virtualenvs/wetterdienst-EkOFQaO8-py3.8/lib/python3.8/site-packages/wradlib/io/xarray.py", line 1198, in __getitem__
    return self._seq[index]
IndexError: list index out of range

With kind regards, Andreas.

kmuehlbauer commented 3 years ago

@amotl Please have a look here: https://docs.wradlib.org/en/stable/notebooks/fileio/wradlib_load_DWD_opendata_volumes.html

kmuehlbauer commented 3 years ago

And, dear @amotl, thanks for spotting the missing docstring parts, those went under the radar...

amotl commented 3 years ago

Thanks. Obviously, it works as promised when trying harder, I have been writing too quickly. The error was coming from the fact that I've read the buffer twice by not removing the tempfile part beforehand. #252 has all in place now.

amotl commented 3 years ago

Please have a look at the tutorial Load ODIM_H5 Volume data from German Weather Service.

Thanks for using wetterdienst within this tutorial. It looks nice and solid. We are happy to have been able to fill some niche there.

cc @DeutscherWetterdienst