To convert a GRIB message from edition 1 to edition 2 it is enough to set the key edition=2 (see grib_set).
The aim of the conversion facilities provided in ecCodes is to be flexible enough to define conversion rules also for local tables and local extensions and to allow the user to configure locally the library to interpret fields coded in a local flavour of the GRIB specifications. It is widespread, for example, the use of local parameter tables. This local extensions or local tables are not coherent and sometimes are not properly organised. We refer in particular to the type of level which is numerically different in the two editions.Īnother element to be considered in a conversion algorithm is that many meteorological operational centres have been developing local patches to the GRIB specification to overcome the limitations of GRIB1.
#Grib1 to grib2 converter online code#
Moreover some of the numeric code tables semantically identical are numerically different, which again doesn't allow an easy mapping between them, because the numeric codes for the same information element are different. Therefore it doesn't allow an easy mapping of the meaning across the two versions. First of all the new designed GRIB2 is in some points semantically different from GRIB1. The conversion algorithm should be easy to implement, but there are some factors making it challenging. Since the new GRIB2 format is going to replace GRIB1 we will focus more on the GRIB1 to GRIB2 conversion rather than the opposite, which sometimes is not possible. Conversely the conversion from GRIB2 to GRIB1 is not always lossless because the edition 2 format has been extended to allow a wider set of scientific fields to be coded. The conversion from GRIB edition 1 (GRIB1) to edition 2 (GRIB2) is a format translation without any loss of information. Although the information content of two messages in different editions is almost the same, their binary format is very different and organised in a different way. GRIB messages are at the moment exchanged in edition 1 or 2.