From fd037b179a7d03f1b20ee2baf36a01d07af009d4 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 1 Dec 2022 20:06:08 +0000 Subject: [PATCH] ECC-1485: Definitions: Split the statistics from missing-values templates --- definitions/common/missing_values_grid.def | 5 +++++ definitions/common/statistics_grid.def | 4 ---- definitions/grib1/data.grid_ieee.def | 1 + definitions/grib1/data.grid_second_order.def | 1 + .../grib1/data.grid_second_order_constant_width.def | 1 + .../grib1/data.grid_second_order_general_grib1.def | 1 + definitions/grib1/data.grid_second_order_row_by_row.def | 1 + definitions/grib1/data.grid_simple.def | 1 + definitions/grib1/data.grid_simple_matrix.def | 1 + definitions/grib2/template.7.0.def | 1 + definitions/grib2/template.7.1.def | 1 + definitions/grib2/template.7.2.def | 8 ++------ definitions/grib2/template.7.3.def | 9 +++------ definitions/grib2/template.7.4.def | 1 + definitions/grib2/template.7.40.def | 1 + definitions/grib2/template.7.41.def | 1 + definitions/grib2/template.7.42.def | 1 + definitions/grib2/template.7.50001.def | 1 + definitions/grib2/template.7.50002.def | 1 + definitions/grib2/template.7.6.def | 1 + definitions/grib2/template.7.61.def | 1 + definitions/grib2/template.7.second_order.def | 1 + 22 files changed, 28 insertions(+), 16 deletions(-) create mode 100644 definitions/common/missing_values_grid.def diff --git a/definitions/common/missing_values_grid.def b/definitions/common/missing_values_grid.def new file mode 100644 index 000000000..cad6110ed --- /dev/null +++ b/definitions/common/missing_values_grid.def @@ -0,0 +1,5 @@ +# (C) Copyright 2005- ECMWF. + +#meta numberOfMissing vector(computeStatistics,3) : dump; +meta numberOfMissing count_missing(bitmap,unusedBitsInBitmap,numberOfDataPoints) : dump; +alias numberOfMissingValues=numberOfMissing; diff --git a/definitions/common/statistics_grid.def b/definitions/common/statistics_grid.def index f3351175d..d1a67ad34 100644 --- a/definitions/common/statistics_grid.def +++ b/definitions/common/statistics_grid.def @@ -8,15 +8,11 @@ meta computeStatistics statistics(missingValue,values); meta maximum vector(computeStatistics,0) : dump; meta minimum vector(computeStatistics,1) : dump; meta average vector(computeStatistics,2) : dump; -#meta numberOfMissing vector(computeStatistics,3) : dump; -meta numberOfMissing count_missing(bitmap,unusedBitsInBitmap,numberOfDataPoints) : dump; meta standardDeviation vector(computeStatistics,4) : dump; meta skewness vector(computeStatistics,5) : dump; meta kurtosis vector(computeStatistics,6) : dump; meta isConstant vector(computeStatistics,7) : dump; -alias numberOfMissingValues=numberOfMissing; - alias statistics.avg = average; alias statistics.max = maximum; alias statistics.min = minimum; diff --git a/definitions/grib1/data.grid_ieee.def b/definitions/grib1/data.grid_ieee.def index f0d5f6212..60ed5d21c 100644 --- a/definitions/grib1/data.grid_ieee.def +++ b/definitions/grib1/data.grid_ieee.def @@ -43,3 +43,4 @@ if( bitmapPresent || !GDSPresent ) { meta numberOfCodedValues number_of_values_data_raw_packing(values,precision); template statistics "common/statistics_grid.def"; +template missing_values "common/missing_values_grid.def"; diff --git a/definitions/grib1/data.grid_second_order.def b/definitions/grib1/data.grid_second_order.def index 1809dd2fa..a62dc7dba 100644 --- a/definitions/grib1/data.grid_second_order.def +++ b/definitions/grib1/data.grid_second_order.def @@ -174,3 +174,4 @@ if(bitmapPresent) { meta packingError simple_packing_error(bitsPerValue,binaryScaleFactor,decimalScaleFactor,referenceValue,ibm) : no_copy; template statistics "common/statistics_grid.def"; +template missing_values "common/missing_values_grid.def"; diff --git a/definitions/grib1/data.grid_second_order_constant_width.def b/definitions/grib1/data.grid_second_order_constant_width.def index 8042255b4..1333a3243 100644 --- a/definitions/grib1/data.grid_second_order_constant_width.def +++ b/definitions/grib1/data.grid_second_order_constant_width.def @@ -148,3 +148,4 @@ transient numberOfCodedValues = numberOfSecondOrderPackedValues; meta packingError simple_packing_error(bitsPerValue,binaryScaleFactor,decimalScaleFactor,referenceValue,ibm) : no_copy; template statistics "common/statistics_grid.def"; +template missing_values "common/missing_values_grid.def"; diff --git a/definitions/grib1/data.grid_second_order_general_grib1.def b/definitions/grib1/data.grid_second_order_general_grib1.def index 6f5ef7c8a..0e5106867 100644 --- a/definitions/grib1/data.grid_second_order_general_grib1.def +++ b/definitions/grib1/data.grid_second_order_general_grib1.def @@ -147,3 +147,4 @@ transient numberOfCodedValues = numberOfSecondOrderPackedValues; meta packingError simple_packing_error(bitsPerValue,binaryScaleFactor,decimalScaleFactor,referenceValue,ibm) : no_copy; template statistics "common/statistics_grid.def"; +template missing_values "common/missing_values_grid.def"; diff --git a/definitions/grib1/data.grid_second_order_row_by_row.def b/definitions/grib1/data.grid_second_order_row_by_row.def index e5c96e3e8..465ebdb6d 100644 --- a/definitions/grib1/data.grid_second_order_row_by_row.def +++ b/definitions/grib1/data.grid_second_order_row_by_row.def @@ -94,3 +94,4 @@ transient numberOfCodedValues = numberOfSecondOrderPackedValues; meta packingError simple_packing_error(bitsPerValue,binaryScaleFactor,decimalScaleFactor,referenceValue,ibm) : no_copy; template statistics "common/statistics_grid.def"; +template missing_values "common/missing_values_grid.def"; diff --git a/definitions/grib1/data.grid_simple.def b/definitions/grib1/data.grid_simple.def index af33d1438..8d973e0bb 100644 --- a/definitions/grib1/data.grid_simple.def +++ b/definitions/grib1/data.grid_simple.def @@ -68,3 +68,4 @@ meta numberOfCodedValues number_of_coded_values(bitsPerValue,offsetBeforeData,of meta packingError simple_packing_error(bitsPerValue,binaryScaleFactor,decimalScaleFactor,referenceValue,ibm) : no_copy; meta unpackedError simple_packing_error(zero,binaryScaleFactor,decimalScaleFactor,referenceValue,ieee) : no_copy; template statistics "common/statistics_grid.def"; +template missing_values "common/missing_values_grid.def"; diff --git a/definitions/grib1/data.grid_simple_matrix.def b/definitions/grib1/data.grid_simple_matrix.def index a9b2ba6e7..5f8543e25 100644 --- a/definitions/grib1/data.grid_simple_matrix.def +++ b/definitions/grib1/data.grid_simple_matrix.def @@ -177,3 +177,4 @@ meta packingError simple_packing_error(bitsPerValue,binaryScaleFactor,decimalSca meta numberOfCodedValues number_of_coded_values(bitsPerValue,offsetBeforeData,offsetAfterData,halfByte,numberOfValues) : dump; template statistics "common/statistics_grid.def"; +template missing_values "common/missing_values_grid.def"; diff --git a/definitions/grib2/template.7.0.def b/definitions/grib2/template.7.0.def index d23d33b6b..02b4ea60c 100644 --- a/definitions/grib2/template.7.0.def +++ b/definitions/grib2/template.7.0.def @@ -32,3 +32,4 @@ meta unpackedError simple_packing_error(zero,binaryScaleFactor,decimalScaleFacto alias data.packedValues=codedValues; template statistics "common/statistics_grid.def"; +template missing_values "common/missing_values_grid.def"; diff --git a/definitions/grib2/template.7.1.def b/definitions/grib2/template.7.1.def index f4b2c3054..1f1f6ab57 100644 --- a/definitions/grib2/template.7.1.def +++ b/definitions/grib2/template.7.1.def @@ -33,3 +33,4 @@ meta unpackedError simple_packing_error(zero,binaryScaleFactor,decimalScaleFacto alias data.packedValues = codedValues; template statistics "common/statistics_grid.def"; +template missing_values "common/missing_values_grid.def"; diff --git a/definitions/grib2/template.7.2.def b/definitions/grib2/template.7.2.def index c131daf02..3e8ca8f5e 100644 --- a/definitions/grib2/template.7.2.def +++ b/definitions/grib2/template.7.2.def @@ -45,9 +45,5 @@ meta values data_apply_bitmap(codedValues, alias data.packedValues = codedValues; template statistics "common/statistics_grid.def"; -if(missingValueManagementUsed) { - #remove numberOfMissing; - #remove numberOfMissingValues; - meta numberOfMissing count_missing(bitmap,unusedBitsInBitmap,numberOfDataPoints,missingValueManagementUsed) : dump; - alias numberOfMissingValues=numberOfMissing; -} +meta numberOfMissing count_missing(bitmap,unusedBitsInBitmap,numberOfDataPoints,missingValueManagementUsed) : dump; +alias numberOfMissingValues=numberOfMissing; diff --git a/definitions/grib2/template.7.3.def b/definitions/grib2/template.7.3.def index afada6614..13fff2006 100644 --- a/definitions/grib2/template.7.3.def +++ b/definitions/grib2/template.7.3.def @@ -42,9 +42,6 @@ meta values data_apply_bitmap(codedValues, alias data.packedValues=codedValues; template statistics "common/statistics_grid.def"; -if(missingValueManagementUsed) { - #remove numberOfMissingValues; - #remove numberOfMissing; - meta numberOfMissing count_missing(bitmap,unusedBitsInBitmap,numberOfDataPoints,missingValueManagementUsed) : dump; - alias numberOfMissingValues=numberOfMissing; -} + +meta numberOfMissing count_missing(bitmap,unusedBitsInBitmap,numberOfDataPoints,missingValueManagementUsed) : dump; +alias numberOfMissingValues=numberOfMissing; diff --git a/definitions/grib2/template.7.4.def b/definitions/grib2/template.7.4.def index 2ef305f6b..203f19c5c 100644 --- a/definitions/grib2/template.7.4.def +++ b/definitions/grib2/template.7.4.def @@ -20,3 +20,4 @@ meta values data_apply_bitmap(codedValues, alias data.packedValues = codedValues; template statistics "common/statistics_grid.def"; +template missing_values "common/missing_values_grid.def"; diff --git a/definitions/grib2/template.7.40.def b/definitions/grib2/template.7.40.def index d5b93c0de..731d7979e 100644 --- a/definitions/grib2/template.7.40.def +++ b/definitions/grib2/template.7.40.def @@ -49,3 +49,4 @@ meta values data_apply_bitmap(codedValues, alias data.packedValues = codedValues; template statistics "common/statistics_grid.def"; +template missing_values "common/missing_values_grid.def"; diff --git a/definitions/grib2/template.7.41.def b/definitions/grib2/template.7.41.def index bd59ee357..31e90a54e 100644 --- a/definitions/grib2/template.7.41.def +++ b/definitions/grib2/template.7.41.def @@ -30,3 +30,4 @@ meta values data_apply_bitmap(codedValues, alias data.packedValues = codedValues; template statistics "common/statistics_grid.def"; +template missing_values "common/missing_values_grid.def"; diff --git a/definitions/grib2/template.7.42.def b/definitions/grib2/template.7.42.def index ff68e0664..6f456485f 100644 --- a/definitions/grib2/template.7.42.def +++ b/definitions/grib2/template.7.42.def @@ -33,3 +33,4 @@ meta unpackedError simple_packing_error(zero,binaryScaleFactor,decimalScaleFacto alias data.packedValues = codedValues; template statistics "common/statistics_grid.def"; +template missing_values "common/missing_values_grid.def"; diff --git a/definitions/grib2/template.7.50001.def b/definitions/grib2/template.7.50001.def index 6a7a0f5a0..35e5fe602 100644 --- a/definitions/grib2/template.7.50001.def +++ b/definitions/grib2/template.7.50001.def @@ -99,3 +99,4 @@ if(bitmapPresent) { meta packingError simple_packing_error(bitsPerValue,binaryScaleFactor,decimalScaleFactor,referenceValue,ieee) : no_copy; template statistics "common/statistics_grid.def"; +template missing_values "common/missing_values_grid.def"; diff --git a/definitions/grib2/template.7.50002.def b/definitions/grib2/template.7.50002.def index c29b61379..e274aaa19 100644 --- a/definitions/grib2/template.7.50002.def +++ b/definitions/grib2/template.7.50002.def @@ -146,3 +146,4 @@ if(bitmapPresent) { meta packingError simple_packing_error(bitsPerValue,binaryScaleFactor,decimalScaleFactor,referenceValue,ieee) : no_copy; template statistics "common/statistics_grid.def"; +template missing_values "common/missing_values_grid.def"; diff --git a/definitions/grib2/template.7.6.def b/definitions/grib2/template.7.6.def index ef5c7101a..5fd1c1afe 100644 --- a/definitions/grib2/template.7.6.def +++ b/definitions/grib2/template.7.6.def @@ -30,3 +30,4 @@ meta values data_apply_bitmap(codedValues, alias data.packedValues = codedValues; template statistics "common/statistics_grid.def"; +template missing_values "common/missing_values_grid.def"; diff --git a/definitions/grib2/template.7.61.def b/definitions/grib2/template.7.61.def index ef5c7101a..5fd1c1afe 100644 --- a/definitions/grib2/template.7.61.def +++ b/definitions/grib2/template.7.61.def @@ -30,3 +30,4 @@ meta values data_apply_bitmap(codedValues, alias data.packedValues = codedValues; template statistics "common/statistics_grid.def"; +template missing_values "common/missing_values_grid.def"; diff --git a/definitions/grib2/template.7.second_order.def b/definitions/grib2/template.7.second_order.def index 2e1796700..9bc13b274 100644 --- a/definitions/grib2/template.7.second_order.def +++ b/definitions/grib2/template.7.second_order.def @@ -54,3 +54,4 @@ meta values data_apply_bitmap(codedValues, alias data.packedValues = codedValues; template statistics "common/statistics_grid.def"; +template missing_values "common/missing_values_grid.def";