How to change the bits per value in a GRIB message?
Step-by-step guide
This can be done by using the grib_set command.
...
Code Block |
---|
% grib_set -s setBitsPerValue=17 in.grib out.grib |
or use the "repack" (-r) option with the "bitsPerValue" key:
Code Block |
---|
% grib_set -r -s bitsPerValue=17 in.grib out.grib |
In these commands, we first decode the data values, then change the bitsPerValue key and then repack (i.e., encode those values back in).
It is advisable to check the field values after such a change, for example by printing and comparing the statistics before and after:
Code Block |
---|
% grib_ls -n statistics in.grib
% grib_ls -n statistics out.grib |
Of course you can also use grib_compare.
Related articles
Content by Label | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...