--- a/ADCP_tools_lib.pl
+++ b/ADCP_tools_lib.pl
@@ -1,15 +1,15 @@
#======================================================================
# A D C P _ T O O L S _ L I B . P L
# doc: Tue Jan 5 10:45:47 2016
-# dlm: Tue Jan 5 10:50:18 2016
+# dlm: Thu Mar 17 07:46:47 2016
# (c) 2016 A.M. Thurnherr
-# uE-Info: 21 0 NIL 0 0 72 0 2 4 NIL ofnI
+# uE-Info: 12 25 NIL 0 0 72 0 2 4 NIL ofnI
#======================================================================
# HISTORY:
# Jan 5, 2015: - created
-$ADCP_tools_version = 1.4; # Jan 5, 2016
+$ADCP_tools_version = 1.5; # Jan 5, 2016
die(sprintf("$0: obsolete ADCP_tools V%.1f; V%.1f required\n",
$ADCP_tools_version,$ADCP_tools_minVersion))
--- a/HISTORY
+++ b/HISTORY
@@ -1,9 +1,9 @@
======================================================================
H I S T O R Y
doc: Tue May 15 18:04:39 2012
- dlm: Tue Mar 8 15:41:38 2016
+ dlm: Tue Mar 29 15:01:05 2016
(c) 2012 A.M. Thurnherr
- uE-Info: 55 28 NIL 0 0 72 3 2 8 NIL ofnI
+ uE-Info: 62 35 NIL 0 0 72 3 2 8 NIL ofnI
======================================================================
May 15, 2012:
@@ -54,4 +54,10 @@
- verified/updated version in [ADCP_tools_lib.pl] [.hg/hgrc]
- published V1.4 on server
-
+Mar 17, 2016: V1.5
+ - verified/updated version in [ADCP_tools_lib.pl] [.hg/hgrc]
+ - adapted to new Getopts & removed compile warnings
+
+Mar 29, 2016:
+ - published for LADCP_w V1.2beta6
+
--- a/RDI2grd
+++ b/RDI2grd
@@ -2,9 +2,9 @@
#======================================================================
# R D I 2 G R D
# doc: Wed Aug 30 11:51:22 2006
-# dlm: Thu Jun 18 07:06:34 2009
+# dlm: Thu Mar 17 07:39:24 2016
# (c) 2006 A.M. Thurnherr
-# uE-Info: 18 54 NIL 0 0 72 2 2 4 NIL ofnI
+# uE-Info: 20 0 NIL 0 0 72 2 2 4 NIL ofnI
#======================================================================
# make GMT grd files from RDI file
@@ -16,6 +16,7 @@
# Sep 1, 2006: - fiddled with registration
# Sep 19, 2007: - adapted to new [RDI_BB_Read.pl]
# Jun 18, 2009: - BUG: xysize had been called xyside
+# Mar 17, 2016: - adapted to new Getopt library
# NOTES:
# - regular grids only => no dimensional time axis for data collected
@@ -25,7 +26,7 @@
# - implement soundspeed corretion
# - add temporal pre-averaging
-require "getopts.pl";
+use Getopt::Std;
$0 =~ m{(.*/)[^/]+};
require "$1RDI_BB_Read.pl";
require "$1RDI_Coords.pl";
@@ -123,7 +124,7 @@
die("Usage: $0 [-M)agnetic <declination>] [-r)ange <first_ens,last_ens>] " .
"[output -b)ase <name>] [-d)imensional coordinates] " .
"<RDI file>\n")
- unless (&Getopts("b:dM:r:") && @ARGV == 1);
+ unless (&getopts("b:dM:r:") && @ARGV == 1);
print(STDERR "WARNING: magnetic declination not set!\n")
unless defined($opt_M);
--- a/beamStats
+++ b/beamStats
@@ -2,9 +2,9 @@
#======================================================================
# B E A M S T A T S
# doc: Fri Aug 25 15:57:05 2006
-# dlm: Tue Mar 4 13:09:14 2014
+# dlm: Thu Mar 17 07:39:34 2016
# (c) 2006 A.M. Thurnherr
-# uE-Info: 33 64 NIL 0 0 72 0 2 4 NIL ofnI
+# uE-Info: 35 0 NIL 0 0 72 0 2 4 NIL ofnI
#======================================================================
# Split data file into per-bin time series.
@@ -31,6 +31,7 @@
# Feb 21, 2008: - BUG: had forgotten to undo debugging changes
# - removed missing magdecl warning on -b
# Mar 4, 2014: - added support for missing PITCH/ROLL/HEADING
+# Mar 17, 2016: - adapted to new Getopt library
# General Notes:
# - everything (e.g. beams) is numbered from 1
@@ -51,7 +52,7 @@
# - non-monotonic min_pcg is particularly obvious with the DYNAMUCK BM_ADCP
# data, where one of the beams performed much worse than the others
-require "getopts.pl";
+use Getopt::Std;
$0 =~ m{(.*/)[^/]+};
require "$1RDI_BB_Read.pl";
require "$1RDI_Coords.pl";
@@ -66,7 +67,7 @@
"[-%)good <min>] " .
"[output -b)eam coordinates] " .
"<RDI file>\n")
- unless (&Getopts("4abd:f:M:p:r:S:") && @ARGV == 1);
+ unless (&getopts("4abd:f:M:p:r:S:") && @ARGV == 1);
die("$0: -4 and -d are mutually exclusive\n")
if ($opt_4 && defined($opt_d));
--- a/listBins
+++ b/listBins
@@ -2,9 +2,9 @@
#======================================================================
# L I S T B I N S
# doc: Fri Aug 25 15:57:05 2006
-# dlm: Mon Feb 29 18:10:25 2016
+# dlm: Thu Mar 17 07:39:43 2016
# (c) 2006 A.M. Thurnherr
-# uE-Info: 59 63 NIL 0 0 72 10 2 4 NIL ofnI
+# uE-Info: 61 0 NIL 0 0 72 10 2 4 NIL ofnI
#======================================================================
# Split data file into per-bin time series.
@@ -57,6 +57,7 @@
# Jan 6, 2016: - -b removed (always output beamvels)
# Jan 31, 2016: - started debugging the obviously wrong Earth2Beam() transformation
# Feb 29, 2016: - continued debugging; removed debugging code
+# Mar 17, 2016: - adapted to new Getopt library
# General Notes:
# - everything (e.g. beams) is numbered from 1
@@ -84,7 +85,7 @@
# - non-monotonic min_pcg is particularly obvious with the DYNAMUCK BM_ADCP
# data, where one of the beams performed much worse than the others
-require "getopts.pl";
+use Getopt::Std;
$ADCP_tools_minVersion = 1.4;
($ADCP_TOOLS) = ($0 =~ m{(.*/)[^/]+});
@@ -99,7 +100,7 @@
"[require -4)-beam solutions] [-d)iscard <beam#>] " .
"[-p)ct-good <min>] " .
"<RDI file>\n")
- unless (&Getopts("4aB:d:M:o:p:r:P:RS:") && @ARGV == 1);
+ unless (&getopts("4aB:d:M:o:p:r:P:RS:") && @ARGV == 1);
($P{pitch_bias},$P{roll_bias}) = split('[,/]',$opt_P);
($P{velbias_b1},$P{velbias_b2},$P{velbias_b3},$P{velbias_b4}) = split('[,/]',$opt_B);
--- a/listEns
+++ b/listEns
@@ -2,9 +2,9 @@
#======================================================================
# L I S T E N S
# doc: Sat Jan 18 18:41:49 2003
-# dlm: Mon Sep 8 19:22:44 2014
+# dlm: Thu Mar 17 07:39:49 2016
# (c) 2003 A.M. Thurnherr
-# uE-Info: 244 0 NIL 0 0 72 2 2 4 NIL ofnI
+# uE-Info: 49 0 NIL 0 0 72 2 2 4 NIL ofnI
#======================================================================
# Print useful info from the ensemble list or dump ensembles to
@@ -45,13 +45,14 @@
# Mar 4, 2014: - added partial support for DATA_SOURCE_ID
# - added support for missing PITCH/ROLL/HEADING
# Sep 8, 2014: - added -B)T
+# Mar 17, 2016: - adapted to new Getopt library
# Notes:
# - -E outputs data in earth coordinates, unless -b is set also
# - -E output is always in ANTS format, ignoring -A
# - no soundspeed correction
-require "getopts.pl";
+use Getopt::Std;
$0 =~ m{(.*/)[^/]+};
require "$1RDI_BB_Read.pl";
require "$1RDI_Coords.pl";
@@ -62,7 +63,7 @@
"[write -E)nsemples <.suff> [use -B)T] [-M)agnetic <declination>] [min -p)ercent-good <#>] [keep -b)eam coords]] " .
"[-r)ange <first_ens,last_ens>] [in-w)ater ensembles only] " .
"<RDI file...>\n")
- unless (&Getopts("4ABbd:E:f:M:p:Qr:w") && $#ARGV >= 0);
+ unless (&getopts("4ABbd:E:f:M:p:Qr:w") && $#ARGV >= 0);
print(STDERR "WARNING: no soundspeed correction applied!\n");
--- a/listW
+++ b/listW
@@ -2,9 +2,9 @@
#======================================================================
# L I S T W
# doc: Wed Mar 24 06:45:09 2004
-# dlm: Mon Nov 25 18:30:33 2013
+# dlm: Thu Mar 17 07:45:02 2016
# (c) 2004 A.M. Thurnherr
-# uE-Info: 23 0 NIL 0 0 72 2 2 4 NIL ofnI
+# uE-Info: 24 49 NIL 0 0 72 0 2 4 NIL ofnI
#======================================================================
# dump vertical velocities
@@ -20,11 +20,13 @@
# Sep 19, 2007: - adapted to new [RDI_BB_Read.pl] (not tested)
# Jul 30, 2009: - NaN => nan
# Nov 25, 2013: - checkEnsemble() expunged
+# Mar 17, 2016: - removed warning
+# - updated ancient library names
$0 =~ m{(.*)/[^/]+};
-require "$1/WorkhorseBinRead.pl";
-require "$1/WorkhorseCoords.pl";
-require "$1/WorkhorseUtils.pl";
+require "$1/RDI_PD0_IO.pl";
+require "$1/RDI_Coords.pl";
+require "$1/RDI_Utils.pl";
use Getopt::Std;
@@ -204,7 +206,7 @@
sub p($) { print(defined($_[0])?"$_[0] ":"nan "); }
- if (defined(@f)) {
+ if (@f) {
foreach $f (@f) {
my($fn,$fi) = ($f =~ m{([^[]*)(\[.*)});
$fn = $f unless defined($fn);
--- a/meanProf
+++ b/meanProf
@@ -2,15 +2,16 @@
#======================================================================
# M E A N P R O F
# doc: Fri Feb 22 08:40:18 2008
-# dlm: Fri Feb 22 18:02:40 2008
+# dlm: Wed Mar 16 07:02:38 2016
# (c) 2008 A.M. Thurnherr
-# uE-Info: 232 0 NIL 0 0 72 74 2 4 NIL ofnI
+# uE-Info: 14 49 NIL 0 0 72 0 2 4 NIL ofnI
#======================================================================
# extract time-averaged mean profile from ADCP data
# HISTORY:
# Feb 22, 2008: - created from [listBins]
+# Mar 16, 2016: - adapted to new Getopt library
# Soundspeed Correction:
# - applied as described in the RDI coord-trans manual
@@ -18,7 +19,8 @@
# => - same simple correction for all velocity components
# - simple correction for cell depths
-require "getopts.pl";
+use Getopt::Std;
+
$0 =~ m{(.*/)[^/]+};
require "$1RDI_BB_Read.pl";
require "$1RDI_Coords.pl";
@@ -33,7 +35,7 @@
"[-M)agnetic <declination>] " .
"[-D)epth <depth>] " .
"<RDI file>\n")
- unless (&Getopts("4bd:D:M:p:r:QS:") && @ARGV == 1);
+ unless (&getopts("4bd:D:M:p:r:QS:") && @ARGV == 1);
die("$0: -4 and -d are mutually exclusive\n")
if ($opt_4 && defined($opt_d));
--- a/mkProfile
+++ b/mkProfile
@@ -2,9 +2,9 @@
#======================================================================
# M K P R O F I L E
# doc: Sun Jan 19 18:55:26 2003
-# dlm: Sun Mar 22 10:22:46 2015
+# dlm: Thu Mar 17 07:41:03 2016
# (c) 2003 A.M. Thurnherr
-# uE-Info: 91 63 NIL 0 0 72 10 2 4 NIL ofnI
+# uE-Info: 93 35 NIL 0 0 72 0 2 4 NIL ofnI
#======================================================================
# Make an LADCP Profile by Integrating W (similar to Firing's scan*).
@@ -89,6 +89,8 @@
# May 24, 2014: - finally added (gimbal-)pitch & roll to default output
# - renamed heading to hdg and pitchroll to tilt
# Mar 22, 2015: - made it work for moored time series as well
+# Mar 17, 2015: - adapted to new Getopt library
+# - removed warning
# NOTES:
# - the battery values are based on transmission voltages (different
@@ -108,7 +110,7 @@
require "$1/RDI_BB_Read.pl";
require "$1/RDI_Coords.pl";
require "$1/RDI_Utils.pl";
-require "getopts.pl";
+use Getopt::Std;
$USAGE = "$0 @ARGV";
die("Usage: $0 " .
@@ -120,7 +122,7 @@
"[output -f)ields <field[,...]> " .
"[-M)agnetic <declination>] [profile -B)ottom <depth>] " .
"<RDI file>\n")
- unless (&Getopts("4AB:F:M:Qd:g:r:n:e:c:f:m:p:") && @ARGV == 1);
+ unless (&getopts("4AB:F:M:Qd:g:r:n:e:c:f:m:p:") && @ARGV == 1);
$RDI_Coords::minValidVels = 4 if ($opt_4); # no 3-beam solutions
@@ -813,7 +815,7 @@
p($dta{ENSEMBLE}[$e]->{X}); p($dta{ENSEMBLE}[$e]->{X_ERR});
p($dta{ENSEMBLE}[$e]->{Y}); p($dta{ENSEMBLE}[$e]->{Y_ERR});
}
- if (defined(@f)) {
+ if (@f) {
foreach $f (@f) {
my($fn,$fi) = ($f =~ m{([^[]*)(\[.*)});
$fn = $f unless defined($fn);
--- a/scanBins
+++ b/scanBins
@@ -2,9 +2,9 @@
#======================================================================
# S C A N B I N S
# doc: Mon Jan 27 17:55:34 2003
-# dlm: Wed Sep 19 10:02:51 2007
+# dlm: Thu Mar 17 07:45:37 2016
# (c) 2003 A.M. Thurnherr
-# uE-Info: 11 24 NIL 0 0 72 2 2 4 NIL ofnI
+# uE-Info: 20 22 NIL 0 0 72 2 2 4 NIL ofnI
#======================================================================
# Collect Per-Bin Stats
@@ -13,15 +13,17 @@
# HISTORY:
# Jan 27, 2003: - created
# Sep 19, 2007: - adapted to new [RDI_BB_Read.pl] (not tested)
+# Mar 17, 2016: - adapted to new Getopt library
+# - updated ancient library name
$0 =~ m{(.*)/[^/]+};
-require "$1/WorkhorseBinRead.pl";
-require "getopts.pl";
+require "$1/RDI_PD0_IO.pl";
+use Getopt::Std;
die("Usage: $0 " .
"" .
"<RDI file>\n")
- unless (&Getopts("") && @ARGV == 1);
+ unless (&getopts("") && @ARGV == 1);
print(STDERR "Reading $ARGV[0]...");
readData($ARGV[0],\%dta); # read data