Testing: Test both gridded IFS CCSDS samples

This commit is contained in:
Shahram Najm 2023-06-02 20:32:19 +01:00
parent f0fc1aa05d
commit 88571d7214
1 changed files with 15 additions and 10 deletions

View File

@ -146,17 +146,22 @@ ${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`
ifs_samples="gg_ml.tmpl gg_sfc_grib2.tmpl"
ifs_dir=${proj_dir}/ifs_samples/grib1_mlgrib2_ccsds
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
for sample in $ifs_samples; do
input=$ifs_dir/$sample
MIN_BPV=`${tools_dir}/grib_get -p bitsPerValue $input`
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
done