jswhit / pygrib

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

Modify some data of one grib2 file? #65

Open lovechang1986 opened 7 years ago

lovechang1986 commented 7 years ago

I just want to modify some data of one grib2 file and then write modified data and the others to a new grib2 file. Is there any way to achieve this goal?

jswhit commented 7 years ago

You can modify the data in the grib file, get the binary string associated with the file and write it to a new file. Example at https://jswhit.github.io/pygrib/docs/index.html

lovechang1986 commented 7 years ago

@jswhit thanks, but while midify the values and assign them to grb. Error occurred: gribapi error range of values too large, try a smaller value for decimal precision(less than one). How to solve this error?

jswhit commented 7 years ago

don't know - sounds as if the values you are trying to assign to the data are inconsistent with the specified precision and/or range.