listEns
changeset 11 9c3b147b4372
parent 10 c835cd613f3e
child 13 b176da8559b3
equal deleted inserted replaced
10:c835cd613f3e 11:9c3b147b4372
     1 #!/usr/bin/perl
     1 #!/usr/bin/perl
     2 #======================================================================
     2 #======================================================================
     3 #                    L I S T E N S 
     3 #                    L I S T E N S 
     4 #                    doc: Sat Jan 18 18:41:49 2003
     4 #                    doc: Sat Jan 18 18:41:49 2003
     5 #                    dlm: Wed Mar 20 11:52:46 2013
     5 #                    dlm: Fri Apr 12 10:37:10 2013
     6 #                    (c) 2003 A.M. Thurnherr
     6 #                    (c) 2003 A.M. Thurnherr
     7 #                    uE-Info: 38 45 NIL 0 0 72 2 2 4 NIL ofnI
     7 #                    uE-Info: 39 49 NIL 0 0 72 2 2 4 NIL ofnI
     8 #======================================================================
     8 #======================================================================
     9 
     9 
    10 # Print useful info from the ensemble list or dump ensembles to
    10 # Print useful info from the ensemble list or dump ensembles to
    11 # separate files.
    11 # separate files.
    12 
    12 
    34 #	Aug 15, 2010: - BUG: usage typo
    34 #	Aug 15, 2010: - BUG: usage typo
    35 #	Dec 10, 2010: - changed ANTS output to time/date instead of UNIX time
    35 #	Dec 10, 2010: - changed ANTS output to time/date instead of UNIX time
    36 #	Jan  5, 2011: - added -b
    36 #	Jan  5, 2011: - added -b
    37 #	May 12, 2011: - disabled error exit on built-in-test errors when ensembles are dumped to stdout
    37 #	May 12, 2011: - disabled error exit on built-in-test errors when ensembles are dumped to stdout
    38 #	Mar 20, 2013: - removed DATA_FORMAT stuff
    38 #	Mar 20, 2013: - removed DATA_FORMAT stuff
       
    39 #	Apr 12, 2013: - added bin number to -E output
    39 
    40 
    40 # Notes:
    41 # Notes:
    41 #	- -E outputs data in earth coordinates, unless -b is set also
    42 #	- -E outputs data in earth coordinates, unless -b is set also
    42 #	- -E output is always in ANTS format, ignoring -A
    43 #	- -E output is always in ANTS format, ignoring -A
    43 #	- no soundspeed correction
    44 #	- no soundspeed correction
   165 					"BT_amp3{$dta{ENSEMBLE}[$e]->{BT_AMPLITUDE}[2]} " .
   166 					"BT_amp3{$dta{ENSEMBLE}[$e]->{BT_AMPLITUDE}[2]} " .
   166 					"BT_amp4{$dta{ENSEMBLE}[$e]->{BT_AMPLITUDE}[3]} " .
   167 					"BT_amp4{$dta{ENSEMBLE}[$e]->{BT_AMPLITUDE}[3]} " .
   167 					"\n"
   168 					"\n"
   168 			);
   169 			);
   169 			print(P "#ANTS#FIELDS# " .
   170 			print(P "#ANTS#FIELDS# " .
   170 					"{dz} {u} {v} {w} {e} {cor1} {cor2} {cor3} {cor4} " .
   171 					"{bin} {dz} {u} {v} {w} {e} {cor1} {cor2} {cor3} {cor4} " .
   171 					"{amp1} {amp2} {amp3} {amp4} "
   172 					"{amp1} {amp2} {amp3} {amp4} "
   172 			);
   173 			);
   173 			if ($beamCoords) {
   174 			if ($beamCoords) {
   174 				print(P "{pcg1} {pcg2} {pcg3} {pcg4}");
   175 				print(P "{pcg1} {pcg2} {pcg3} {pcg4}");
   175 			} else {
   176 			} else {
   201 				$v[0] = nan unless defined($v[0]);
   202 				$v[0] = nan unless defined($v[0]);
   202 				$v[1] = nan unless defined($v[1]);
   203 				$v[1] = nan unless defined($v[1]);
   203 				$v[2] = nan unless defined($v[2]);
   204 				$v[2] = nan unless defined($v[2]);
   204 				$v[3] = nan unless defined($v[3]);
   205 				$v[3] = nan unless defined($v[3]);
   205 				my(@out) = (
   206 				my(@out) = (
   206 					$dz,$v[0],$v[1],$v[2],$v[3],
   207 					$b,$dz,$v[0],$v[1],$v[2],$v[3],
   207 					@{$dta{ENSEMBLE}[$e]->{CORRELATION}[$b]},
   208 					@{$dta{ENSEMBLE}[$e]->{CORRELATION}[$b]},
   208 					@{$dta{ENSEMBLE}[$e]->{ECHO_AMPLITUDE}[$b]},
   209 					@{$dta{ENSEMBLE}[$e]->{ECHO_AMPLITUDE}[$b]},
   209 					@{$dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$b]}
   210 					@{$dta{ENSEMBLE}[$e]->{PERCENT_GOOD}[$b]}
   210 				);
   211 				);
   211 				foreach my $f (@addFields) {
   212 				foreach my $f (@addFields) {