Content from
https://confluence-test.ecmwf.int/display/ECC/Frequently+Asked+Questions
Summary
-
Order of setting fixed surface keys - ecCodes GRIB FAQ —
This article relates to GRIB edition 2
Problem
Setting the fixed surface keys in the wrong order can lead to incorrect values.
-
MEMFS: How do I access the samples in ifs_samples - ecCodes GRIB FAQ —
Problem
If you try to load the samples file "gg_ml.tmpl", it can fail because that one is not in the usual samples location but in "ifs_samples". Normally you extend the ECCODES_SAMPLES_PATH to include the ifs_samples directory. But with MEMFS the samples (and also definitions) are not installed (instead they are all embeddedwithin the library.
-
Why are there sometimes small negative precipitation accumulations - ecCodes GRIB FAQ —
Occasionally, we receive reports of negative precipitation totals being computed from IFS output encoded in GRIB. Although such reports often refer to "negative precipitation accumulation", the same issue can affect any field accumulated from the start of the forecast and small but spurious positive accumulations are also possible. Positive accumulations can lead to small increases in, say, solar radiation during night time hours when a zero increase is expected. This document explains both why this happens and the circumstances in which it occurs.
-
How can I convert a multi-field GRIB file to single-field - ecCodes GRIB FAQ —
This article relates to GRIB edition 2
Step-by-step guide
To convert multi-field GRIB messages into single-field, you can use the grib_copy command.
For example here we have a multi-field GRIB2 file with 30 messages some of which contain several fields. The grib_copy command creates a new file in which every message has a single field: -
Python3: codes_write error: 'argument must be str, not bytes' - ecCodes FAQ —
Problem
When trying to write out a GRIB or BUFR message to a file using codes_write, an error is generated (an exception is thrown)
Solution
-
grib_to_netcdf: skips Control Forecast when I convert Ensemble Forecast data - ecCodes GRIB FAQ —
If you have a file with both Control and Perturbed forecasts, grib_to_netcdf will only convert the pf. Normally from 51 members in the GRIB file, only 50 appear in the netCDF.
-
grib_to_netcdf: Why do I get the error "Wrong number of fields... Try using the -T option" - ecCodes GRIB FAQ —
You try to retrieve data from the ECMWF data archive in netCDF format but the retrieval fails with this message
-
Why I cannot set negative values for the longitude in GRIB 2 - ecCodes GRIB FAQ —
GRIB 1 regulates that the longitude can be in either [-180, 180] or [0,360], GRIB 2 regulates that the longitude can only be in the interval [0,360]
-
Why can I read certain parameters using the grib tools, but not from my program - ecCodes GRIB FAQ —
Your file may be encoded as a multi-field GRIB file. By default, grib tools have multi-field support enabled and the API disabled.
-
How to install ecCodes with Python bindings in conda - ecCodes FAQ —
This guide describes how to install ecCodes with Python bindings in a conda environment (Note: Python here means Python 3; Python 2 is deprecated).
Step-by-step guide
If you do not already have a conda environment installed on your system, the simplest is to download a miniforge installer for your platform
-
Why do I get a bitmap even though none of my values are missing - ecCodes GRIB FAQ —
If you encode data in a GRIB message and none of the values are actually missing, you can still end up with a Bitmap Section.
Step-by-step guide
If you encode data in GRIB and set the key "bitmapPresent" to 1, you will get a Bitmap Section in your message. If none of the values encoded match the "missingValue" key (by default 9999) then you will end up with a bitmap with all entries being 1 (data is present). This can add weight to the message (There is a single bit for each data value, therefore a data array of N points requires N/8 bytes for the bitmap array).
-
How do I use an OR condition (logical disjunction) in a where clause - ecCodes GRIB FAQ —
For example in grib_get you may want to show all messages which have a level of 100, 150 or 200.
-
Creating your own local definitions - ecCodes GRIB FAQ —
Local definitions are required when one needs to store information which is not part of the standard GRIB header. This might be local parameters or local definitions.
-
How can I set the verbosity level to see debug output? - ecCodes FAQ —
There is an environment variable called ECCODES_DEBUG: If set to -1, it will enable brief debug-level logging messages to be displayed by the library. If set to 1, you will get very verbose output.
-
How can I find out which keys can be set to "missing" - ecCodes GRIB FAQ —
If you take the sample GRIB file "GRIB2.tmpl" and dump it, you can see which keys are MISSING (i.e., their values are all 1's) but it is not possible to see which keys can be MISSING. So for example take the key "iDirectionIncrement":
% grib_dump -O GRIB2.tmpl ... iDirectionIncrement = 2000000 ...
So in this case its value is not MISSING but it is possible for this value to be MISSING. This is not indicated here.