Testing: Mercator error conditions

This commit is contained in:
shahramn 2024-08-22 14:14:41 +01:00
parent 4e71ddcb06
commit 1b430aff47
1 changed files with 20 additions and 1 deletions

View File

@ -32,11 +32,30 @@ cat > $tempFilt <<EOF
print "[distinctLongitudes]";
EOF
${tools_dir}/grib_filter $tempFilt $input
${tools_dir}/grib_filter $tempFilt $input > $tempOut
# Nearest function
${tools_dir}/grib_ls -l 19,-97,1 $input > $tempOut
grep -q "Point chosen #1 index=618" $tempOut
# Error conditions
# ----------------
input=${data_dir}/mercator.grib2
set +e
${tools_dir}/grib_get_data -s latitudeOfFirstGridPointInDegrees=90 $input > $tempOut 2>&1
status=$?
set -e
[ $status -ne 0 ]
grep -q "Transformation cannot be computed at the poles" $tempOut
input=${data_dir}/mercator.grib2
set +e
${tools_dir}/grib_get_data -s Ni=1 $input > $tempOut 2>&1
status=$?
set -e
[ $status -ne 0 ]
grep -q "Wrong number of points" $tempOut
# Clean up
rm -f $tempFilt $tempOut