eccodes/tests/grib_grid_mercator.sh

39 lines
1.1 KiB
Bash
Raw Normal View History

2020-05-16 13:21:55 +00:00
#!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
. ./include.ctest.sh
2020-05-16 13:21:55 +00:00
# Define a common label for all the tmp files
label="grib_mercator_test"
tempOut="temp.${label}.out"
2024-02-20 13:57:38 +00:00
tempFilt="temp.${label}.filt"
2020-05-16 13:21:55 +00:00
input=${data_dir}/mercator.grib2
grib_check_key_equals $input "gridType" "mercator"
${tools_dir}/grib_get_data $input > $tempOut
numlines=`wc -l $tempOut | awk '{print $1}'`
[ "$numlines" = "2465" ] # 1 + numberOfDataPoints
# Check other iterator-related keys
2024-02-20 13:57:38 +00:00
cat > $tempFilt <<EOF
2020-05-16 13:21:55 +00:00
print "[latLonValues]";
print "[distinctLatitudes]";
print "[distinctLongitudes]";
EOF
2024-02-20 13:57:38 +00:00
${tools_dir}/grib_filter $tempFilt $input
2020-05-16 13:21:55 +00:00
2020-06-12 20:44:04 +00:00
# Nearest function
${tools_dir}/grib_ls -l 19,-97,1 $input > $tempOut
grep -q "Point chosen #1 index=618" $tempOut
2020-05-16 13:21:55 +00:00
# Clean up
2024-02-20 13:57:38 +00:00
rm -f $tempFilt $tempOut