LADCPproc.backscatter
changeset 33 dd5b67a41791
parent 31 af03ca38fc2a
parent 29 f72cd642972c
equal deleted inserted replaced
32:9b972ce37c3b 33:dd5b67a41791
     1 #======================================================================
     1 #======================================================================
     2 #                    L A D C P P R O C . B A C K S C A T T E R 
     2 #                    L A D C P P R O C . B A C K S C A T T E R 
     3 #                    doc: Wed Oct 20 13:02:27 2010
     3 #                    doc: Wed Oct 20 13:02:27 2010
     4 #                    dlm: Tue Aug  5 13:32:13 2014
     4 #                    dlm: Fri Mar  6 15:52:50 2015
     5 #                    (c) 2010 A.M. Thurnherr
     5 #                    (c) 2010 A.M. Thurnherr
     6 #                    uE-Info: 30 71 NIL 0 0 72 2 2 4 NIL ofnI
     6 #                    uE-Info: 32 0 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
    21 #						 search
    21 #						 search
    22 #				  - BUG: same used bins entirely below seabed (only possible
    22 #				  - BUG: same used bins entirely below seabed (only possible
    23 #						 for shallow casts)
    23 #						 for shallow casts)
    24 #	Mar 21, 2014: - adapted to new [LADCPproc.utils]
    24 #	Mar 21, 2014: - adapted to new [LADCPproc.utils]
    25 #	Mar 27, 2014: - adapted to depthOfBinAlongBeam()
    25 #	Mar 27, 2014: - adapted to depthOfBinAlongBeam()
       
    26 #	May 25, 2014: - made search_below integer
    26 #	Jul 27, 2014: - moved depthOfGI() to [LADCPproc.utils]
    27 #	Jul 27, 2014: - moved depthOfGI() to [LADCPproc.utils]
    27 #	Aug  5, 2014: - BUG: find_backscatter_seabed() discarded everything if
    28 #	Aug  5, 2014: - BUG: find_backscatter_seabed() discarded everything if
    28 #						 LADCP bin 1 had the backscatter max at the edge of
    29 #						 LADCP bin 1 had the backscatter max at the edge of
    29 #						 the search domain, which could easily happen when
    30 #						 the search domain, which could easily happen when
    30 #						 the bottom stop was a long way from the seabed
    31 #						 the bottom stop was a long way from the seabed
   251 sub find_backscatter_seabed($)
   252 sub find_backscatter_seabed($)
   252 {
   253 {
   253 	my($water_depth) = @_;
   254 	my($water_depth) = @_;
   254 	my(@wdepth_gi);												# water_depth indices
   255 	my(@wdepth_gi);												# water_depth indices
   255 
   256 
   256 	my($search_below) = max(0,$water_depth-$BT_begin_search_above);
   257 	my($search_below) = int(max(0,$water_depth-$BT_begin_search_above));
   257 	my($mdgi) = int($search_below/$GRID_DZ);					# grid index to begin search
   258 	my($mdgi) = int($search_below/$GRID_DZ);					# grid index to begin search
   258 	printf(STDERR "\n\t\tlooking for seabed below %d m (gi = [%d..%d])",$search_below,$mdgi,scalar(@nSv))
   259 	printf(STDERR "\n\t\tlooking for seabed below %d m (gi = [%d..%d])",$search_below,$mdgi,scalar(@nSv))
   259 		if ($opt_d);
   260 		if ($opt_d);
   260 
   261 
   261 	print(STDERR "\n\t\tseabed-max grid indices:") if ($opt_d);
   262 	print(STDERR "\n\t\tseabed-max grid indices:") if ($opt_d);