plot_backscatter.pl
changeset 56 8f120b9f795a
parent 53 b4374f1ebd60
equal deleted inserted replaced
55:2d8e1139acd5 56:8f120b9f795a
     1 #======================================================================
     1 #======================================================================
     2 #                    P L O T _ B A C K S C A T T E R . P L 
     2 #                    P L O T _ B A C K S C A T T E R . P L 
     3 #                    doc: Tue Jul 28 13:21:09 2015
     3 #                    doc: Tue Jul 28 13:21:09 2015
     4 #                    dlm: Tue Oct 29 13:13:02 2019
     4 #                    dlm: Thu Jul  1 13:32:33 2021
     5 #                    (c) 2015 A.M. Thurnherr
     5 #                    (c) 2015 A.M. Thurnherr
     6 #                    uE-Info: 73 54 NIL 0 0 72 0 2 4 NIL ofnI
     6 #                    uE-Info: 30 42 NIL 0 0 72 0 2 4 NIL ofnI
     7 #======================================================================
     7 #======================================================================
     8 
     8 
     9 # HISTORY:
     9 # HISTORY:
    10 #	Jul 28, 2015: - created from [LWplot_Sv]
    10 #	Jul 28, 2015: - created from [LWplot_Sv]
    11 #	Jan 26, 2016: - added return on no data to plot
    11 #	Jan 26, 2016: - added return on no data to plot
    13 #   May 18, 2016: - added version
    13 #   May 18, 2016: - added version
    14 #                 - expunged $realLastGoodEns
    14 #                 - expunged $realLastGoodEns
    15 #   May 24, 2016: - calc_binDepths() -> binDepths()
    15 #   May 24, 2016: - calc_binDepths() -> binDepths()
    16 #				  - fixed for partial-depth casts
    16 #				  - fixed for partial-depth casts
    17 #	Oct 29, 2019: - updated psscale -B to gmt5 syntax
    17 #	Oct 29, 2019: - updated psscale -B to gmt5 syntax
       
    18 #	Jul  1, 2021: - adapted to more standard %PARAMs
    18 
    19 
    19 require "$ANTS/libGMT.pl";
    20 require "$ANTS/libGMT.pl";
    20 
    21 
    21 sub plot_backscatter($)
    22 sub plot_backscatter($)
    22 {
    23 {
    23 	my($pfn) = @_;
    24 	my($pfn) = @_;
    24 
    25 
    25 	return unless ($P{max_depth});
    26 	return unless ($P{'depth.max'});
    26 
    27 
    27 	my($xmin) = $P{min_ens}-0.5;
    28 	my($xmin) = $P{'ens.min'}-0.5;
    28 	my($xmax) = $P{max_ens}+0.5;
    29 	my($xmax) = $P{'ens.max'}+0.5;
    29 	my($ymin) = round(antsParam('min_depth')-25,50);
    30 	my($ymin) = round(antsParam('depth.min')-25,50);
    30 	my($ymax) = ($P{water_depth} > 0) ?
    31 	my($ymax) = ($P{water_depth} > 0) ?
    31 				round($P{water_depth}+25,50) :
    32 				round($P{water_depth}+25,50) :
    32 				round($P{max_depth}+$P{ADCP_bin_length}+25,50);
    33 				round($P{'depth.max'}+$P{ADCP_bin_length}+25,50);
    33 
    34 
    34 	my($ens_width) = 10 / ($P{max_ens} - $P{min_ens} + 1);
    35 	my($ens_width) = 10 / ($P{'ens.max'} - $P{'ens.min'} + 1);
    35 	my($bin_length) = 10 * $P{ADCP_bin_length} / 
    36 	my($bin_length) = 10 * $P{ADCP_bin_length} / 
    36 						($P{max_depth}-$P{min_depth}+$P{ADCP_bin_length});
    37 						($P{'depth.max'}-$P{'depth.min'}+$P{ADCP_bin_length});
    37 
    38 
    38 	my($R) = "-R$xmin/$xmax/$ymin/$ymax";
    39 	my($R) = "-R$xmin/$xmax/$ymin/$ymax";
    39 	GMT_begin($pfn,'-JX10/-10',$R,'-P');
    40 	GMT_begin($pfn,'-JX10/-10',$R,'-P');
    40 
    41 
    41 	my($C) = "-C$WCALC/Sv.cpt";
    42 	my($C) = "-C$WCALC/Sv.cpt";