diff --git a/listBT b/listBT new file mode 100755 --- /dev/null +++ b/listBT @@ -0,0 +1,589 @@ +#!/usr/bin/perl +#====================================================================== +# L I S T B T +# doc: Sat Jan 18 18:41:49 2003 +# dlm: Sun May 23 16:33:33 2010 +# (c) 2003 A.M. Thurnherr +# uE-Info: 527 42 NIL 0 0 72 11 2 4 NIL ofnI +#====================================================================== + +# Extract Bottom-Track Data + +# NOTE: NO SOUND-SPEED CORRECTION APPLIED YET!!! + +# HISTORY: +# Jan 18, 2003: - created +# Jan 23, 2003: - added magnetic declination +# Jan 25, 2003: - continued construction +# Feb 11, 2003: - finally made it work +# Feb 12, 2003: - added default profile output +# Feb 13, 2003: - corrected raw output +# Feb 14, 2003: - added errors if instrument-BT filters are more strict +# than command-line values +# Feb 18, 2003: - removed -d dependency on -W +# Mar 3, 2003: - added -C)ompass correction +# Mar 10, 2003: - added -f)orce to allow visbeck-style post processing +# Mar 16, 2003: - added range comment +# Feb 26, 2004: - added Earth-coordinate support +# Feb 27, 2004: - made water-track calculation conditional (-E || -B) +# Mar 9, 2004: - added magnetic_declination to %PARAMs +# Apr 1, 2004: - added CTD u/v stats to %PARAMs +# Apr 2, 2004: - added CTD_msf (mean square fluctuation) stat +# Apr 3, 2004: - BUG: CTD vels were repeated for stats +# - removed non-ANTS option +# Nov 8, 2005: - UNIXTIME => UNIX_TIME +# - adapted to new binary read library +# - output editing statistics +# Aug 15, 2006: - added -b +# Aug 25, 2006: - fiddled +# Sep 19, 2007: - adapted to new [RDI_BB_Read.pl] (not tested) +# Nov 1, 2008: - BUG: sig(u) was reported instead of sig(v) +# Jul 30, 2009: - NaN => nan + +# NOTES: +# - the RDI BT data contains ranges that are greater than the +# WT ping ranges. I don't know if those data are valid! +# - there is a fair bit of heuristic used, especially in the +# reference-layer calculation +# - depth-correction (-m) is highly recommended because it allows +# much better bad-BT detection and it is required for a valid +# comparison with LADCP profiles +# - the criterion for bottom-interference of the water-track data +# is derived from Firing's [merge.c] (adding 1.5 bin lengths to +# the calculated range), modified by taking the real beam angle +# into account. +# - from the RDI manuals it is not entirely clear whether the BT range +# is given in vertical or in along-beam meters; comparison with the +# WT range (calculated from the bin with the maximum echo amplitude) +# shows that vertical meters are used + +# NOTES on quality checks: +# -a minimum BT amplitude; setting this to 50 (RDI default is 30) +# reduces the vertical range over which the bottom is detected but +# not the quality of the bottom track data; therefore, this should +# probably not be used. +# -c minimum BT correlation; the RDI default for this parameter is 220, +# which seems to work fine. +# -e max error velocity (BT & WT); this is primarily used for detecting +# good BT data, i.e. it should be set to a small value (Firing uses +# 0.1m/s in merge); if too small a value is chosen too many good +# data are discarded; note that the same error-velocity criterion +# is used to separate good from bad data when mean profiles are +# constructed. +# -w max difference between reference-layer w and BT w; this is a +# powerful criterion for determining good BT data; I like a value of +# 0.03 m/s. +# -d when the depth is corrected (-m) the... + +$0 =~ m{(.*)/[^/]+}; +require "$1/RDI_BB_Read.pl"; +require "$1/RDI_Coords.pl"; +require "$1/RDI_Utils.pl"; +use Getopt::Std; + +$USAGE = "$0 @ARGV"; +die("Usage: $0 " . + "[use -b)ins <1st,last>] " . + "[write -R)aw data] [write -B)T data] " . + "[write -E)nsembles ] [-F)ilter ensembles