ECC-1018: Reduced size of sample file

This commit is contained in:
Shahram Najm 2020-01-10 15:40:59 +00:00
parent 3fd8fb3a7e
commit 69a86fff37
2 changed files with 16 additions and 7 deletions

Binary file not shown.

View File

@ -25,16 +25,14 @@ sample=$ECCODES_SAMPLES_PATH/diag.tmpl
${tools_dir}/grib_ls $sample > $REDIRECT ${tools_dir}/grib_ls $sample > $REDIRECT
${tools_dir}/grib_dump $sample > $REDIRECT ${tools_dir}/grib_dump $sample > $REDIRECT
# Check setting keys echo "Check setting integer keys..."
# ------------------- # ----------------------------------
echo 'set numberOfIntegers=3; set integerValues={55, 44, 66}; write;' | ${tools_dir}/grib_filter -o $tempOut - $sample echo 'set numberOfIntegers=3; set integerValues={55, 44, 66}; write;' | ${tools_dir}/grib_filter -o $tempOut - $sample
${tools_dir}/grib_dump -p numberOfFloats,numberOfIntegers,floatValues,integerValues $tempOut | sed 1d > $tempTxt ${tools_dir}/grib_dump -p numberOfFloats,numberOfIntegers,floatValues,integerValues $tempOut | sed 1d > $tempTxt
cat > $tempRef <<EOF cat > $tempRef <<EOF
numberOfFloats = 2; numberOfFloats = 1;
numberOfIntegers = 3; numberOfIntegers = 3;
floatValues(2) = { floatValues = 3600;
3.32, 1.21
}
integerValues(3) = { integerValues(3) = {
55, 44, 66 55, 44, 66
} }
@ -42,6 +40,8 @@ EOF
diff $tempRef $tempTxt diff $tempRef $tempTxt
echo "Check setting float keys..."
# ---------------------------------
echo 'set numberOfFloats=3; set floatValues={8.8, 9.9, 10.10}; write;' | ${tools_dir}/grib_filter -o $tempOut - $sample echo 'set numberOfFloats=3; set floatValues={8.8, 9.9, 10.10}; write;' | ${tools_dir}/grib_filter -o $tempOut - $sample
${tools_dir}/grib_dump -p numberOfFloats,numberOfIntegers,floatValues,integerValues $tempOut | sed 1d > $tempTxt ${tools_dir}/grib_dump -p numberOfFloats,numberOfIntegers,floatValues,integerValues $tempOut | sed 1d > $tempTxt
cat > $tempRef <<EOF cat > $tempRef <<EOF
@ -50,11 +50,13 @@ cat > $tempRef <<EOF
floatValues(3) = { floatValues(3) = {
8.8, 9.9, 10.1 8.8, 9.9, 10.1
} }
integerValues = 66; integerValues = -557;
EOF EOF
diff $tempRef $tempTxt diff $tempRef $tempTxt
echo "Check setting integer & float keys..."
# ------------------------------------------
echo 'set numberOfIntegers=4; set integerValues={33, 55, -44, 66}; set numberOfFloats=3; set floatValues={-8.8, 9.9, 10.10}; write;' |\ echo 'set numberOfIntegers=4; set integerValues={33, 55, -44, 66}; set numberOfFloats=3; set floatValues={-8.8, 9.9, 10.10}; write;' |\
${tools_dir}/grib_filter -o $tempOut - $sample ${tools_dir}/grib_filter -o $tempOut - $sample
${tools_dir}/grib_dump -p numberOfFloats,numberOfIntegers,floatValues,integerValues $tempOut | sed 1d > $tempTxt ${tools_dir}/grib_dump -p numberOfFloats,numberOfIntegers,floatValues,integerValues $tempOut | sed 1d > $tempTxt
@ -70,6 +72,13 @@ cat > $tempRef <<EOF
EOF EOF
diff $tempRef $tempTxt diff $tempRef $tempTxt
echo "Check setting charValues (as ints)..."
# ------------------------------------------
echo 'set numberOfCharacters=6; set charValues={69,67,77,87,70,32}; write;' | ${tools_dir}/grib_filter -o $tempOut - $sample
${tools_dir}/grib_dump -O $tempOut > $tempTxt
grep -q "'E', 'C', 'M', 'W', 'F', ' '" $tempTxt
# TODO encoding of characters not fully working. We are using one-byte integers instead # TODO encoding of characters not fully working. We are using one-byte integers instead
#echo 'set numberOfCharacters=4; set charValues={"J","u","m","p"}; write;'| ${tools_dir}/grib_filter -o $tempOut - $sample #echo 'set numberOfCharacters=4; set charValues={"J","u","m","p"}; write;'| ${tools_dir}/grib_filter -o $tempOut - $sample
#res=`${tools_dir}/grib_dump $tempOut | grep charValues | tr -d '\n' | tr -d ' '` #res=`${tools_dir}/grib_dump $tempOut | grep charValues | tr -d '\n' | tr -d ' '`