author | A.M. Thurnherr <athurnherr@yahoo.com> |
Fri, 18 Nov 2022 12:53:19 -0500 | |
changeset 61 | 69192495f0db |
parent 52 | 5b07a9b89aee |
permissions | -rwxr-xr-x |
40 | 1 |
#!/usr/bin/perl |
2 |
#====================================================================== |
|
3 |
# P A T C H P D 0 |
|
4 |
# doc: Tue Aug 23 20:00:15 2016 |
|
61 | 5 |
# dlm: Mon Jul 12 20:43:08 2021 |
40 | 6 |
# (c) 2010 A.M. Thurnherr |
61 | 7 |
# uE-Info: 24 37 NIL 0 0 72 2 2 4 NIL ofnI |
40 | 8 |
#====================================================================== |
9 |
||
10 |
$antsSummary = 'patch TRDI PD0 file with external attitude data'; |
|
11 |
||
61 | 12 |
# HISTORY: |
40 | 13 |
# Aug 23, 2016: - exported from IMP+LADCP |
14 |
# Aug 25, 2016: - completed basic structure |
|
15 |
# Nov 20, 2017: - major code cleanup |
|
16 |
# - added -d) to keep original data source id |
|
42 | 17 |
# Dec 9, 2017: - added $antsSuppressCommonOptions = 1; |
18 |
# Dec 23, 2017: - added support for -c |
|
19 |
# - BUG: not backward compatible with old IMP files any more |
|
43
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
20 |
# Jun 13, 2017: - added pitch and roll to -o |
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
21 |
# - BUG: ??? does -o handle pitch and roll ANOMALIES correctly? |
50 | 22 |
# Jun 30, 2019: - -o did not work with single argument |
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
23 |
# Apr 14, 2020: - adapted to use for moored ADCP data as well |
61 | 24 |
# Jul 12, 2021: - beautified output |
40 | 25 |
|
26 |
# PATCH-FILE REQUIREMENTS (ANTS format) |
|
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
27 |
# - %[L]ADCP_pitch.mu %[L]ADCP_roll.mu mean ADCP pitch and roll |
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
28 |
# - %IM[UP]_hdg_offset heading offset of external IMU |
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
29 |
# - [L]ADCP_ens ADCP ensemble number |
40 | 30 |
# - pitch, roll external pitch/roll *anomalies* |
31 |
# - hdg external heading rotated into ADCP coord system |
|
32 |
||
33 |
# PATCHED PD0 FILE: |
|
34 |
# |
|
35 |
# - pitch = RDI_pitch(mean_LADCP_gimbal_pitch + rotated_external_pitch_anomaly) |
|
36 |
# - roll = mean_LADCP_roll + rotated_external_roll_anomaly |
|
37 |
# - hdg = external_hdg - heading_offset |
|
38 |
# |
|
39 |
# - unless -d is used, every patched ensemble has set the DATA_SOURCE_ID as follows; |
|
40 |
# PROCESSING SOFTWARE NEEDS TO BE ABLE TO DEAL WITH DSID values != 0x7F |
|
41 |
# 0xA0 no values patched |
|
42 |
# 0xA1 heading patched |
|
43 |
# 0xA2 roll patched |
|
44 |
# 0xA3 roll & heading patched |
|
45 |
# 0xA4 pitch patched |
|
46 |
# 0xA5 pitch & heading patched |
|
47 |
# 0xA6 pitch & roll patched |
|
48 |
# 0xA7 pitch, roll & heading patched |
|
49 |
# |
|
50 |
# - additionally, all velocities from ensembles with missing pitch/roll/heading |
|
51 |
# values are removed unless -k is set |
|
52 |
||
53 |
($ANTS) = (`which ANTSlib` =~ m{^(.*)/[^/]*$}); |
|
54 |
($ADCP_TOOLS) = ($0 =~ m{^(.*)/[^/]*$}); |
|
55 |
||
42 | 56 |
$antsMinLibVersion = 7.0; |
57 |
$ADCP_tools_minVersion = 2.1; |
|
40 | 58 |
|
59 |
require "$ANTS/ants.pl"; |
|
60 |
require "$ANTS/libvec.pl"; |
|
61 |
require "$ANTS/libstats.pl"; |
|
62 |
require "$ADCP_TOOLS/ADCP_tools_lib.pl"; |
|
63 |
||
64 |
$antsParseHeader = 0; |
|
42 | 65 |
$antsSuppressCommonOptions = 1; |
66 |
&antsUsage('cdhko:pr',2, |
|
40 | 67 |
'[patch -p)itch] [-r)oll] [-h)eading] (none patches all)', |
43
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
68 |
'[patch -c)lock with pre-Y2K RTC values]', |
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
69 |
'[-o) <[pitch,roll,]heading-offset>] [-k)eep velocities of unpatched ensembles]', |
40 | 70 |
'[keep original -d)ata-source id]', |
71 |
'<original PD0 file> <patched PD0 file> [external attitude file]'); |
|
72 |
||
73 |
$opt_p = $opt_r = $opt_h = 1 |
|
74 |
unless ($opt_p || $opt_r || $opt_h); |
|
75 |
||
42 | 76 |
$RDI_PD0_IO::OVERRIDE_Y2K_CLOCK = $opt_c; |
77 |
||
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
78 |
$ADCP_file = &antsFileArg(); |
40 | 79 |
$outPD0 = $ARGV[0]; shift; |
80 |
||
81 |
#---------------------------------------------------------------------- |
|
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
82 |
# Step 1: Read ADCP Data |
40 | 83 |
#---------------------------------------------------------------------- |
84 |
||
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
85 |
readData($ADCP_file,\%ADCP); # TRDI PD0 file |
40 | 86 |
|
87 |
#---------------------------------------------------------------------- |
|
88 |
# Step 2: Process External Attidue Input to Patch PD0 file |
|
89 |
#---------------------------------------------------------------------- |
|
90 |
||
43
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
91 |
&antsIn(); # load first IMP record |
40 | 92 |
|
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
93 |
my($ensF) = &fnrNoErr('ADCP_ens'); |
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
94 |
$ensF = &fnr('LADCP_ens') unless defined($ensF); |
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
95 |
|
40 | 96 |
my($pitchF) = &fnr('pitch'); |
97 |
my($rollF) = &fnr('roll'); |
|
98 |
my($hdgF) = &fnr('hdg'); |
|
99 |
||
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
100 |
my($ADCP_pitch_mean) = $P{'ADCP_pitch.mu'}; |
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
101 |
$ADCP_pitch_mean = &antsRequireParam('LADCP_pitch.mu') |
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
102 |
unless numberp($ADCP_pitch_mean); |
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
103 |
|
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
104 |
my($ADCP_roll_mean) = $P{'ADCP_roll.mu'}; |
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
105 |
$ADCP_roll_mean = &antsRequireParam('LADCP_roll.mu') |
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
106 |
unless numberp($ADCP_roll_mean); |
43
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
107 |
|
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
108 |
my($pofs,$rofs) = (0,0); # apply externally supplied offset(s) |
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
109 |
my($rho,$crho,$srho); |
40 | 110 |
if (defined($opt_o)) { |
43
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
111 |
my($pofs,$rofs,$hofs) = split(/,/,$opt_o); |
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
112 |
|
50 | 113 |
if (defined($rofs)) { # pitch and roll offsets supplied |
43
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
114 |
croak("$0: cannot decode -o $opt_o\n") |
50 | 115 |
unless numbersp($pofs,$rofs,$hofs); |
43
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
116 |
} else { # no pitch and roll, only heading |
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
117 |
$hofs = $pofs; |
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
118 |
$pofs = undef; |
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
119 |
} |
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
120 |
croak("$0: cannot decode -o $opt_o\n") |
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
121 |
unless numberp($hofs); |
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
122 |
# set up heading correction |
42 | 123 |
&antsAddParams('IMU_hdg_offset',$P{IMP_hdg_offset}) # backward compatibility |
124 |
if defined($P{IMP_hdg_offset}); |
|
43
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
125 |
$rho = $hofs - &antsRequireParam('IMU_hdg_offset'); # calculate correction relative to already applied one |
40 | 126 |
$crho = cos(rad($rho)); |
127 |
$srho = sin(rad($rho)); |
|
43
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
128 |
|
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
129 |
if (defined($pofs)) { # rotate IMP pitch and roll offsets into new ADCP frame |
43
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
130 |
my($IMP_pitch_mean) = &antsRequireParam('IMP_pitch.mu') * $crho |
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
131 |
+ &antsRequireParam('IMP_roll.mu') * $srho; |
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
132 |
my($IMP_roll_mean) = -&antsRequireParam('IMP_pitch.mu') * $srho |
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
133 |
+ &antsRequireParam('IMP_roll.mu') * $crho; |
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
134 |
$ADCP_pitch_mean = $IMP_pitch_mean - $pofs; # apply externally supplied offsets |
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
135 |
$ADCP_roll_mean = $IMP_roll_mean - $rofs; |
43
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
136 |
} |
40 | 137 |
} |
138 |
||
50 | 139 |
my($pr_missing,$hdg_missing) = (0,0); |
140 |
my($missing_pr_block_len,$missing_hdg_block_len); |
|
141 |
||
40 | 142 |
do { |
50 | 143 |
my($ADCP_deployed); |
40 | 144 |
my($ens) = $P{RECNO}; |
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
145 |
die("assertion failed [$ants_[0][$ensF] != $ADCP{ENSEMBLE}[$ens]->{NUMBER} --- 1-$ADCP{ENSEMBLE}[0]->{NUMBER} + $P{RECNO} + $d]") |
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
146 |
unless ($ants_[0][$ensF] == $ADCP{ENSEMBLE}[$ens]->{NUMBER}); |
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
147 |
$ADCP{ENSEMBLE}[$ens]->{DATA_SOURCE_ID} = 0xA0; |
40 | 148 |
|
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
149 |
if (numbersp($ants_[0][$pitchF],$ants_[0][$rollF])) { # valid IMP data -> patch ADCP ensemble |
50 | 150 |
$ADCP_deployed = 1; |
151 |
$missing_pr_block_len = 0; |
|
43
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
152 |
if (defined($opt_o)) { # -o set: rotate pitch and roll into correct coordinates |
40 | 153 |
my($rot_p) = ($ants_[$r][$pitchF] * $crho + |
154 |
$ants_[$r][$rollF] * $srho); |
|
155 |
my($rot_r) = (-$ants_[$r][$pitchF] * $srho + |
|
156 |
$ants_[$r][$rollF] * $crho); |
|
157 |
$ants_[$r][$pitchF] = $rot_p; |
|
158 |
$ants_[$r][$rollF] = $rot_r; |
|
159 |
} |
|
43
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
160 |
if ($opt_p) { # patch pitch |
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
161 |
$ADCP{ENSEMBLE}[$ens]->{DATA_SOURCE_ID} |= ($opt_p<<2); |
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
162 |
$ADCP{ENSEMBLE}[$ens]->{PITCH} = RDI_pitch($ADCP_pitch_mean + $ants_[0][$pitchF], |
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
163 |
$ADCP_roll_mean + $ants_[0][$rollF]); |
40 | 164 |
} |
43
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
165 |
if ($opt_r) { # patch roll |
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
166 |
$ADCP{ENSEMBLE}[$ens]->{DATA_SOURCE_ID} |= ($opt_r<<1); |
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
167 |
$ADCP{ENSEMBLE}[$ens]->{ROLL} = $ADCP_roll_mean + $ants_[0][$rollF]; |
40 | 168 |
} |
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
169 |
} else { # no valid IMP pitch and roll => invalidate ADCP data |
50 | 170 |
$pr_missing++ if $ADCP_deployed; # don't count missing before deployment |
171 |
$missing_pr_block_len++; |
|
40 | 172 |
unless ($opt_k) { |
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
173 |
clearEns(\%ADCP,$ens); |
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
174 |
$ADCP{ENSEMBLE}[$ens]->{DATA_SOURCE_ID}= 0xA0; |
40 | 175 |
} |
176 |
} |
|
177 |
||
43
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
178 |
if (numberp($ants_[0][$hdgF])) { # valid IMP heading |
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
179 |
$ADCP{ENSEMBLE}[$ens]->{DATA_SOURCE_ID} |= $opt_h; |
50 | 180 |
$missing_hdg_block_len = 0; |
43
b63fa355644c
commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
42
diff
changeset
|
181 |
if (defined($opt_o)) { # apply offset on -o; otherwise, data are correctly rotated |
40 | 182 |
$ants_[0][$hdgF] -= $rho; |
183 |
$ants_[0][$hdgF] += 360 if ($ants_[0][$hdgF] < 0); |
|
184 |
} |
|
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
185 |
$ADCP{ENSEMBLE}[$ens]->{HEADING} = $ants_[0][$hdgF] # patch heading |
40 | 186 |
if $opt_h; |
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
187 |
} else { # no valid IMP heading => invalidate ADCP data |
50 | 188 |
$hdg_missing++ if $ADCP_deployed; |
189 |
$missing_hdg_block_len++; |
|
40 | 190 |
unless ($opt_k) { |
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
191 |
clearEns(\%ADCP,$ens); |
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
192 |
$ADCP{ENSEMBLE}[$ens]->{DATA_SOURCE_ID}= 0xA0; |
40 | 193 |
} |
194 |
} |
|
195 |
} while (&antsIn()); |
|
50 | 196 |
$pr_missing -= missing_pr_block_len; # don't count final block (post recovery) |
197 |
$hdg_missing -= missing_hdg_block_len; |
|
40 | 198 |
|
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
199 |
$ADCP{ENSEMBLE}[0]->{DATA_SOURCE_ID} = 0x7F; # ensure correct DSID (1st ens: orig; 2nd ens: this prog) |
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
200 |
$ADCP{ENSEMBLE}[1]->{DATA_SOURCE_ID} = 0xA0 |
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
201 |
unless ($ADCP{ENSEMBLE}[1]->{DATA_SOURCE_ID}&0xF0 == 0xA0); |
40 | 202 |
|
52
5b07a9b89aee
- adapted to work with IMPed moored ADCP data
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents:
50
diff
changeset
|
203 |
writeData($outPD0,\%ADCP); # write new PD0 |
40 | 204 |
|
61 | 205 |
if ($pr_missing+$hdg_missing) { |
206 |
my($verb) = $opt_k ? 'retained' : 'cleared'; |
|
207 |
printf(STDERR "$outPD0: "); |
|
208 |
if ($pr_missing) { |
|
209 |
printf(STDERR "%d pitch/roll ",$pr_missing); |
|
210 |
printf(STDERR "and ") if ($hdg_missing); |
|
211 |
} |
|
212 |
printf(STDERR "%d heading ",$hdg_missing) if ($hdg_missing); |
|
213 |
printf(STDERR "values $verb\n"); |
|
214 |
} |
|
40 | 215 |
|
216 |
exit(0); |
|
217 |