You set the paramId or shortName on a given GRIB file but the command fails
You have a GRIB input file (let's assume it has just one message) and you set the paramId or shortName but it fails. Some examples:
Let's look at each failure one by one:
If we check the Parameter Database, we see "clct" is defined for centre=cnmc (Italy) and no other centre. So that shortName is not available for GRIB messages with other originating centres. To fix this, we need to change the centre before setting that shortName as follows:
Here we see 3125 is defined for GRIB1 but not for GRIB2 therefore this would fail for an input file which is GRIB2. One solution is to use an alternative parameter which has the same meaning but is defined for GRIB2 e.g., 260063 is also "Momentum flux, v component" with the same units.
Parameter 47 fails with a different error message. This time it is because the input GRIB has the wrong template (See the FAQ on Product Definition Templates, PDT). Parameter 47 models an accumulation so the input should have a template for accumulated (interval-based) fields rather than instantaneous ones. To fix this we can either select the correct PDT or use the "stepType" key:
Note that there are several such templates (all of which have the key typeOfStatisticalProcessing). For example for chemical or aerosol products it will be a different number (See here for the full list).
The other way of solving this is via setting the stepType key which under the hood selects the PDT:
Generally it is recommended you use the first solution so you are fully in control of which PDT is set.