author | Andreas Thurnherr <ant@ldeo.columbia.edu> |
Thu, 04 Mar 2021 08:38:53 -0500 | |
changeset 55 | 540d6574caca |
parent 43 | b63fa355644c |
child 61 | 69192495f0db |
permissions | -rwxr-xr-x |
14 | 1 |
#!/usr/bin/perl |
2 |
#====================================================================== |
|
3 |
# E D I T P D 0 |
|
4 |
# doc: Mon Nov 25 20:24:31 2013 |
|
43
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
5 |
# dlm: Wed Mar 14 21:15:51 2018 |
14 | 6 |
# (c) 2013 A.M. Thurnherr |
43
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
7 |
# uE-Info: 417 0 NIL 0 0 72 2 2 4 NIL ofnI |
14 | 8 |
#====================================================================== |
9 |
||
10 |
# edit RDI PD0 file, e.g. to replace pitch/roll/heading with external values |
|
11 |
||
31 | 12 |
# NOTES: |
13 |
# |
|
14 |
# - editing instructions can be provided either in an editing file (primarily |
|
15 |
# for ensemble-specific editing), or with the -x option on the command line |
|
16 |
# (only or editing applied to all ensembles) |
|
17 |
# |
|
18 |
# - Data-Editing Library: |
|
19 |
# p(<pitch>) set pitch value (RDI not gimbal pitch) of current ensemble |
|
20 |
# r(<roll>) set roll alue value of current ensemble |
|
21 |
# h(<heading>) set heading alue value of current ensemble |
|
22 |
# |
|
23 |
# swap_beams(<b1>,<b2>) swap data from beams b1 and b2 |
|
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
24 |
# - input in beam coords required |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
25 |
# - beam rotation is equivalent to 3 consecutive beam swaps |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
26 |
# - basic BT data are swapped as well (not RL and not SIGNAL_STRENGTH) |
31 | 27 |
# |
28 |
# earth2beam() transform beam to earth coordinates |
|
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
29 |
# - does not handle bin-remapping |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
30 |
# - input in earth coords required |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
31 |
# |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
32 |
# beam2earth() transform earth to beam coordinates |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
33 |
# - does not handle bin-remapping |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
34 |
# - input in beam coords required |
31 | 35 |
# |
34 | 36 |
# instrument2beam() transform instrument to earth coordinates |
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
37 |
# - does not handle bin-remapping |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
38 |
# - input in instrument coords required |
34 | 39 |
# |
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
40 |
# ensure_UL() correct data for wrong transducer orientation |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
41 |
# ensure_DL() - sets correct flag & negates roll value |
32 | 42 |
# |
40
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
43 |
# dealias(<WV lim[m/s]>) correct data for erroneously low WV setting |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
44 |
# - HEURISTIC, i.e. may not work |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
45 |
# |
31 | 46 |
# - -x notes: |
47 |
# - multiple perl expressions can be combined with , |
|
48 |
# |
|
49 |
# - Edit File Syntax: |
|
50 |
# - # comments ignored |
|
51 |
# - empty lines ignored |
|
52 |
# - [space] <ensemble-number|*> <space> <perl-expr> |
|
53 |
# - Examples: |
|
54 |
# 162 p(3), r(4), h(3.14) |
|
55 |
||
14 | 56 |
# HISTORY: |
31 | 57 |
# Nov 25, 2013: - created |
58 |
# Dec 18, 2015: - added switch_beams() |
|
59 |
# - added -x |
|
60 |
# Jan 9, 2016: - renamed switch_beams() to swap_beams() |
|
61 |
# - wrote documentation |
|
62 |
# - change output data-source ID from 0x7F to 0xE0 |
|
63 |
# - updated getopts to current perl version |
|
64 |
# - adapted to [ADCP_tools_lib.pl] |
|
32 | 65 |
# Feb 15, 2016: - added ensure_UL() ensure_DL() |
66 |
# Feb 23, 2016: - added -k |
|
67 |
# Feb 26, 2016: - added basic BT data to swap_beams() |
|
34 | 68 |
# - added earth2beam() |
69 |
# Apr 12, 2016: - added instrument2beam() |
|
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
70 |
# Jun 3, 2016: - added beam2earth() |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
71 |
# - BUG: instrument2earth() set wrong flag |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
72 |
# Jun 8, 2016: - adapted to new interface of velInstrumentToBeam() |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
73 |
# - added %-good to beam2earth and earth2beam |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
74 |
# - made single-ping ensemble requirement for most routines |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
75 |
# Jul 12, 2016: - updated ensure_{DL,UL} routines |
37 | 76 |
# Nov 15, 2016: - BUG: ensure_{DL,UL} routines did not negate heading data |
40
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
77 |
# Jul 27, 2017: - began working on dealias() |
41 | 78 |
# Dec 6, 2017: - cosmetics |
14 | 79 |
|
31 | 80 |
use Getopt::Std; |
81 |
||
82 |
($ADCP_TOOLS) = ($0 =~ m{(.*/)[^/]+}); |
|
42 | 83 |
$ADCP_tools_minVersion = 2.1; |
31 | 84 |
require "$ADCP_TOOLS/ADCP_tools_lib.pl"; |
14 | 85 |
|
86 |
$USAGE = "$0 @ARGV"; |
|
87 |
die("Usage: $0 " . |
|
31 | 88 |
'-e) <edit-file> | -x) <expr> ' . |
41 | 89 |
'[-k)eep original data-source id] ' . |
31 | 90 |
"<input file> <output file>\n") |
32 | 91 |
unless (&getopts('ke:x:') && @ARGV == 2); |
14 | 92 |
|
28 | 93 |
die("$0: -e <edit-file> or -x <expr> required\n") |
31 | 94 |
unless (defined($opt_x) || -r $opt_e); |
14 | 95 |
|
31 | 96 |
print(STDERR "Reading $ARGV[0]..."); # read data |
14 | 97 |
readData($ARGV[0],\%dta); |
37 | 98 |
printf(STDERR "done (%d complete ensembles)\n", |
99 |
scalar(@{$dta{ENSEMBLE}})); |
|
14 | 100 |
|
101 |
#---------------------------------------------------------------------- |
|
102 |
||
31 | 103 |
print(STDERR "Editing Data..."); |
14 | 104 |
|
105 |
#-------------------------------------------------- |
|
31 | 106 |
# Data Editing Library |
14 | 107 |
#-------------------------------------------------- |
108 |
||
40
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
109 |
#-------------------------------------------------- |
32 | 110 |
# override pitch/roll/heading |
40
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
111 |
#-------------------------------------------------- |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
112 |
|
31 | 113 |
sub p($) { $dta{ENSEMBLE}[$e]->{PITCH} = $_[0]; return 1; } |
114 |
sub r($) { $dta{ENSEMBLE}[$e]->{ROLL} = $_[0]; return 1; } |
|
115 |
sub h($) { $dta{ENSEMBLE}[$e]->{HEADING} = $_[0]; return 1;} |
|
14 | 116 |
|
40
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
117 |
#-------------------------------------------------- |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
118 |
# correct data for erroneously low WV limit |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
119 |
#-------------------------------------------------- |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
120 |
|
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
121 |
{ my(@target); # static scope, undef initially |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
122 |
|
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
123 |
sub dealias_V0($) |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
124 |
{ |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
125 |
my($WV) = @_; |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
126 |
|
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
127 |
if (@target) { # dealias everything but first ensemble |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
128 |
for (my($bin)=0; $bin<$dta{N_BINS}; $bin++) { |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
129 |
for (my($beam)=0; $beam<4; $beam++) { |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
130 |
next unless defined($dta{ENSEMBLE}[$e]->{VELOCITY}[$bin][$beam]); |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
131 |
my($dealiased) = 0; |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
132 |
$dealiased = ($dta{ENSEMBLE}[$e]->{VELOCITY}[$bin][$beam] - 2*$WV) |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
133 |
if ($dta{ENSEMBLE}[$e]->{VELOCITY}[$bin][$beam] > 0); |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
134 |
$dealiased = ($dta{ENSEMBLE}[$e]->{VELOCITY}[$bin][$beam] + 2*$WV) |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
135 |
if ($dta{ENSEMBLE}[$e]->{VELOCITY}[$bin][$beam] < 0); |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
136 |
if (abs($target[$beam]-$dta{ENSEMBLE}[$e]->{VELOCITY}[$bin][$beam]) > |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
137 |
abs($target[$beam]-$dealiased)) { |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
138 |
$dta{ENSEMBLE}[$e]->{VELOCITY}[$bin][$beam] = undef; #$dealiased; |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
139 |
$dealiased++; |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
140 |
} |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
141 |
} |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
142 |
} |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
143 |
} else { # @target is undef |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
144 |
$dealiased = 0; |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
145 |
} |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
146 |
|
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
147 |
@target = (0,0,0,0); # calc ref-lr average target for next ens |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
148 |
for (my($bin)=1; $bin<=5; $bin++) { # should work even if N_BINS < 5 |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
149 |
for (my($beam)=0; $beam<4; $beam++) { |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
150 |
$target[$beam] += $dta{ENSEMBLE}[$e]->{VELOCITY}[$bin][$beam]/4 |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
151 |
if defined($dta{ENSEMBLE}[$e]->{VELOCITY}[$bin][$beam]); |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
152 |
} |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
153 |
} |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
154 |
|
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
155 |
return 1; |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
156 |
} |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
157 |
|
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
158 |
} # static scope |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
159 |
|
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
160 |
#-------------------------------------------------- |
32 | 161 |
# override transducer orientation |
162 |
# |
|
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
163 |
# These routines are intended to correct ADCP data for |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
164 |
# erroneous orientation switch readings, primarily because |
37 | 165 |
# of a stuck switch. |
166 |
# Roll: Based on text from the coord trans manual, |
|
167 |
# it seems likely that the roll data need to |
|
168 |
# be negated. In case of 2007(?) CLIVAR I08S |
|
169 |
# profile #1 w gets much better with negated |
|
170 |
# roll. Also, in 2016 CLIVAR P18 profile 003 |
|
171 |
# the instrument-offset calculation from |
|
172 |
# compass and pitch/roll only agree with the |
|
173 |
# roll negated. |
|
174 |
# Hdg: Based on the time-series of headings recorded |
|
175 |
# during P18 profile 003 the heading needs |
|
176 |
# to be negated. Doing so yields a good profile. |
|
40
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
177 |
#-------------------------------------------------- |
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
178 |
|
32 | 179 |
sub ensure_DL() |
180 |
{ |
|
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
181 |
if ($dta{ENSEMBLE}[$e]->{XDUCER_FACING_UP}) { |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
182 |
$dta{ENSEMBLE}[$e]->{ROLL} *= -1; |
37 | 183 |
$dta{ENSEMBLE}[$e]->{HEADING} *= -1; |
184 |
$dta{ENSEMBLE}[$e]->{HEADING} += 360 |
|
185 |
if ($dta{ENSEMBLE}[$e]->{HEADING} < 0); |
|
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
186 |
$dta{ENSEMBLE}[$e]->{XDUCER_FACING_DOWN} = 1; |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
187 |
$dta{ENSEMBLE}[$e]->{XDUCER_FACING_UP} = undef; |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
188 |
} |
32 | 189 |
return 1; |
190 |
} |
|
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
191 |
|
32 | 192 |
sub ensure_UL() |
193 |
{ |
|
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
194 |
if ($dta{ENSEMBLE}[$e]->{XDUCER_FACING_DOWN}) { |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
195 |
$dta{ENSEMBLE}[$e]->{ROLL} *= -1; |
37 | 196 |
$dta{ENSEMBLE}[$e]->{HEADING} *= -1; |
197 |
$dta{ENSEMBLE}[$e]->{HEADING} += 360 |
|
198 |
if ($dta{ENSEMBLE}[$e]->{HEADING} < 0); |
|
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
199 |
$dta{ENSEMBLE}[$e]->{XDUCER_FACING_UP} = 1; |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
200 |
$dta{ENSEMBLE}[$e]->{XDUCER_FACING_DOWN} = undef; |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
201 |
} |
32 | 202 |
return 1; |
203 |
} |
|
204 |
||
40
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
205 |
#-------------------------------------------------- |
32 | 206 |
# swap data from two mis-connected beams |
40
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
207 |
#-------------------------------------------------- |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
208 |
|
31 | 209 |
sub swap_beams($$) |
28 | 210 |
{ |
211 |
my($b1,$b2) = @_; |
|
32 | 212 |
my($tmp); |
28 | 213 |
|
31 | 214 |
# print(STDERR "\n entering swap_beams($b1,$b2) for ens = $e..."); |
215 |
||
216 |
die("$ARGV[0]: beam-coordinate data required\n") |
|
217 |
unless ($dta{BEAM_COORDINATES}); |
|
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
218 |
die("$ARGV[0]: single-ping ensembles required\n") |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
219 |
unless ($dta{PINGS_PER_ENSEMBLE} == 1); |
28 | 220 |
|
32 | 221 |
if ($dta{BT_PRESENT}) { |
222 |
$tmp = $dta{ENSEMBLE}[$e]->{BT_RANGE}[$b1-1]; |
|
223 |
$dta{ENSEMBLE}[$e]->{BT_RANGE}[$b1-1] = $dta{ENSEMBLE}[$e]->{BT_RANGE}[$b2-1]; |
|
224 |
$dta{ENSEMBLE}[$e]->{BT_RANGE}[$b2-1] = $tmp; |
|
225 |
||
226 |
$tmp = $dta{ENSEMBLE}[$e]->{BT_VELOCITY}[$b1-1]; |
|
227 |
$dta{ENSEMBLE}[$e]->{BT_VELOCITY}[$b1-1] = $dta{ENSEMBLE}[$e]->{BT_VELOCITY}[$b2-1]; |
|
228 |
$dta{ENSEMBLE}[$e]->{BT_VELOCITY}[$b2-1] = $tmp; |
|
229 |
||
230 |
$tmp = $dta{ENSEMBLE}[$e]->{BT_CORRELATION}[$b1-1]; |
|
231 |
$dta{ENSEMBLE}[$e]->{BT_CORRELATION}[$b1-1] = $dta{ENSEMBLE}[$e]->{BT_CORRELATION}[$b2-1]; |
|
232 |
$dta{ENSEMBLE}[$e]->{BT_CORRELATION}[$b2-1] = $tmp; |
|
233 |
||
234 |
$tmp = $dta{ENSEMBLE}[$e]->{BT_EVAL_AMPLITUDE}[$b1-1]; |
|
235 |
$dta{ENSEMBLE}[$e]->{BT_EVAL_AMPLITUDE}[$b1-1] = $dta{ENSEMBLE}[$e]->{BT_EVAL_AMPLITUDE}[$b2-1]; |
|
236 |
$dta{ENSEMBLE}[$e]->{BT_EVAL_AMPLITUDE}[$b2-1] = $tmp; |
|
237 |
||
238 |
$tmp = $dta{ENSEMBLE}[$e]->{BT_PERCENT_GOOD}[$b1-1]; |
|
239 |
$dta{ENSEMBLE}[$e]->{BT_PERCENT_GOOD}[$b1-1] = $dta{ENSEMBLE}[$e]->{BT_PERCENT_GOOD}[$b2-1]; |
|
240 |
$dta{ENSEMBLE}[$e]->{BT_PERCENT_GOOD}[$b2-1] = $tmp; |
|
241 |
} |
|
242 |
||
28 | 243 |
for (my($bin)=0; $bin<$dta{N_BINS}; $bin++) { |
32 | 244 |
$tmp = $dta{ENSEMBLE}[$e]->{VELOCITY}[$bin][$b1-1]; |
28 | 245 |
$dta{ENSEMBLE}[$e]->{VELOCITY}[$bin][$b1-1] = $dta{ENSEMBLE}[$e]->{VELOCITY}[$bin][$b2-1]; |
246 |
$dta{ENSEMBLE}[$e]->{VELOCITY}[$bin][$b2-1] = $tmp; |
|
247 |
||
248 |
$tmp = $dta{ENSEMBLE}[$e]->{CORRELATION}[$bin][$b1-1]; |
|
249 |
$dta{ENSEMBLE}[$e]->{CORRELATION}[$bin][$b1-1] = $dta{ENSEMBLE}[$e]->{CORRELATION}[$bin][$b2-1]; |
|
250 |
$dta{ENSEMBLE}[$e]->{CORRELATION}[$bin][$b2-1] = $tmp; |
|
251 |
||
252 |
$tmp = $dta{ENSEMBLE}[$e]->{ECHO_AMPLITUDE}[$bin][$b1-1]; |
|
253 |
$dta{ENSEMBLE}[$e]->{ECHO_AMPLITUDE}[$bin][$b1-1] = $dta{ENSEMBLE}[$e]->{ECHO_AMPLITUDE}[$bin][$b2-1]; |
|
254 |
$dta{ENSEMBLE}[$e]->{ECHO_AMPLITUDE}[$bin][$b2-1] = $tmp; |
|
255 |
||
256 |
$tmp = $dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$bin][$b1-1]; |
|
257 |
$dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$bin][$b1-1] = $dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$bin][$b2-1]; |
|
258 |
$dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$bin][$b2-1] = $tmp; |
|
259 |
} |
|
31 | 260 |
return 1; |
261 |
} |
|
28 | 262 |
|
31 | 263 |
|
40
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
264 |
#-------------------------------------------------- |
32 | 265 |
# transform earth to beam coordinates |
40
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
266 |
#-------------------------------------------------- |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
267 |
|
31 | 268 |
{ my($checked); |
269 |
||
270 |
sub earth2beam() |
|
271 |
{ |
|
272 |
unless ($checked) { |
|
273 |
die("$ARGV[0]: earth-coordinate data required\n") |
|
274 |
unless ($dta{EARTH_COORDINATES}); |
|
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
275 |
die("$ARGV[0]: single-ping ensembles required\n") |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
276 |
unless ($dta{PINGS_PER_ENSEMBLE} == 1); |
31 | 277 |
$dta{BEAM_COORDINATES} = 1; undef($dta{EARTH_COORDINATES}); |
278 |
$checked = 1; |
|
279 |
} |
|
280 |
||
281 |
for (my($bin)=0; $bin<$dta{N_BINS}; $bin++) { |
|
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
282 |
if ($dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$bin][3] == 100) { # 4-beam solution |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
283 |
@{$dta{ENSEMBLE}[$e]->{VELOCITY}[$bin]} = |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
284 |
velEarthToBeam(\%dta,$e,@{$dta{ENSEMBLE}[$e]->{VELOCITY}[$bin]}); |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
285 |
@{$dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$bin]} = (100,100,100,100); |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
286 |
} else { # 3-beam solution or no solution |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
287 |
undef(@{$dta{ENSEMBLE}[$e]->{VELOCITY}[$bin]}); |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
288 |
@{$dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$bin]} = (0,0,0,0); |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
289 |
} |
31 | 290 |
} |
291 |
||
292 |
return 1; |
|
293 |
} |
|
294 |
||
28 | 295 |
} |
296 |
||
40
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
297 |
#-------------------------------------------------- |
34 | 298 |
# transform instrument to beam coordinates |
40
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
299 |
#-------------------------------------------------- |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
300 |
|
34 | 301 |
{ my($checked); |
302 |
||
303 |
sub instrument2beam() |
|
304 |
{ |
|
305 |
unless ($checked) { |
|
306 |
die("$ARGV[0]: instrument-coordinate data required\n") |
|
307 |
unless ($dta{INSTRUMENT_COORDINATES}); |
|
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
308 |
die("$ARGV[0]: single-ping ensembles required\n") |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
309 |
unless ($dta{PINGS_PER_ENSEMBLE} == 1); |
34 | 310 |
$dta{BEAM_COORDINATES} = 1; undef($dta{INSTRUMENT_COORDINATES}); |
311 |
$checked = 1; |
|
312 |
} |
|
313 |
||
314 |
for (my($bin)=0; $bin<$dta{N_BINS}; $bin++) { |
|
315 |
@{$dta{ENSEMBLE}[$e]->{VELOCITY}[$bin]} = |
|
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
316 |
velInstrumentToBeam(\%dta,$e,@{$dta{ENSEMBLE}[$e]->{VELOCITY}[$bin]}); |
34 | 317 |
} |
318 |
||
319 |
return 1; |
|
320 |
} |
|
321 |
||
322 |
} |
|
323 |
||
40
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
324 |
#-------------------------------------------------- |
34 | 325 |
# transform instrument to earth coordinates |
40
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
326 |
#-------------------------------------------------- |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
327 |
|
34 | 328 |
{ my($checked); |
329 |
||
330 |
sub instrument2earth() |
|
331 |
{ |
|
332 |
unless ($checked) { |
|
333 |
die("$ARGV[0]: instrument-coordinate data required\n") |
|
334 |
unless ($dta{INSTRUMENT_COORDINATES}); |
|
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
335 |
die("$ARGV[0]: single-ping ensembles required\n") |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
336 |
unless ($dta{PINGS_PER_ENSEMBLE} == 1); |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
337 |
$dta{EARTH_COORDINATES} = 1; undef($dta{INSTRUMENT_COORDINATES}); |
34 | 338 |
$checked = 1; |
339 |
} |
|
340 |
||
341 |
for (my($bin)=0; $bin<$dta{N_BINS}; $bin++) { |
|
342 |
@{$dta{ENSEMBLE}[$e]->{VELOCITY}[$bin]} = |
|
343 |
velInstrumentToEarth(\%dta,$e,@{$dta{ENSEMBLE}[$e]->{VELOCITY}[$bin]}); |
|
344 |
} |
|
345 |
||
346 |
return 1; |
|
347 |
} |
|
348 |
||
349 |
} |
|
350 |
||
40
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
351 |
#-------------------------------------------------- |
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
352 |
# transform beam to earth coordinates |
40
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
353 |
#-------------------------------------------------- |
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
354 |
|
36
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
355 |
{ my($checked); |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
356 |
|
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
357 |
sub beam2earth() |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
358 |
{ |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
359 |
unless ($checked) { |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
360 |
die("$ARGV[0]: beam-coordinate data required\n") |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
361 |
unless ($dta{BEAM_COORDINATES}); |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
362 |
die("$ARGV[0]: single-ping ensembles required\n") |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
363 |
unless ($dta{PINGS_PER_ENSEMBLE} == 1); |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
364 |
$dta{EARTH_COORDINATES} = 1; undef($dta{BEAM_COORDINATES}); |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
365 |
$checked = 1; |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
366 |
} |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
367 |
|
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
368 |
for (my($bin)=0; $bin<$dta{N_BINS}; $bin++) { |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
369 |
@{$dta{ENSEMBLE}[$e]->{VELOCITY}[$bin]} = |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
370 |
velBeamToEarth(\%dta,$e,@{$dta{ENSEMBLE}[$e]->{VELOCITY}[$bin]}); |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
371 |
$dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$bin][0] = 100*$RDI_Coords::threeBeamFlag; # 3-beam solution |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
372 |
$dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$bin][1] = 0; # error velocity not checked |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
373 |
$dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$bin][2] = # no solution -> more than 1 bad beam |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
374 |
@{$dta{ENSEMBLE}[$e]->{VELOCITY}[$bin]} ? 0 : 100; |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
375 |
$dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$bin][2] = # 4-beam solution |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
376 |
100 - $dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$bin][0]; |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
377 |
} |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
378 |
|
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
379 |
return 1; |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
380 |
} |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
381 |
|
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
382 |
} |
515b06dae59c
version at end of ECOGIG EN586 cruise
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
34
diff
changeset
|
383 |
|
14 | 384 |
#-------------------------------------------------- |
385 |
# Main Routine |
|
386 |
#-------------------------------------------------- |
|
387 |
||
31 | 388 |
if (defined($opt_x)) { # edit instructions on the command line |
28 | 389 |
push(@EE,'*'); |
390 |
my($id) = ($opt_x =~ m/^([A-Z]+)\s/); # e.g. PITCH, ROLL, HEADING |
|
391 |
$opt_x = sprintf('$dta{ENSEMBLE}[$e]->{%s}',$id) |
|
14 | 392 |
if defined($id); |
28 | 393 |
push(@EX,$opt_x); |
394 |
} |
|
14 | 395 |
|
31 | 396 |
if (defined($opt_e)) { # edit instructions in edit file |
28 | 397 |
open(EF,$opt_e) || die("$opt_e: $!\n"); |
398 |
while (<EF>) { |
|
399 |
s/\#.*//; |
|
400 |
next if m/^\s+$/; |
|
401 |
my($ens,$expr) = m/^\s*(\*|\d+)\s+(.*)$/; |
|
402 |
||
40
6a46e9d31106
after Hamburg visit
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
37
diff
changeset
|
403 |
my($id) = ($expr =~ m/^([A-Z]+)\s/); # e.g. PITCH, ROLL, HEADING |
28 | 404 |
$expr = sprintf('$dta{ENSEMBLE}[$e]->{%s}',$id) |
405 |
if defined($id); |
|
406 |
||
407 |
push(@EE,$ens); |
|
408 |
push(@EX,$expr); |
|
409 |
} |
|
410 |
close(EF); |
|
411 |
} |
|
412 |
||
413 |
for (local($e)=my($eei)=0; $e<@{$dta{ENSEMBLE}}; $e++) { # local() needed for p(), r(), h() |
|
32 | 414 |
$dta{ENSEMBLE}[$e]->{DATA_SOURCE_ID} = 0xE0 # mark all ensembles except first |
415 |
unless ($opt_k || $e==0); |
|
28 | 416 |
if ($EE[$eei] eq '*' || $EE[$eei] == $dta{ENSEMBLE}[$e]->{NUMBER}) { # match => edit |
14 | 417 |
eval($EX[$eei]) || die("$@ while executing <$EX[$eei]>\n"); |
28 | 418 |
} elsif ($EE[$eei] > $dta{ENSEMBLE}[$e]->{NUMBER}) { # next edit later in file => skip |
14 | 419 |
next; |
28 | 420 |
} else { # need next edit |
14 | 421 |
$eei++; |
422 |
last if ($eei >= @EE); |
|
423 |
redo; |
|
424 |
} |
|
425 |
} |
|
426 |
||
427 |
print(STDERR "done\n"); |
|
428 |
||
429 |
#---------------------------------------------------------------------- |
|
430 |
||
431 |
print(STDERR "Writing $ARGV[1]..."); # write data |
|
432 |
writeData($ARGV[1],\%dta); |
|
433 |
print(STDERR "done\n"); |
|
434 |
||
435 |
exit(0); |