1 #====================================================================== |
1 #====================================================================== |
2 # / D A T A / S R C / O C E A N O G R A P H Y / L A D C P _ V E R T I C A L _ V E L O C I T Y / E D I T _ D A T A . P L |
2 # E D I T _ D A T A . P L |
3 # doc: Sat May 22 21:35:55 2010 |
3 # doc: Sat May 22 21:35:55 2010 |
4 # dlm: Tue Nov 27 11:07:33 2018 |
4 # dlm: Tue Mar 23 05:29:53 2021 |
5 # (c) 2010 A.M. Thurnherr |
5 # (c) 2010 A.M. Thurnherr |
6 # uE-Info: 46 71 NIL 0 0 72 0 2 4 NIL ofnI |
6 # uE-Info: 409 100 NIL 0 0 72 0 2 4 NIL ofnI |
7 #====================================================================== |
7 #====================================================================== |
8 |
8 |
9 # HISTORY: |
9 # HISTORY: |
10 # May 22, 2010: - created |
10 # May 22, 2010: - created |
11 # May 24, 2010: - added editSideLobesFromSeabed() |
11 # May 24, 2010: - added editSideLobesFromSeabed() |
42 # Jun 3, 2016: - BUG: applyTiltCorrection() did not use gimbal_pitch |
42 # Jun 3, 2016: - BUG: applyTiltCorrection() did not use gimbal_pitch |
43 # Jun 6, 2016: - removed applyTiltCorrection() |
43 # Jun 6, 2016: - removed applyTiltCorrection() |
44 # Oct 13, 2017: - BUG: editPPI() only allowed for nominal transducer frequencies |
44 # Oct 13, 2017: - BUG: editPPI() only allowed for nominal transducer frequencies |
45 # May 1, 2018: - added editLargeHSpeeds() |
45 # May 1, 2018: - added editLargeHSpeeds() |
46 # Nov 17, 2018: - BUG: spurious letter "z" had crept in at some stage |
46 # Nov 17, 2018: - BUG: spurious letter "z" had crept in at some stage |
|
47 # Mar 23, 2021: - updated PPI doc |
|
48 # END OF HISTORY |
47 |
49 |
48 # NOTES: |
50 # NOTES: |
49 # - all bins must be edited (not just the ones between $LADCP_firstBin |
51 # - all bins must be edited (not just the ones between $LADCP_firstBin |
50 # and $LADCP_lastBin to allow reflr calculations to use bins outside |
52 # and $LADCP_lastBin to allow reflr calculations to use bins outside |
51 # this range (ONLY FOR BEAM-COORD EDITS) |
53 # this range (ONLY FOR BEAM-COORD EDITS) |
308 |
310 |
309 #====================================================================== |
311 #====================================================================== |
310 # ($nvrm,$nerm) = editPPI($fromEns,$toEns,$water_depth) |
312 # ($nvrm,$nerm) = editPPI($fromEns,$toEns,$water_depth) |
311 # |
313 # |
312 # NOTES: |
314 # NOTES: |
313 # - only velocities in good bin range are removed/counted |
315 # - only velocities in valid-bin-range are edited (and counted) |
314 # - for UL, water_depth == undef; for DL water_depth is always defined, |
316 # - 3rd argument (water_depth) determines whether surface or |
315 # or else editPPI is not called |
317 # seabed PPI editing is required |
316 # - when this code is executed a suitable UL or DL depth-average-soundspeed |
318 # - when this code is executed a suitable depth-average-soundspeed |
317 # profile (@DASSprof at 1m resolution) is available |
319 # profile (@DASSprof at 1m resolution) is available |
|
320 # - water_depth defined: DASSprof average is to seabed |
|
321 # - water_depth not defined: DASSprof average is to sea surface |
318 # - PPI layer is defined by the shortest and longest acoustic paths |
322 # - PPI layer is defined by the shortest and longest acoustic paths |
319 # between transducer and seabed that contribute significantly to the |
323 # between transducer and seabed that contribute significantly to the |
320 # backscatter |
324 # backscatter |
321 # - shortest path (shallow limit): |
325 # - shortest path (shallow limit): |
322 # - distance to seabed => sidelobe |
326 # - distance to seabed => sidelobe |
398 if numberp($PPI_extend_upper_limit); |
402 if numberp($PPI_extend_upper_limit); |
399 |
403 |
400 my($dirty) = 0; |
404 my($dirty) = 0; |
401 for (my($bin)=$LADCP_firstBin-1; $bin<$LADCP_lastBin; $bin++) { |
405 for (my($bin)=$LADCP_firstBin-1; $bin<$LADCP_lastBin; $bin++) { |
402 next unless (defined($LADCP{ENSEMBLE}[$e]->{W}[$bin])); |
406 next unless (defined($LADCP{ENSEMBLE}[$e]->{W}[$bin])); |
403 if (defined($wd)) { # DL |
407 if (defined($wd)) { # surface PPI |
404 next unless ($bd[$bin] >= $wd-$dz_max && $bd[$bin] <= $wd-$dz_min); |
408 next unless ($bd[$bin] >= $wd-$dz_max && $bd[$bin] <= $wd-$dz_min); |
405 } else { # UL |
409 } else { # seabed PPI |
406 next unless ($bd[$bin] <= $dz_max && $bd[$bin] >= $dz_min); |
410 next unless ($bd[$bin] <= $dz_max && $bd[$bin] >= $dz_min); |
407 } |
411 } |
408 $dirty = 1; |
412 $dirty = 1; |
409 $nvrm++; |
413 $nvrm++; |
410 undef($LADCP{ENSEMBLE}[$e]->{W}[$bin]); |
414 undef($LADCP{ENSEMBLE}[$e]->{W}[$bin]); |