jswhit / pygrib

Python interface for reading and writing GRIB data
https://jswhit.github.io/pygrib
MIT License
328 stars 97 forks source link

Undefined values problem #200

Open jimmyc42 opened 2 years ago

jimmyc42 commented 2 years ago

We are working on the EMC FV3 member that is in the High Res window slot. The grid is a cut out so there is missing/undefined values on the edges of the domain. the problem is that the missing value when read in via pygrib is 9999. The 250hpa geopotential has data that range 9700-10800 or so, which overlaps with the missing value, resulting in missing grid points not on the domain edge. we realized this and ran wgrib2 to change the missing value: wgrib2 hiresw.t00z.fv3_5km.f01.conus.grib2 -rpn "-999:swap:merge" -grib_out OUT.grib2

and this got us a clean geopotential height field. Is this a pygrib issue or grib2 issue or both?

Thanks jimmyc

jswhit commented 2 years ago

It's a grib2 issue - the missing value is encoded in the grib file