Switch off unused bitmap
Hello Uwe,
I would like to ask you if you see the possibility to implement the following functionality for GRIB files into CDI?
A check for an unnecessary bitmap: I.e. a bitmap has been switched on for a GRIB record, but it is in fact not required, since the number of coded values turned out to be equal to the number of grid points.
Possible solution: right before writing the record, something of the sort (in ecCodes meta language):
if (bitmapPresent) {
if (numberOfCodedValues == numberOfDataPoints) { # OR: if (numberOfMissing == 0) {
set bitmapPresent = 0 ;
}
}
is applied to the metadata.
Example of use: In our operational use of ICON, there is GRIB output on a native triangular limited-area grid. The boundary zone of the grid is masked by a bitmap. In addition, there is output interpolated on a regular lat-lon grid. It inherits metadata from the native grid, including the bitmap being switched on. In fact, no grid point of the lat-lon grid lies in (or beyond) the boundary zone, so no bitmap would be necessary in most cases. It would be very helpful if these unnecessary bitmaps could be switched off. First, because of postprocessing becoming more expensive if a(n unnecessary) bitmap has to be evaluated. Second, because deleting an unnecessary bitmap reduces the file size by about 100%/(bitsPerValue + 1).
There are probably many more use cases that could profit from deleting unused bitmaps.