ECC-1403: WIP

This commit is contained in:
Shahram Najm 2022-06-18 16:49:16 +01:00
parent 4a1e5c382c
commit 870729f8c9
1 changed files with 31 additions and 20 deletions

View File

@ -11,8 +11,9 @@
. ./include.ctest.sh . ./include.ctest.sh
label="grib_nearest_test" label="grib_nearest_test"
temp=$label.temp temp=temp.$label.txt
tempRef=$label.ref tempGrib=temp.$label.grib
tempRef=temp.$label.ref
input_grb=${data_dir}/reduced_gaussian_pressure_level.grib1 input_grb=${data_dir}/reduced_gaussian_pressure_level.grib1
# Nearest with decoding the data values # Nearest with decoding the data values
@ -52,34 +53,44 @@ diff $tempRef $temp
# ECC-1295: regular lat/lon on ellipsoid # ECC-1295: regular lat/lon on ellipsoid
# ---------------------------------------- # ----------------------------------------
sample2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl sample2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
${tools_dir}/grib_set -s shapeOfTheEarth=2 $sample2 $temp ${tools_dir}/grib_set -s shapeOfTheEarth=2 $sample2 $tempGrib
grib_check_key_equals $sample2 earthIsOblate 0 grib_check_key_equals $sample2 earthIsOblate 0
grib_check_key_equals $temp earthIsOblate 1 grib_check_key_equals $tempGrib earthIsOblate 1
${tools_dir}/grib_ls -l 0,0 $temp ${tools_dir}/grib_ls -l 0,0 $tempGrib
# reduced lat/lon on ellipsoid # reduced lat/lon on ellipsoid
# ---------------------------------------- # ----------------------------------------
sample2=$ECCODES_SAMPLES_PATH/reduced_ll_sfc_grib2.tmpl sample2=$ECCODES_SAMPLES_PATH/reduced_ll_sfc_grib2.tmpl
${tools_dir}/grib_set -s shapeOfTheEarth=4 $sample2 $temp ${tools_dir}/grib_set -s shapeOfTheEarth=4 $sample2 $tempGrib
grib_check_key_equals $sample2 earthIsOblate 0 grib_check_key_equals $sample2 earthIsOblate 0
grib_check_key_equals $temp earthIsOblate 1 grib_check_key_equals $tempGrib earthIsOblate 1
${tools_dir}/grib_ls -l 0,0 $temp ${tools_dir}/grib_ls -l 0,0 $tempGrib
# regular gaussian on ellipsoid # regular gaussian on ellipsoid
# ---------------------------------------- # ----------------------------------------
sample2=$ECCODES_SAMPLES_PATH/regular_gg_pl_grib2.tmpl sample2=$ECCODES_SAMPLES_PATH/regular_gg_pl_grib2.tmpl
${tools_dir}/grib_set -s shapeOfTheEarth=5 $sample2 $temp ${tools_dir}/grib_set -s shapeOfTheEarth=5 $sample2 $tempGrib
grib_check_key_equals $sample2 earthIsOblate 0 grib_check_key_equals $sample2 earthIsOblate 0
grib_check_key_equals $temp earthIsOblate 1 grib_check_key_equals $tempGrib earthIsOblate 1
${tools_dir}/grib_ls -l 0,0 $temp ${tools_dir}/grib_ls -l 0,0 $tempGrib
# reduced gaussian on ellipsoid # reduced gaussian on ellipsoid
# ---------------------------------------- # ----------------------------------------
sample2=$ECCODES_SAMPLES_PATH/reduced_gg_pl_48_grib2.tmpl sample2=$ECCODES_SAMPLES_PATH/reduced_gg_pl_48_grib2.tmpl
${tools_dir}/grib_set -s shapeOfTheEarth=5 $sample2 $temp ${tools_dir}/grib_set -s shapeOfTheEarth=5 $sample2 $tempGrib
grib_check_key_equals $sample2 earthIsOblate 0 grib_check_key_equals $sample2 earthIsOblate 0
grib_check_key_equals $temp earthIsOblate 1 grib_check_key_equals $tempGrib earthIsOblate 1
${tools_dir}/grib_ls -l 0,0 $temp ${tools_dir}/grib_ls -l 0,0 $tempGrib
# GRIB2 Complex packing regular lat/lon
# ----------------------------------------
input_grb=${data_dir}/sample.grib2
${tools_dir}/grib_set -r -s packingType=grid_complex $input_grb $tempGrib
${tools_dir}/grib_get -F%3.6g -l 0,0,1 $tempGrib > $temp
grep -q "300.119" $temp
${tools_dir}/grib_ls -l 0,0,1 $tempGrib > $temp
grep -q "Grid Point chosen #2 index=480 " $temp
# IEEE regular lat/lon # IEEE regular lat/lon
@ -87,7 +98,7 @@ ${tools_dir}/grib_ls -l 0,0 $temp
input_grb=${data_dir}/grid_ieee.grib input_grb=${data_dir}/grid_ieee.grib
${tools_dir}/grib_get -F%.3g -l 70,345.2,1 $input_grb > $temp ${tools_dir}/grib_get -F%.3g -l 70,345.2,1 $input_grb > $temp
grep -q "3.24e-08" $temp grep -q "3.24e-08" $temp
${tools_dir}/grib_get -l 70,345.2,1 $input_grb > $temp ${tools_dir}/grib_ls -l 70,345.2,1 $input_grb > $temp
grep -q "Grid Point chosen #4 index=0 " $temp grep -q "Grid Point chosen #4 index=0 " $temp
# CCDSDS regular lat/lon # CCDSDS regular lat/lon
@ -102,4 +113,4 @@ fi
# Clean up # Clean up
rm -f $temp $tempRef rm -f $temp $tempRef $tempGrib