1 #====================================================================== |
1 #====================================================================== |
2 # A C O U S T I C _ B A C K S C A T T E R . P L |
2 # A C O U S T I C _ B A C K S C A T T E R . P L |
3 # doc: Wed Oct 20 13:02:27 2010 |
3 # doc: Wed Oct 20 13:02:27 2010 |
4 # dlm: Tue May 24 16:34:24 2016 |
4 # dlm: Thu Jul 1 09:37:40 2021 |
5 # (c) 2010 A.M. Thurnherr |
5 # (c) 2010 A.M. Thurnherr |
6 # uE-Info: 212 0 NIL 0 0 72 2 2 4 NIL ofnI |
6 # uE-Info: 32 46 NIL 0 0 72 2 2 4 NIL ofnI |
7 #====================================================================== |
7 #====================================================================== |
8 |
8 |
9 # HISTORY: |
9 # HISTORY: |
10 # Oct 20, 2010: - created |
10 # Oct 20, 2010: - created |
11 # Dec 10, 2010: - BUG: backscatter above sea surface made code bomb |
11 # Dec 10, 2010: - BUG: backscatter above sea surface made code bomb |
27 # Jun 18, 2015: - removed assertion marked by ##???, which bombed on P16N1#41 DL |
27 # Jun 18, 2015: - removed assertion marked by ##???, which bombed on P16N1#41 DL |
28 # Jan 26, 2016: - added %PARAMs |
28 # Jan 26, 2016: - added %PARAMs |
29 # Mar 26, 2016: - BUG: nSv was declared local to this scope even though it is used outside |
29 # Mar 26, 2016: - BUG: nSv was declared local to this scope even though it is used outside |
30 # May 18, 2016: - improved logging |
30 # May 18, 2016: - improved logging |
31 # May 24, 2016: - calc_binDepths() -> binDepths() |
31 # May 24, 2016: - calc_binDepths() -> binDepths() |
|
32 # Jul 1, 2021: - made %PARAMs more standard |
|
33 # HISTORY END |
|
34 |
32 |
35 |
33 #---------------------------------------------------------------------- |
36 #---------------------------------------------------------------------- |
34 # Volume Scattering Coefficient, following Deines (IEEE 1999) |
37 # Volume Scattering Coefficient, following Deines (IEEE 1999) |
35 # NOTES: |
38 # NOTES: |
36 # - instrument specific! (300kHz Workhorse) |
39 # - instrument specific! (300kHz Workhorse) |
225 sub find_backscatter_seabed($) |
228 sub find_backscatter_seabed($) |
226 { |
229 { |
227 my($search_below) = int($_[0]); # grid index to begin search |
230 my($search_below) = int($_[0]); # grid index to begin search |
228 my(@wdepth,@Sv_rng); # list of water_depth indices |
231 my(@wdepth,@Sv_rng); # list of water_depth indices |
229 |
232 |
230 &antsAddParams('SS_min_signal',$SS_min_signal,'SS_min_samp',$SS_min_samp, |
233 &antsAddParams('SS_signal.min',$SS_min_signal,'SS_samp.min',$SS_min_samp, |
231 'SS_max_allowed_depth_range',$SS_max_allowed_depth_range); |
234 'SS_allowed_depth_range.max',$SS_max_allowed_depth_range); |
232 |
235 |
233 for (my($bin)=$LADCP_firstBin-1; $bin<=$LADCP_lastBin-1; $bin++) { # find backscatter min/max below $search_below in each bin |
236 for (my($bin)=$LADCP_firstBin-1; $bin<=$LADCP_lastBin-1; $bin++) { # find backscatter min/max below $search_below in each bin |
234 my($minSv,$maxSv,$depthmaxSv,$lastvalid) = (1e99,-1e99,-1,-1); |
237 my($minSv,$maxSv,$depthmaxSv,$lastvalid) = (1e99,-1e99,-1,-1); |
235 for (my($depth)=$search_below; $depth<@nSv; $depth++) { |
238 for (my($depth)=$search_below; $depth<@nSv; $depth++) { |
236 next unless ($nSv[$depth][$bin] > 0); |
239 next unless ($nSv[$depth][$bin] > 0); |