mirror of https://github.com/ecmwf/eccodes.git
ECC-1623: Further tests
This commit is contained in:
parent
e6cf029fb0
commit
dbdc218b56
|
@ -10,16 +10,17 @@
|
||||||
|
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
|
|
||||||
REDIRECT=/dev/null
|
|
||||||
|
|
||||||
label="bufr_ecc-1623_test"
|
label="bufr_ecc-1623_test"
|
||||||
tempBufr=temp.$label.bufr
|
tempBufrA=temp.$label.A.bufr
|
||||||
|
tempBufrB=temp.$label.B.bufr
|
||||||
tempFilt=temp.$label.filt
|
tempFilt=temp.$label.filt
|
||||||
tempText=temp.$label.txt
|
tempText=temp.$label.txt
|
||||||
tempRef=temp.$label.ref
|
tempRef=temp.$label.ref
|
||||||
|
|
||||||
sample_bufr4=$ECCODES_SAMPLES_PATH/BUFR4.tmpl
|
sample_bufr4=$ECCODES_SAMPLES_PATH/BUFR4.tmpl
|
||||||
|
|
||||||
|
# Test 1
|
||||||
|
# ------------------------
|
||||||
cat > $tempFilt <<EOF
|
cat > $tempFilt <<EOF
|
||||||
set numberOfSubsets = 2;
|
set numberOfSubsets = 2;
|
||||||
set compressedData = 0;
|
set compressedData = 0;
|
||||||
|
@ -30,9 +31,9 @@ cat > $tempFilt <<EOF
|
||||||
write;
|
write;
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
${tools_dir}/codes_bufr_filter -o $tempBufr $tempFilt $sample_bufr4
|
${tools_dir}/codes_bufr_filter -o $tempBufrA $tempFilt $sample_bufr4
|
||||||
echo 'set unpack=1; print "[icaoLocationIndicator]";' |\
|
echo 'set unpack=1; print "[icaoLocationIndicator]";' |\
|
||||||
${tools_dir}/codes_bufr_filter - $tempBufr > $tempText
|
${tools_dir}/codes_bufr_filter - $tempBufrA > $tempText
|
||||||
|
|
||||||
cat > $tempRef<<EOF
|
cat > $tempRef<<EOF
|
||||||
peach cedar
|
peach cedar
|
||||||
|
@ -40,6 +41,23 @@ EOF
|
||||||
|
|
||||||
diff $tempRef $tempText
|
diff $tempRef $tempText
|
||||||
|
|
||||||
|
# Encode differently
|
||||||
|
cat > $tempFilt <<EOF
|
||||||
|
set numberOfSubsets = 2;
|
||||||
|
set compressedData = 0;
|
||||||
|
set unexpandedDescriptors = { 307011 };
|
||||||
|
set #1#icaoLocationIndicator = "peach";
|
||||||
|
set #2#icaoLocationIndicator = "cedar";
|
||||||
|
set stationType = { 2, 1 };
|
||||||
|
set pack = 1;
|
||||||
|
write;
|
||||||
|
EOF
|
||||||
|
|
||||||
|
${tools_dir}/codes_bufr_filter -o $tempBufrB $tempFilt $sample_bufr4
|
||||||
|
${tools_dir}/bufr_compare $tempBufrA $tempBufrB
|
||||||
|
|
||||||
|
|
||||||
|
# Test 2
|
||||||
# ------------------------
|
# ------------------------
|
||||||
cat > $tempFilt <<EOF
|
cat > $tempFilt <<EOF
|
||||||
set unpack = 1;
|
set unpack = 1;
|
||||||
|
@ -49,9 +67,9 @@ cat > $tempFilt <<EOF
|
||||||
write;
|
write;
|
||||||
EOF
|
EOF
|
||||||
input=$data_dir/bufr/synop_multi_subset.bufr
|
input=$data_dir/bufr/synop_multi_subset.bufr
|
||||||
${tools_dir}/codes_bufr_filter -o $tempBufr $tempFilt $input
|
${tools_dir}/codes_bufr_filter -o $tempBufrA $tempFilt $input
|
||||||
result=`${tools_dir}/bufr_get -s unpack=1 -p '#3#stationOrSiteName' $tempBufr`
|
result=`${tools_dir}/bufr_get -s unpack=1 -p '#3#stationOrSiteName' $tempBufrA`
|
||||||
[ "$result" = "Night" ]
|
[ "$result" = "Night" ]
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
rm -f $tempBufr $tempFilt $tempRef $tempText
|
rm -f $tempBufrA $tempBufrB $tempFilt $tempRef $tempText
|
||||||
|
|
Loading…
Reference in New Issue