1 #====================================================================== |
1 #====================================================================== |
2 # F I N D _ S E A B E D . P L |
2 # F I N D _ S E A B E D . P L |
3 # doc: Sun May 23 20:26:11 2010 |
3 # doc: Sun May 23 20:26:11 2010 |
4 # dlm: Wed Oct 19 14:25:27 2011 |
4 # dlm: Tue Jan 26 15:22:26 2016 |
5 # (c) 2010 A.M. Thurnherr |
5 # (c) 2010 A.M. Thurnherr |
6 # uE-Info: 15 0 NIL 0 0 72 0 2 4 NIL ofnI |
6 # uE-Info: 16 33 NIL 0 0 72 0 2 4 NIL ofnI |
7 #====================================================================== |
7 #====================================================================== |
8 |
8 |
9 # HISTORY: |
9 # HISTORY: |
10 # May 23, 2010: - adapted from [perl-tools/RDI_Utils.pl] |
10 # May 23, 2010: - adapted from [perl-tools/RDI_Utils.pl] |
11 # Dec 25, 2010: - adapted to changes in [LADCP_w] |
11 # Dec 25, 2010: - adapted to changes in [LADCP_w] |
12 # Oct 11, 2011: - moved defaults to [defaults.pl] |
12 # Oct 11, 2011: - moved defaults to [defaults.pl] |
13 # - increased z_offset from 10km to 15km |
13 # - increased z_offset from 10km to 15km |
14 # Oct 19, 2011: - added $SS_max_allowed_range |
14 # Oct 19, 2011: - added $SS_max_allowed_range |
15 # - renamed $SS_min_allowed_hab to *_range |
15 # - renamed $SS_min_allowed_hab to *_range |
|
16 # Jan 26, 2016: - added %PARAMs |
16 |
17 |
17 # NOTES: |
18 # NOTES: |
18 # 1) BT range is corrected for sound speed at the transducer. This is not |
19 # 1) BT range is corrected for sound speed at the transducer. This is not |
19 # accurate, but unlikely to be very wrong, at least for deep casts, |
20 # accurate, but unlikely to be very wrong, at least for deep casts, |
20 # because the vertical sound speed variability near the seabed tends |
21 # because the vertical sound speed variability near the seabed tends |
33 sub find_seabed($$$) |
34 sub find_seabed($$$) |
34 { |
35 { |
35 my($d,$be,$beamCoords) = @_; |
36 my($d,$be,$beamCoords) = @_; |
36 my($i,$dd,$sd,$nd); |
37 my($i,$dd,$sd,$nd); |
37 my(@guesses); |
38 my(@guesses); |
|
39 |
|
40 &antsAddParams('SS_min_allowed_range',$SS_min_allowed_range, |
|
41 'SS_max_allowed_range',$SS_max_allowed_range, |
|
42 'SS_search_window_halfwidth',$SS_search_window_halfwidth, |
|
43 'SS_max_allowed_depth_range',$SS_max_allowed_depth_range); |
38 |
44 |
39 return undef unless ($be-$SS_search_window_halfwidth >= 0 && |
45 return undef unless ($be-$SS_search_window_halfwidth >= 0 && |
40 $be+$SS_search_window_halfwidth <= $#{$d->{ENSEMBLE}}); |
46 $be+$SS_search_window_halfwidth <= $#{$d->{ENSEMBLE}}); |
41 for ($i=$be-$SS_search_window_halfwidth; $i<=$be+$SS_search_window_halfwidth; $i++) { |
47 for ($i=$be-$SS_search_window_halfwidth; $i<=$be+$SS_search_window_halfwidth; $i++) { |
42 next unless (defined($d->{ENSEMBLE}[$i]->{CTD_DEPTH}) && |
48 next unless (defined($d->{ENSEMBLE}[$i]->{CTD_DEPTH}) && |