plot_attitude_residuals.pl
changeset 47 2ccb81b7cea5
parent 46 cc6c4309828a
equal deleted inserted replaced
46:cc6c4309828a 47:2ccb81b7cea5
     1 #======================================================================
     1 #======================================================================
     2 #                    P L O T _ A T T I T U D E _ R E S I D U A L S . P L 
     2 #                    P L O T _ A T T I T U D E _ R E S I D U A L S . P L 
     3 #                    doc: Sun May 15 16:08:59 2016
     3 #                    doc: Sun May 15 16:08:59 2016
     4 #                    dlm: Tue May 24 16:39:01 2016
     4 #                    dlm: Wed Jun  8 22:12:19 2016
     5 #                    (c) 2016 A.M. Thurnherr
     5 #                    (c) 2016 A.M. Thurnherr
     6 #                    uE-Info: 54 24 NIL 0 0 72 2 2 4 NIL ofnI
     6 #                    uE-Info: 92 0 NIL 0 0 72 2 2 4 NIL ofnI
     7 #======================================================================
     7 #======================================================================
     8 
     8 
     9 # HISTORY:
     9 # HISTORY:
    10 #	May 15, 2016: - created from [plot_mean_residuals.pl]
    10 #	May 15, 2016: - created from [plot_mean_residuals.pl]
    11 #	May 16, 2016: - continued
    11 #	May 16, 2016: - continued
    13 #				  - added pitch/roll means
    13 #				  - added pitch/roll means
    14 #	May 18, 2016: - added version
    14 #	May 18, 2016: - added version
    15 #                 - expunged $realLastGoodEns
    15 #                 - expunged $realLastGoodEns
    16 #	May 19, 2016: - added notes about beam planes
    16 #	May 19, 2016: - added notes about beam planes
    17 #   May 24, 2016: - calc_binDepths() -> binDepths()
    17 #   May 24, 2016: - calc_binDepths() -> binDepths()
       
    18 #   Jun  8, 2016: - adapted to correct tilt axis
    18 
    19 
    19 # IMPORTANT NOTE:
    20 # IMPORTANT NOTE:
    20 #   - the variables prefixed with p/r refer to beam-pairs 1,2 and 3,4 respectively,
    21 #   - the variables prefixed with p/r refer to beam-pairs 1,2 and 3,4 respectively,
    21 #     i.e. the p variables correspond to the roll plane and the r variables
    22 #     i.e. the p variables correspond to the roll plane and the r variables
    22 #          correspond to the pitch plane
    23 #     correspond to the pitch plane. This is confusing.
    23 
    24 
    24 require "$ANTS/libGMT.pl";
    25 require "$ANTS/libGMT.pl";
    25 
    26 
    26 sub plot_attitude_residuals($)
    27 sub plot_attitude_residuals($)
    27 {
    28 {
    57 			next if ($bindepth[$bin] <= $excluded_surf_layer);
    58 			next if ($bindepth[$bin] <= $excluded_surf_layer);
    58 			next unless ($bin+1>=$outGrid_firstBin && $bin+1<=$outGrid_lastBin);
    59 			next unless ($bin+1>=$outGrid_firstBin && $bin+1<=$outGrid_lastBin);
    59 			next unless numberp($LADCP{ENSEMBLE}[$e]->{SSCORRECTED_OCEAN_W12}[$bin]) &&
    60 			next unless numberp($LADCP{ENSEMBLE}[$e]->{SSCORRECTED_OCEAN_W12}[$bin]) &&
    60 						numberp($LADCP{ENSEMBLE}[$e]->{SSCORRECTED_OCEAN_W34}[$bin]);
    61 						numberp($LADCP{ENSEMBLE}[$e]->{SSCORRECTED_OCEAN_W34}[$bin]);
    61 
    62 
    62 			my($pi) = int($LADCP{ENSEMBLE}[$e]->{GIMBAL_PITCH}+$opt_t);							# pitch/roll indices
    63 			my($ri) = int($LADCP{ENSEMBLE}[$e]->{GIMBAL_PITCH}+$opt_t);							# pitch/roll indices
    63 			my($ri) = int($LADCP{ENSEMBLE}[$e]->{ROLL}+$opt_t);
    64 			my($pi) = int($LADCP{ENSEMBLE}[$e]->{ROLL}+$opt_t);
    64 			my($bi) = $bindepth[$bin]/$opt_o;
    65 			my($bi) = $bindepth[$bin]/$opt_o;
    65 
    66 
    66 			if ($e < $LADCP_atbottom) {															# downcast
    67 			if ($e < $LADCP_atbottom) {															# downcast
    67 				$pitchSumDC  += $LADCP{ENSEMBLE}[$e]->{GIMBAL_PITCH};	$pHistDC++; 
    68 				$pitchSumDC  += $LADCP{ENSEMBLE}[$e]->{GIMBAL_PITCH};	$pHistDC++; 
    68 				$rollSumDC += $LADCP{ENSEMBLE}[$e]->{ROLL};				$rHistDC++;
    69 				$rollSumDC += $LADCP{ENSEMBLE}[$e]->{ROLL};				$rHistDC++;