Testing: Secondary bitmaps (GRIB1)

This commit is contained in:
Shahram Najm 2024-02-18 13:12:13 +00:00
parent 6a41db4730
commit 95bd0bc006
1 changed files with 14 additions and 0 deletions

View File

@ -18,6 +18,7 @@ tempLog=temp.$label.log
tempRef=temp.$label.ref
# Use a GRIB2 input with a bitmap
# ----------------------------------
input=$data_dir/reduced_latlon_surface.grib2
grib_check_key_equals $input bitmapPresent 1
${tools_dir}/grib_set -s packingType=grid_simple_matrix,NC=1,NR=1 $input $tempGribA
@ -26,10 +27,23 @@ ${tools_dir}/grib_dump -O $tempGribB
${tools_dir}/grib_dump -Dat $tempGribB
# Call pack_double and unpack_double
# ----------------------------------
cat >$tempFilt<<EOF
set values = {0, 1, 9999};
print "[bitmap]";
EOF
${tools_dir}/grib_filter $tempFilt $tempGribB
# data_g1secondary_bitmap
# ----------------------------------
cat >$tempFilt<<EOF
transient expandBy = 1;
meta _s data_g1secondary_bitmap(bitmap,secondaryBitmaps,missingValue,expandBy,octetAtWichPackedDataBegins);
print "[_s]";
set _s = {0, 9};
EOF
# The above filter is for testing only. Add -f as we know it will fail
${tools_dir}/grib_filter -f $tempFilt $tempGribB
# Clean up
rm -f $tempGribA $tempGribB $tempFilt $tempLog $tempRef