1 #====================================================================== |
1 #====================================================================== |
2 # R D I _ U T I L S . P L |
2 # R D I _ U T I L S . P L |
3 # doc: Wed Feb 12 10:21:32 2003 |
3 # doc: Wed Feb 12 10:21:32 2003 |
4 # dlm: Sat Jul 30 09:46:59 2016 |
4 # dlm: Tue Aug 8 16:25:05 2017 |
5 # (c) 2003 A.M. Thurnherr |
5 # (c) 2003 A.M. Thurnherr |
6 # uE-Info: 438 0 NIL 0 0 72 0 2 4 NIL ofnI |
6 # uE-Info: 58 55 NIL 0 0 72 2 2 4 NIL ofnI |
7 #====================================================================== |
7 #====================================================================== |
8 |
8 |
9 # miscellaneous RDI-specific utilities |
9 # miscellaneous RDI-specific utilities |
10 |
10 |
11 # History: |
11 # History: |
52 # May 29, 2014: - removed unused code (disabled warning) from ref_lr_w |
52 # May 29, 2014: - removed unused code (disabled warning) from ref_lr_w |
53 # Mar 22, 2015: - BUG: mk_prof could bomb because of division-by-zero in return statement |
53 # Mar 22, 2015: - BUG: mk_prof could bomb because of division-by-zero in return statement |
54 # Jan 9, 2016: - renamed ref_lr_w to mk_prof_ref_lr_w because the old name conflicts |
54 # Jan 9, 2016: - renamed ref_lr_w to mk_prof_ref_lr_w because the old name conflicts |
55 # with a sub in LADCP_w |
55 # with a sub in LADCP_w |
56 # May 19, 2016: - adapted to new velBeamToInstrument() usage |
56 # May 19, 2016: - adapted to new velBeamToInstrument() usage |
|
57 # Aug 7, 2017: - added abmiguity velocity |
|
58 # Aug 8, 2017: - changed transducer frequency to kHz |
57 |
59 |
58 use strict; |
60 use strict; |
59 |
61 |
60 #====================================================================== |
62 #====================================================================== |
61 # fake_BT_RANGE(dta ptr) |
63 # fake_BT_RANGE(dta ptr) |
252 $warned = 1; |
254 $warned = 1; |
253 $D = $eRef->{PRESSURE}; |
255 $D = $eRef->{PRESSURE}; |
254 } |
256 } |
255 return soundSpeed($S,$T,$D) / $eRef->{SPEED_OF_SOUND}; |
257 return soundSpeed($S,$T,$D) / $eRef->{SPEED_OF_SOUND}; |
256 } |
258 } |
|
259 } |
|
260 |
|
261 #====================================================================== |
|
262 # ambiguity_velocity(transducer_freq,beam_angle,sound_speed,transmit_lag_dist) |
|
263 # - recipe provied by Jerry Mullison in August 2017 |
|
264 # - transducer_freq in kHz |
|
265 # - sound speed can vary with ensemble |
|
266 #====================================================================== |
|
267 |
|
268 sub ambiguity_velocity($$$$) |
|
269 { |
|
270 my($xd_freq,$beam_angle,$speed_of_sound,$TL_distance) = @_; |
|
271 my($lambda) = $speed_of_sound / (1000*$xd_freq); |
|
272 my($D) = $speed_of_sound * cos(rad($beam_angle)) / 2; |
|
273 return $lambda * $D / (4 * $TL_distance); |
257 } |
274 } |
258 |
275 |
259 #====================================================================== |
276 #====================================================================== |
260 # ($firstgood,$lastgood,$atbottom,$w_gap_time,$zErr,$maxz) = |
277 # ($firstgood,$lastgood,$atbottom,$w_gap_time,$zErr,$maxz) = |
261 # mk_prof($dta,$check,$filter,$lr_b0,$lr_b1,$min_corr,$max_e,$max_gap); |
278 # mk_prof($dta,$check,$filter,$lr_b0,$lr_b1,$min_corr,$max_e,$max_gap); |