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: Mon Apr 29 11:50:06 2013 |
5 # dlm: Wed Aug 7 10:04:28 2013 |
6 # (c) 2006 A.M. Thurnherr |
6 # (c) 2006 A.M. Thurnherr |
7 # uE-Info: 108 20 NIL 0 0 72 2 2 4 NIL ofnI |
7 # uE-Info: 48 46 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: |
43 # May 22, 2009: - added -B) <bias/bias/bias/bias> |
43 # May 22, 2009: - added -B) <bias/bias/bias/bias> |
44 # May 23, 2009: - adapted to changed beampair-velocity fun name |
44 # May 23, 2009: - adapted to changed beampair-velocity fun name |
45 # Aug 22, 2010: - added -R |
45 # Aug 22, 2010: - added -R |
46 # Apr 29, 2013: - cosmetics |
46 # Apr 29, 2013: - cosmetics |
47 # - added warning on missing -S |
47 # - added warning on missing -S |
|
48 # Aug 7, 2013: - BUG: -w did not respect -d |
48 |
49 |
49 # General Notes: |
50 # General Notes: |
50 # - everything (e.g. beams) is numbered from 1 |
51 # - everything (e.g. beams) is numbered from 1 |
51 # - no support for BT data |
52 # - no support for BT data |
52 |
53 |
269 for (my($b)=0; $b<$dta{N_BINS}; $b++) { |
270 for (my($b)=0; $b<$dta{N_BINS}; $b++) { |
270 $dta{ENSEMBLE}[$e]->{VELOCITY}[$b][0] -= $P{velbias_b1}; |
271 $dta{ENSEMBLE}[$e]->{VELOCITY}[$b][0] -= $P{velbias_b1}; |
271 $dta{ENSEMBLE}[$e]->{VELOCITY}[$b][1] -= $P{velbias_b2}; |
272 $dta{ENSEMBLE}[$e]->{VELOCITY}[$b][1] -= $P{velbias_b2}; |
272 $dta{ENSEMBLE}[$e]->{VELOCITY}[$b][2] -= $P{velbias_b3}; |
273 $dta{ENSEMBLE}[$e]->{VELOCITY}[$b][2] -= $P{velbias_b3}; |
273 $dta{ENSEMBLE}[$e]->{VELOCITY}[$b][3] -= $P{velbias_b4}; |
274 $dta{ENSEMBLE}[$e]->{VELOCITY}[$b][3] -= $P{velbias_b4}; |
|
275 if (defined($opt_d)) { |
|
276 undef($dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$b][$opt_d-1]); |
|
277 undef($dta{ENSEMBLE}[$e]->{VELOCITY}[$b][$opt_d-1]); |
|
278 } |
274 if ($opt_w) { |
279 if ($opt_w) { |
275 @{$dta{ENSEMBLE}[$e]->{BEAMPAIR_VELOCITY}[$b]} = |
280 @{$dta{ENSEMBLE}[$e]->{BEAMPAIR_VELOCITY}[$b]} = |
276 velBeamToBPEarth(\%dta,$e,@{$dta{ENSEMBLE}[$e]->{VELOCITY}[$b]}); |
281 velBeamToBPEarth(\%dta,$e,@{$dta{ENSEMBLE}[$e]->{VELOCITY}[$b]}); |
277 } |
|
278 |
|
279 if (defined($opt_d)) { |
|
280 undef($dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$b][$opt_d-1]); |
|
281 undef($dta{ENSEMBLE}[$e]->{VELOCITY}[$b][$opt_d-1]); |
|
282 } |
282 } |
283 for (my($i)=0; $i<4; $i++) { |
283 for (my($i)=0; $i<4; $i++) { |
284 if ($dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$b][$i] < $opt_p) { |
284 if ($dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$b][$i] < $opt_p) { |
285 undef($dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$b][$i]); |
285 undef($dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$b][$i]); |
286 undef($dta{ENSEMBLE}[$e]->{VELOCITY}[$b][$i]); |
286 undef($dta{ENSEMBLE}[$e]->{VELOCITY}[$b][$i]); |