1 #!/usr/bin/perl |
1 #!/usr/bin/perl |
2 #====================================================================== |
2 #====================================================================== |
3 # C H E C K I X |
3 # C H E C K I X |
4 # doc: Wed Dec 12 15:58:56 2012 |
4 # doc: Wed Dec 12 15:58:56 2012 |
5 # dlm: Wed Dec 12 16:27:11 2012 |
5 # dlm: Mon Apr 22 15:17:17 2013 |
6 # (c) 2012 A.M. Thurnherr |
6 # (c) 2012 A.M. Thurnherr |
7 # uE-Info: 31 0 NIL 0 0 72 2 2 4 NIL ofnI |
7 # uE-Info: 43 0 NIL 0 0 72 2 2 4 NIL ofnI |
8 #====================================================================== |
8 #====================================================================== |
9 |
9 |
10 # HISTORY: |
10 # HISTORY: |
11 # Dec 12, 2012: - created |
11 # Dec 12, 2012: - created |
12 |
12 |
13 die("Usage: $0 <stn>\n") |
13 die("Usage: $0 <count-spec[ ...]>\n") |
14 unless (@ARGV == 1); |
14 unless (@ARGV > 0); |
15 |
15 |
16 $id = $ARGV[0]; # determine station id |
16 foreach my $id (`count @ARGV`) { |
17 $id = sprintf('%03d',$id) |
|
18 unless (-f "$id.lad"); |
|
19 |
17 |
20 die("file <$id.lad> missing\n") # ensure required output is here |
18 $id = sprintf('%03d',$id) |
21 unless (-f "$id.lad"); |
19 unless (-f "$id.log"); |
22 die("file <$id.log> missing\n") |
20 |
23 unless (-f "$id.log"); |
21 unless (-f "$id.log") { |
24 die("file <$id.mat> missing\n") |
22 print(STDERR "$id: missing station\n"); |
25 unless (-f "$id.mat"); |
23 next; |
26 die("file <$id.txt> missing\n") |
24 } |
27 unless (-f "$id.txt"); |
|
28 |
25 |
29 if (-f "${id}_11.ps" && # handle warnings figure |
26 die("$id: file <$id.lad> missing\n") # ensure required output is here |
30 length(`grep 'LADCP profile OK' ${id}_11.ps`) == 0) { |
27 unless (-f "$id.lad"); |
31 print("warnings produced\n"); |
28 die("$id: file <$id.log> missing\n") |
32 system("gv ${id}_11.ps &"); |
29 unless (-f "$id.log"); |
|
30 die("$id: file <$id.mat> missing\n") |
|
31 unless (-f "$id.mat"); |
|
32 die("$id: file <$id.txt> missing\n") |
|
33 unless (-f "$id.txt"); |
|
34 |
|
35 if (-f "${id}_11.ps" && # handle warnings figure |
|
36 length(`grep 'LADCP profile OK' ${id}_11.ps`) == 0) { |
|
37 print("$id: warnings produced\n"); |
|
38 system("gv ${id}_11.ps &"); |
|
39 } |
|
40 |
|
41 print("$id: no valid BT data\n") # check validity of ancillary data |
|
42 unless (-f "$id.bot"); |
|
43 print("$id: no valid SADCP data\n") |
|
44 unless (length(`grep 'all SADCP values removed' $id.log`) == 0); |
|
45 |
33 } |
46 } |
34 |
47 |
35 print("no valid BT data\n") # check validity of ancillary data |
48 exit(0); |
36 unless (-f "$id.bot"); |
|
37 print("no valid SADCP data\n") |
|
38 unless (length(`grep 'all SADCP values removed' $id.log`) == 0); |
|