1 #!/usr/bin/perl |
1 #!/usr/bin/perl |
2 #====================================================================== |
2 #====================================================================== |
3 # M K P R O F I L E |
3 # M K P R O F I L E |
4 # doc: Sun Jan 19 18:55:26 2003 |
4 # doc: Sun Jan 19 18:55:26 2003 |
5 # dlm: Sat May 24 22:50:02 2014 |
5 # dlm: Wed Nov 5 13:02:59 2014 |
6 # (c) 2003 A.M. Thurnherr |
6 # (c) 2003 A.M. Thurnherr |
7 # uE-Info: 797 76 NIL 0 0 72 10 2 4 NIL ofnI |
7 # uE-Info: 255 17 NIL 0 0 72 10 2 4 NIL ofnI |
8 #====================================================================== |
8 #====================================================================== |
9 |
9 |
10 # Make an LADCP Profile by Integrating W (similar to Firing's scan*). |
10 # Make an LADCP Profile by Integrating W (similar to Firing's scan*). |
11 |
11 |
12 # HISTORY: |
12 # HISTORY: |
249 #====================================================================== |
249 #====================================================================== |
250 |
250 |
251 ($firstgood,$lastgood,$atbottom,$w_gap_time,$zErr,$maxz,$rms_heave_accel) = |
251 ($firstgood,$lastgood,$atbottom,$w_gap_time,$zErr,$maxz,$rms_heave_accel) = |
252 mk_prof(\%dta,0,$opt_F,$minb,$maxb,$opt_c,$opt_e,$opt_g,$opt_p); |
252 mk_prof(\%dta,0,$opt_F,$minb,$maxb,$opt_c,$opt_e,$opt_g,$opt_p); |
253 |
253 |
254 unless (($atbottom > $firstgood) && ($lastgood > $atbottom)) { |
254 if ($lastgood == $atbottom) { |
|
255 print(STDERR "$ARGV[0]: truncated file (ends at max depth)\n") |
|
256 } elsif (($atbottom > $firstgood) && ($lastgood > $atbottom)) { |
|
257 # all good |
|
258 } else { |
255 if ($opt_Q) { |
259 if ($opt_Q) { |
256 print(STDERR "$ARGV[0]: no valid cast data found\n"); |
260 print(STDERR "$ARGV[0]: no valid cast data found\n"); |
257 exit(0); |
261 exit(0); |
258 } else { |
262 } else { |
259 die("$ARGV[0]: no valid cast data found\n"); |
263 die(sprintf("$ARGV[0]: no valid cast data found (firstgood=%d atbottom=%d lastgood=%d)\n",$firstgood,$atbottom,$lastgood)); |
260 } |
264 } |
261 } |
265 } |
262 |
266 |
263 if (defined($opt_B)) { # scale Z |
267 if (defined($opt_B)) { # scale Z |
264 my($zscale) = $opt_B / ($dta{ENSEMBLE}[$atbottom]->{DEPTH} -# downcast |
268 my($zscale) = $opt_B / ($dta{ENSEMBLE}[$atbottom]->{DEPTH} -# downcast |