diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2023-08-13 21:02:42 +0200 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2023-08-13 21:02:42 +0200 |
commit | ae709fdf1eb0df384835509a6c9500b69301d14c (patch) | |
tree | baa7eadaf40911298978c5fdbb3a73d3f7c59a47 /grib.py | |
parent | 417df67b59017cd8272926be628898874348b8da (diff) | |
download | meteo_toolbox-ae709fdf1eb0df384835509a6c9500b69301d14c.tar.gz |
asdf
Diffstat (limited to 'grib.py')
-rwxr-xr-x | grib.py | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -0,0 +1,37 @@ +#!/usr/bin/env python3 +import pygrib + +# http://opendata.dwd.de/weather/nwp/icon-d2/grib/00/t/icon-d2_germany_regular-lat-lon_pressure-level_2023080200_000_1000_t.grib2.bz2 + +# <BASE>/<RUN>/<PARAMETER>/icon-d2_regular-lat-lon_pressure-level_<INIT>_<OFFSET>_<LEVEL>_<PARAMETER> + +GRIBDIR='dwd_icon-d2' + +# Flugplatz Saal a. d. Saale +target_lat='50.3108796' +target_lon='10.0646952' + +# Find nearest coords in model +# TODO + +grib = pygrib.open('dwd_icon-d2/combined.grib2') + + +for grb in grib: + print(grb) + vals = grb.values + + lats, lons = grb.latlons() + + print(grb.name) + #print(grb.level) + + #print('lats min/max: ', lats.shape, lats.max(), lats.min()) + #print('lons min/max: ', lons.shape, lons.max(), lons.min()) + + #print(vals.shape) + + #print(vals[100][::100]) + + #print(grb.latlons()) + |