You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Problem

You are trying to convert a GRIB edition 1 field to edition 2 via grib_set but it fails

Solution

Let's say you have a GRIB1 file with the paramId=201 which is "Maximum temperature at 2 metres since previous post-processing". You try to convert it to edition 2

% grib_ls -p paramId,shortName mx2t.grib1
paramId     shortName
201         mx2t

% grib_set -s edition=2 mx2t.grib1 mx2t.grib2
ECCODES ERROR: grib_set_values[4] typeOfStatisticalProcessing (type=long) failed: Key/value not found
ECCODES ERROR: grib_set_values[0] edition (type=long) failed: Key/value not found

This is because the definition of the parameter 201 contains the key "typeOfStatisticalProcessing". Check the GRIB2 representation of this parameter in the Parameter database.
This means that this parameter requires a Product Definition Template for interval-based products (not instantaneous). See here.

So we need to select the correct Product Definition Template:

% grib_set -s edition=2,productDefinitionTemplateNumber=8 mx2t.grib1 mx2t.grib2
% grib_ls -p paramId,shortName mx2t.grib2
paramId     shortName
201         mx2t




  • No labels