2020-01-28 14:32:34 +00:00
|
|
|
# (C) Copyright 2005- ECMWF.
|
2013-03-25 12:04:10 +00:00
|
|
|
|
|
|
|
# moved here to allow different bitsPerValue in second order packing
|
|
|
|
unsigned[1] bitsPerValue : dump ;
|
|
|
|
alias numberOfBitsContainingEachPackedValue = bitsPerValue;
|
|
|
|
|
|
|
|
# For grib1 -> grib2
|
|
|
|
#constant dataRepresentationTemplateNumber = ?;
|
|
|
|
|
|
|
|
# TODO
|
|
|
|
codetable[1] precision "grib1/precision.table" = 2 : dump,edition_specific;
|
2022-03-28 14:55:39 +00:00
|
|
|
concept accuracy(zero) {
|
|
|
|
32 = { precision = 1; }
|
|
|
|
64 = { precision = 2; }
|
|
|
|
128 = { precision = 3; }
|
|
|
|
} : long_type, no_copy;
|
|
|
|
|
2013-03-25 12:04:10 +00:00
|
|
|
position offsetBeforeData;
|
|
|
|
if( bitmapPresent || !GDSPresent ) {
|
|
|
|
# For grib1 -> grib2
|
|
|
|
constant bitMapIndicator = 0;
|
2022-02-05 19:28:17 +00:00
|
|
|
meta codedValues data_raw_packing(
|
2013-03-25 12:04:10 +00:00
|
|
|
section4Length,
|
|
|
|
offsetBeforeData,
|
|
|
|
offsetSection4,
|
2022-02-05 19:28:17 +00:00
|
|
|
numberOfValues,
|
|
|
|
precision);
|
2013-03-25 12:04:10 +00:00
|
|
|
meta values data_apply_bitmap(codedValues,
|
|
|
|
bitmap,missingValue,binaryScaleFactor) : dump;
|
2022-02-05 19:28:17 +00:00
|
|
|
alias data.packedValues = codedValues;
|
2013-03-25 12:04:10 +00:00
|
|
|
} else {
|
2022-02-05 19:28:17 +00:00
|
|
|
# For grib1 -> grib2
|
|
|
|
constant bitMapIndicator = 255;
|
|
|
|
meta values data_raw_packing(
|
2013-03-25 12:04:10 +00:00
|
|
|
section4Length,
|
|
|
|
offsetBeforeData,
|
|
|
|
offsetSection4,
|
|
|
|
numberOfCodedValues,
|
2022-02-05 19:28:17 +00:00
|
|
|
precision);
|
|
|
|
alias data.packedValues = values;
|
2013-03-25 12:04:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
meta numberOfCodedValues number_of_values_data_raw_packing(values,precision);
|
|
|
|
|
|
|
|
template statistics "common/statistics_grid.def";
|
2022-12-01 20:06:08 +00:00
|
|
|
template missing_values "common/missing_values_grid.def";
|