listBins
changeset 24 1a761865f839
parent 23 fb0c269b1eaa
child 28 7c7da52363c2
equal deleted inserted replaced
23:fb0c269b1eaa 24:1a761865f839
     1 #!/usr/bin/perl
     1 #!/usr/bin/perl
     2 #======================================================================
     2 #======================================================================
     3 #                    L I S T B I N S 
     3 #                    L I S T B I N S 
     4 #                    doc: Fri Aug 25 15:57:05 2006
     4 #                    doc: Fri Aug 25 15:57:05 2006
     5 #                    dlm: Sun Mar 22 12:22:47 2015
     5 #                    dlm: Tue Jun 16 09:28:17 2015
     6 #                    (c) 2006 A.M. Thurnherr
     6 #                    (c) 2006 A.M. Thurnherr
     7 #                    uE-Info: 63 63 NIL 0 0 72 2 2 4 NIL ofnI
     7 #                    uE-Info: 53 74 NIL 0 0 72 2 2 4 NIL ofnI
     8 #======================================================================
     8 #======================================================================
     9 
     9 
    10 # Split data file into per-bin time series.
    10 # Split data file into per-bin time series.
    11 
    11 
    12 # HISTORY:
    12 # HISTORY:
    48 #	Aug  7, 2013: - BUG: -w did not respect -d
    48 #	Aug  7, 2013: - BUG: -w did not respect -d
    49 #   Mar  4, 2014: - added support for missing PITCH/ROLL/HEADING
    49 #   Mar  4, 2014: - added support for missing PITCH/ROLL/HEADING
    50 #	Apr 22, 2014: - BUG: extraneous semicolon
    50 #	Apr 22, 2014: - BUG: extraneous semicolon
    51 #	Nov 24, 2014: - enabled -w always
    51 #	Nov 24, 2014: - enabled -w always
    52 #	Mar 22, 2015: - replaced -f by -o (allowing for pipes)
    52 #	Mar 22, 2015: - replaced -f by -o (allowing for pipes)
       
    53 #	Jun 16, 2015: - BUG: velocity bias code did not respect bad velocities
    53 
    54 
    54 # General Notes:
    55 # General Notes:
    55 #	- everything (e.g. beams) is numbered from 1
    56 #	- everything (e.g. beams) is numbered from 1
    56 #	- no support for BT data
    57 #	- no support for BT data
    57 
    58 
   277 		if defined($dta{ENSEMBLE}[$e]->{BUILT_IN_TEST_ERROR});
   278 		if defined($dta{ENSEMBLE}[$e]->{BUILT_IN_TEST_ERROR});
   278 	die("Low gain in ensemble #$dta{ENSEMBLE}[$e]->{NUMBER}\n")
   279 	die("Low gain in ensemble #$dta{ENSEMBLE}[$e]->{NUMBER}\n")
   279         if ($dta{ENSEMBLE}[$e]->{LOW_GAIN});
   280         if ($dta{ENSEMBLE}[$e]->{LOW_GAIN});
   280 
   281 
   281 	for (my($b)=0; $b<$dta{N_BINS}; $b++) {
   282 	for (my($b)=0; $b<$dta{N_BINS}; $b++) {
   282 		$dta{ENSEMBLE}[$e]->{VELOCITY}[$b][0] -= $P{velbias_b1};
   283 		$dta{ENSEMBLE}[$e]->{VELOCITY}[$b][0] -= $P{velbias_b1} if defined($dta{ENSEMBLE}[$e]->{VELOCITY}[$b][0]);
   283 		$dta{ENSEMBLE}[$e]->{VELOCITY}[$b][1] -= $P{velbias_b2};
   284 		$dta{ENSEMBLE}[$e]->{VELOCITY}[$b][1] -= $P{velbias_b2} if defined($dta{ENSEMBLE}[$e]->{VELOCITY}[$b][1]);
   284 		$dta{ENSEMBLE}[$e]->{VELOCITY}[$b][2] -= $P{velbias_b3};
   285 		$dta{ENSEMBLE}[$e]->{VELOCITY}[$b][2] -= $P{velbias_b3} if defined($dta{ENSEMBLE}[$e]->{VELOCITY}[$b][2]);
   285 		$dta{ENSEMBLE}[$e]->{VELOCITY}[$b][3] -= $P{velbias_b4};
   286 		$dta{ENSEMBLE}[$e]->{VELOCITY}[$b][3] -= $P{velbias_b4} if defined($dta{ENSEMBLE}[$e]->{VELOCITY}[$b][3]);
   286 		if (defined($opt_d)) {
   287 		if (defined($opt_d)) {
   287 			undef($dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$b][$opt_d-1]);
   288 			undef($dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$b][$opt_d-1]);
   288 			undef($dta{ENSEMBLE}[$e]->{VELOCITY}[$b][$opt_d-1]);
   289 			undef($dta{ENSEMBLE}[$e]->{VELOCITY}[$b][$opt_d-1]);
   289 		}
   290 		}
   290 		@{$dta{ENSEMBLE}[$e]->{BEAMPAIR_VELOCITY}[$b]} =
   291 		@{$dta{ENSEMBLE}[$e]->{BEAMPAIR_VELOCITY}[$b]} =