Testing: CCSDS with various bits per value

This commit is contained in:
Shahram Najm 2023-06-02 16:07:44 +01:00
parent 7ebcceea39
commit a75f6c2d14
1 changed files with 20 additions and 4 deletions

View File

@ -82,8 +82,8 @@ fi
rm -f $outfile1 $outfile2
infile=${data_dir}/reduced_latlon_surface.grib2
outfile1=$infile.tmp_ccsds.1
outfile2=$infile.tmp_ccsds.2
#outfile1=$infile.tmp_ccsds.1
#outfile2=$infile.tmp_ccsds.2
${tools_dir}/grib_set -r -s packingType=grid_ccsds $infile $outfile1
${tools_dir}/grib_compare -b $BLACKLIST $infile $outfile1 > $REDIRECT
@ -101,8 +101,8 @@ rm -f $outfile1 $outfile2
# ECC-297: Basic support
# --------------------------------------
infile=${data_dir}/tigge_ecmwf.grib2
outfile1=$infile.tmp_ccsds.1
outfile2=$infile.tmp_ccsds.2
#outfile1=$infile.tmp_ccsds.1
#outfile2=$infile.tmp_ccsds.2
${tools_dir}/grib_set -r -s bitsPerValue=17 $infile $outfile1
${tools_dir}/grib_set -r -s packingType=grid_ccsds $outfile1 $outfile2
@ -143,6 +143,22 @@ grib_check_key_equals $outfile2 packingType grid_ccsds
${tools_dir}/grib_compare -b $BLACKLIST $infile $outfile1
${tools_dir}/grib_compare -c data:n $outfile1 $outfile2
# Test increasing bitsPerValue
# -----------------------------
# input=${data_dir}/ccsds.grib2 TODO: This is broken for some BPV values!!
input=${proj_dir}/ifs_samples/grib1_mlgrib2_ccsds/gg_ml.tmpl
MIN_BPV=`${tools_dir}/grib_get -p bitsPerValue $input`
MAX_BPV=32 # libaec cannot handle more than this
stats1=`${tools_dir}/grib_get -F%.3f -p min,max,avg,sd $input`
grib_check_key_equals $input 'bitsPerValue,packingType' '16 grid_ccsds'
for bpv in `seq $MIN_BPV $MAX_BPV`; do
${tools_dir}/grib_set -s setBitsPerValue=$bpv $input $outfile2
${tools_dir}/grib_compare -c data:n $input $outfile2
stats2=`${tools_dir}/grib_get -F%.3f -p min,max,avg,sd $outfile2`
[ "$stats1" = "$stats2" ]
rm -f $outfile2
done
# ECC-1362
# ---------