mirror of https://github.com/ecmwf/eccodes.git
ECC-1374: Add more tests
This commit is contained in:
parent
6eae07b94a
commit
6d6d574dfc
|
@ -27,6 +27,7 @@ meta countOfGroupLengths sum(groupLengths);
|
||||||
transient numberOfCodedValues=countOfGroupLengths+orderOfSPD;
|
transient numberOfCodedValues=countOfGroupLengths+orderOfSPD;
|
||||||
#transient numberOfCodedValues=countOfGroupLengths;
|
#transient numberOfCodedValues=countOfGroupLengths;
|
||||||
meta bitsPerValue second_order_bits_per_value(codedValues,binaryScaleFactor,decimalScaleFactor);
|
meta bitsPerValue second_order_bits_per_value(codedValues,binaryScaleFactor,decimalScaleFactor);
|
||||||
|
alias accuracy = bitsPerValue;
|
||||||
|
|
||||||
|
|
||||||
position offsetBeforeData;
|
position offsetBeforeData;
|
||||||
|
|
|
@ -11,6 +11,7 @@ meta numberOfGroups evaluate(codedNumberOfFirstOrderPackedValues + 65536 * extra
|
||||||
|
|
||||||
unsigned[1] groupWidth :dump;
|
unsigned[1] groupWidth :dump;
|
||||||
meta bitsPerValue second_order_bits_per_value(values,binaryScaleFactor,decimalScaleFactor);
|
meta bitsPerValue second_order_bits_per_value(values,binaryScaleFactor,decimalScaleFactor);
|
||||||
|
alias accuracy = bitsPerValue;
|
||||||
|
|
||||||
position offsetBeforeData;
|
position offsetBeforeData;
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ meta numberOfGroups evaluate(codedNumberOfFirstOrderPackedValues + 65536 * extra
|
||||||
|
|
||||||
unsigned[1] groupWidths[numberOfGroups] :dump;
|
unsigned[1] groupWidths[numberOfGroups] :dump;
|
||||||
meta bitsPerValue second_order_bits_per_value(values,binaryScaleFactor,decimalScaleFactor);
|
meta bitsPerValue second_order_bits_per_value(values,binaryScaleFactor,decimalScaleFactor);
|
||||||
|
alias accuracy = bitsPerValue;
|
||||||
|
|
||||||
position offsetBeforeData;
|
position offsetBeforeData;
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ meta numberOfGroups evaluate(codedNumberOfFirstOrderPackedValues + 65536 * extra
|
||||||
|
|
||||||
unsigned[1] groupWidths[numberOfGroups] :dump;
|
unsigned[1] groupWidths[numberOfGroups] :dump;
|
||||||
meta bitsPerValue second_order_bits_per_value(values,binaryScaleFactor,decimalScaleFactor);
|
meta bitsPerValue second_order_bits_per_value(values,binaryScaleFactor,decimalScaleFactor);
|
||||||
|
alias accuracy = bitsPerValue;
|
||||||
|
|
||||||
position offsetBeforeData;
|
position offsetBeforeData;
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
# (C) Copyright 2005- ECMWF.
|
# (C) Copyright 2005- ECMWF.
|
||||||
|
|
||||||
ieeefloat referenceValue : no_copy;
|
ieeefloat referenceValue: no_copy;
|
||||||
meta referenceValueError reference_value_error(referenceValue,ieee);
|
meta referenceValueError reference_value_error(referenceValue,ieee);
|
||||||
|
|
||||||
signed[2] binaryScaleFactor : no_copy;
|
signed[2] binaryScaleFactor: no_copy;
|
||||||
|
|
||||||
signed[2] decimalScaleFactor :no_copy;
|
signed[2] decimalScaleFactor: no_copy;
|
||||||
|
|
||||||
# Try different values of binaryScaleFactor and decimalScaleFactor to reduce packing error
|
# Try different values of binaryScaleFactor and decimalScaleFactor to reduce packing error
|
||||||
transient optimizeScaleFactor = 0;
|
transient optimizeScaleFactor = 0;
|
||||||
|
|
||||||
unsigned[1] bitsPerValue ;
|
unsigned[1] bitsPerValue;
|
||||||
|
alias accuracy = bitsPerValue;
|
||||||
if (bitsPerValue) {
|
if (bitsPerValue) {
|
||||||
unsigned[1] widthOfFirstOrderValues :no_copy ;
|
unsigned[1] widthOfFirstOrderValues :no_copy ;
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,9 @@ signed[2] decimalScaleFactor :no_copy;
|
||||||
# Try different values of binaryScaleFactor and decimalScaleFactor to reduce packing error
|
# Try different values of binaryScaleFactor and decimalScaleFactor to reduce packing error
|
||||||
transient optimizeScaleFactor = 0;
|
transient optimizeScaleFactor = 0;
|
||||||
|
|
||||||
unsigned[1] bitsPerValue ;
|
unsigned[1] bitsPerValue;
|
||||||
unsigned[1] widthOfFirstOrderValues :no_copy ;
|
alias accuracy = bitsPerValue;
|
||||||
|
unsigned[1] widthOfFirstOrderValues :no_copy;
|
||||||
|
|
||||||
unsigned [4] numberOfGroups : no_copy;
|
unsigned [4] numberOfGroups : no_copy;
|
||||||
unsigned [4] numberOfSecondOrderPackedValues : no_copy;
|
unsigned [4] numberOfSecondOrderPackedValues : no_copy;
|
||||||
|
|
|
@ -87,6 +87,7 @@ sec_ord_bmp=sec_ord_bmp.$$.grib1
|
||||||
|
|
||||||
# Convert to second order packing
|
# Convert to second order packing
|
||||||
${tools_dir}/grib_set -r -s packingType=grid_second_order gen_bitmap.grib $sec_ord_bmp
|
${tools_dir}/grib_set -r -s packingType=grid_second_order gen_bitmap.grib $sec_ord_bmp
|
||||||
|
grib_check_key_equals $sec_ord_bmp accuracy 4
|
||||||
# Check there are missing values
|
# Check there are missing values
|
||||||
nums=`${tools_dir}/grib_get -p numberOfDataPoints,numberOfCodedValues,numberOfMissing $sec_ord_bmp`
|
nums=`${tools_dir}/grib_get -p numberOfDataPoints,numberOfCodedValues,numberOfMissing $sec_ord_bmp`
|
||||||
[ "$nums" = "5969 4 5965" ]
|
[ "$nums" = "5969 4 5965" ]
|
||||||
|
@ -129,7 +130,7 @@ cat > $test_filter<<EOF
|
||||||
EOF
|
EOF
|
||||||
${tools_dir}/grib_filter -o $temp2 $test_filter $ECCODES_SAMPLES_PATH/GRIB2.tmpl
|
${tools_dir}/grib_filter -o $temp2 $test_filter $ECCODES_SAMPLES_PATH/GRIB2.tmpl
|
||||||
${tools_dir}/grib_set -r -s packingType=grid_second_order $temp2 $temp3
|
${tools_dir}/grib_set -r -s packingType=grid_second_order $temp2 $temp3
|
||||||
grib_check_key_equals $temp3 packingType grid_simple
|
grib_check_key_equals $temp3 packingType,accuracy 'grid_simple 24'
|
||||||
|
|
||||||
# Three coded values: Now we can change to 2nd order
|
# Three coded values: Now we can change to 2nd order
|
||||||
cat > $test_filter<<EOF
|
cat > $test_filter<<EOF
|
||||||
|
@ -138,7 +139,7 @@ cat > $test_filter<<EOF
|
||||||
EOF
|
EOF
|
||||||
${tools_dir}/grib_filter -o $temp2 $test_filter $ECCODES_SAMPLES_PATH/GRIB2.tmpl
|
${tools_dir}/grib_filter -o $temp2 $test_filter $ECCODES_SAMPLES_PATH/GRIB2.tmpl
|
||||||
${tools_dir}/grib_set -r -s packingType=grid_second_order $temp2 $temp3
|
${tools_dir}/grib_set -r -s packingType=grid_second_order $temp2 $temp3
|
||||||
grib_check_key_equals $temp3 packingType grid_second_order
|
grib_check_key_equals $temp3 packingType,accuracy 'grid_second_order 24'
|
||||||
|
|
||||||
|
|
||||||
# ECC-1219: packingType conversion from grid_ieee to grid_second_order
|
# ECC-1219: packingType conversion from grid_ieee to grid_second_order
|
||||||
|
|
Loading…
Reference in New Issue