In this version of ecCodes some limited encoding features of the data section are available. An example showing how to encode data from a text file is provided here.
The only function needed to encode BUFR data is codes_set which is provided in all the available languages and in the bufr_filter.
It is very simple as an example to decode a BUFR message, change something and re-encode it. The following file of bufr_filter instruction can be used to decode a synop message, change the airTemperature and encode it again:
# unpack data section set unpack=1; # print value of airTemperature print "airTemperature=[airTemperature]"; # set new value for airTemperature set airTemperature=299.5; # print new value of airTemperature print "airTemperature=[airTemperature]"; # pack data section set pack=1; # write BUFR message on output file write; |
The filter instructions can be run on a synop message as:
bufr_filter -o out.bufr filter_instructions_file in.bufr
where in.bufr is an input synop message and out.bufr is the output message.
There are two main limitations in the encoding features provided in this version.
We are aware that this are strong limitations and we are working to implement these features as soon as possible in the next 0.13.0 release.