File: bufr_ecc-313.sh

package info (click to toggle)
eccodes 2.45.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 154,404 kB
  • sloc: cpp: 162,953; ansic: 26,308; sh: 21,742; f90: 6,854; perl: 6,361; python: 5,172; java: 2,226; javascript: 1,427; yacc: 854; fortran: 543; lex: 359; makefile: 283; xml: 183; awk: 66
file content (72 lines) | stat: -rwxr-xr-x 2,527 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/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

# ---------------------------------------------------------
# This is the test for the JIRA issue ECC-313.
# It tests decoding a BUFR file which uses the operator 203YYY.
# ---------------------------------------------------------
label="bufr_ecc-313_test"
tempRules=temp.${label}.filter
tempOut=temp.${label}.txt
tempRef=temp.${label}.ref

input=${data_dir}/bufr/israel_observations_2017041010.bufr

# Check we can dump
${tools_dir}/bufr_dump $input >/dev/null

# Check values which have their reference redefined
# These are the unexpandedDescriptors:
#   203014 7030 7031 203255 307080
# 7030 = heightOfStationGroundAboveMeanSeaLevel
# 7031 = heightOfBarometerAboveMeanSeaLevel
cat > $tempRules <<EOF
 set unpack=1;
 print "h1=[heightOfStationGroundAboveMeanSeaLevel]";
 print "h2=[heightOfBarometerAboveMeanSeaLevel]";
 print "rv=[inputOverriddenReferenceValues]";
 print "rf1=[#1#heightOfStationGroundAboveMeanSeaLevel->reference]";
EOF

${tools_dir}/codes_bufr_filter $tempRules $input > $tempOut

cat > $tempRef << EOF
h1=10 60 215 564 685 5 5 555 
375 170 279 355 110 31 -330 -200 
135 280 115 -120 22 300 -415 15 
265 25 370 335 180 405 140 -255 
5 80 5 245 475 65 770 830 
-135 820 810 770 75 365 -200 460 
490 495 -200 60 945 20 845 180 
95 400 275 350 115 30 100 330 
50 10 950 475 -185 -388 700 5 
145 10 -65 0 70 936 -200 175 
360 710
h2=11 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 
-1e+100 -1e+100 280 -1e+100 -1e+100 31 -1e+100 -1e+100 
-1e+100 -1e+100 -1e+100 -1e+100 22 -1e+100 -1e+100 -1e+100 
-1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 
-1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 
-1e+100 -1e+100 810 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 
-1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 
-1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 
-1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -387 -1e+100 -1e+100 
-1e+100 -1e+100 -1e+100 -1e+100 -1e+100 938 -1e+100 -1e+100 
-1e+100 -1e+100
rv=-5000 -5000
rf1=-5000
EOF
echo "Expected output:"
cat $tempRef
diff $tempRef $tempOut

rm -f $tempRules $tempRef $tempOut