listBins
changeset 44 b7654ea68af6
parent 42 80d039881d2c
child 45 5767cbe470a0
equal deleted inserted replaced
42:80d039881d2c 44:b7654ea68af6
     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: Sat Dec 23 16:10:11 2017
     5 #                    dlm: Wed Aug 29 07:23:21 2018
     6 #                    (c) 2006 A.M. Thurnherr
     6 #                    (c) 2006 A.M. Thurnherr
     7 #                    uE-Info: 104 28 NIL 0 0 72 0 2 4 NIL ofnI
     7 #                    uE-Info: 136 20 NIL 0 0 72 0 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:
    64 #				  - changed semantics to include all %-good fields of earth-coordinate data
    64 #				  - changed semantics to include all %-good fields of earth-coordinate data
    65 #					and also report total pcg (3+4 beam) in min_pcg
    65 #					and also report total pcg (3+4 beam) in min_pcg
    66 #				  - BUG: 3-beam %ages were incorrect: 1) they were based on goodvels instead of the
    66 #				  - BUG: 3-beam %ages were incorrect: 1) they were based on goodvels instead of the
    67 #						 entire ensemble range; 2) pings-per-ensemble were not considered
    67 #						 entire ensemble range; 2) pings-per-ensemble were not considered
    68 #				  - BUG: output layout was all messed up for non-valid velocities
    68 #				  - BUG: output layout was all messed up for non-valid velocities
       
    69 #	Aug 29, 2018: - added error message on -r decoding failures
    69 
    70 
    70 # General Notes:
    71 # General Notes:
    71 #	- everything (e.g. beams) is numbered from 1
    72 #	- everything (e.g. beams) is numbered from 1
    72 #	- no support for BT data
    73 #	- no support for BT data
    73 
    74 
   130 	unless defined($opt_M);
   131 	unless defined($opt_M);
   131 
   132 
   132 $opt_o = '>bin%d.raw' unless defined($opt_o);
   133 $opt_o = '>bin%d.raw' unless defined($opt_o);
   133 $ifn = $ARGV[0];
   134 $ifn = $ARGV[0];
   134 
   135 
   135 ($first_ens,$last_ens) = split(',',$opt_r)
   136 if (defined($opt_r)) {
   136 	if defined($opt_r);
   137 	($first_ens,$last_ens) = split(',',$opt_r);
       
   138 	die("Cannot decode -r $opt_r\n")
       
   139 		unless ($first_ens>0 && $last_ens>$first_ens);
       
   140 }
   137 
   141 
   138 if (defined($opt_S)) {
   142 if (defined($opt_S)) {
   139 	($SS_salin,$SS_temp,$SS_depth) = split(',',$opt_S);
   143 	($SS_salin,$SS_temp,$SS_depth) = split(',',$opt_S);
   140 	$variable_ssCorr = ($SS_salin eq '*' || $SS_temp eq '*' || $SS_depth eq '*');
   144 	$variable_ssCorr = ($SS_salin eq '*' || $SS_temp eq '*' || $SS_depth eq '*');
   141 } else {
   145 } else {