V1.2beta5
authorA.M. Thurnherr <athurnherr@yahoo.com>
Thu, 17 Mar 2016 07:50:24 -0400
changeset 41 6bddb82924e3
parent 40 408fc95bcff8
child 42 f7690c7b92e0
V1.2beta5
HISTORY
LADCP_VKE
LADCP_w_CTD
LADCP_w_howto.pdf
LADCP_w_ocean
LADCP_w_postproc
plot_backscatter.pl
plot_correlation.pl
plot_mean_residuals.pl
plot_residuals.pl
plot_time_lags.pl
plot_wprof.pl
plot_wsamp.pl
version.pl
--- a/HISTORY	Wed Mar 16 08:25:32 2016 -0400
+++ b/HISTORY	Thu Mar 17 07:50:24 2016 -0400
@@ -1,9 +1,9 @@
 ======================================================================
                     H I S T O R Y 
                     doc: Mon Oct 12 16:09:24 2015
-                    dlm: Wed Mar 16 08:25:15 2016
+                    dlm: Thu Mar 17 07:50:06 2016
                     (c) 2015 A.M. Thurnherr
-                    uE-Info: 60 0 NIL 0 0 72 3 2 4 NIL ofnI
+                    uE-Info: 67 19 NIL 0 0 72 3 2 4 NIL ofnI
 ======================================================================
 
 V1.0:
@@ -58,5 +58,11 @@
 		- updated howto
 	Mar 16, 2016: V1.2beta4
 		- published on server		
+		- updated [version.pl] to beta5 (gmt5)
+		- adapted to GMT5
+	Mar 17, 2016: V1.2beta5
+		- updated [.hg/hgrc]
+		- various plot improvements
+		- updated howto
+		- published
 		
-		
--- a/LADCP_VKE	Wed Mar 16 08:25:32 2016 -0400
+++ b/LADCP_VKE	Thu Mar 17 07:50:24 2016 -0400
@@ -2,9 +2,9 @@
 #======================================================================
 #                    L A D C P _ V K E 
 #                    doc: Tue Oct 14 11:05:16 2014 
-#                    dlm: Tue Mar  8 15:55:52 2016
+#                    dlm: Thu Mar 17 06:57:09 2016
 #                    (c) 2012 A.M. Thurnherr
-#                    uE-Info: 48 0 NIL 0 0 72 2 2 4 NIL ofnI
+#                    uE-Info: 429 49 NIL 0 0 72 2 2 4 NIL ofnI
 #======================================================================
 
 $antsSummary = 'calculate VKE from LADCP-derived vertical-velocity profiles';
@@ -49,6 +49,7 @@
 #				  - changed default output filenames for -d and -u
 #				  - removed ./ from figure label
 #				  - update ANTSlib to 6.3
+#	Mar 16, 2016: - adapted to gmt5
 
 ($ANTSLIB) = (`which ANTSlib` =~ m{^(.*)/[^/]*$});
 ($WCALC)   = ($0              =~ m{^(.*)/[^/]*$});
@@ -342,7 +343,7 @@
 		my($R) = 0;																# RGB map
 		my($G) = int(200*(1-$r/@ants_));
 		my($B) = ($r < @ants_/2) ? 150 : int(100+100*(1-$r/@ants_));
-		GMT_psxy("-W8,$R/$G/$B");
+		GMT_psxy("-W1,$R/$G/$B");
 		for (my($f)=$pg_fmin+1; $f<$pg_fmin+$nfreq; $f++) {						# avg & plot high-quality spectra only
 			next unless numberp($ants_[$r][$f]) && numberp($ants_[$r][$p0f]);	#	- omit zero wavenumber ($pg_fmin)
 			next unless numberp($ants_[$r][$wepsf]);
@@ -351,7 +352,7 @@
 			$nGoodPwr[$f]++;
 			$sumGoodPwr[$f] += $ants_[$r][$f]/$ants_[$r][$p0f];
 		}
-		GMT_psxy("-W4,$R/$G/$B,.");												# avg & plot all spectra with dots
+		GMT_psxy("-W1,$R/$G/$B,.");												# avg & plot all spectra with dots
 		for (my($f)=$pg_fmin+1; $f<$pg_fmin+$nfreq; $f++) {
 			next unless numberp($ants_[$r][$f]) && numberp($ants_[$r][$p0f]);
 			my($k) = antsParam(sprintf("k.%d",$f-$pg_fmin));
@@ -398,7 +399,7 @@
 
 if (defined($opt_p)) {															# complete plot
 	if (@nPwr) {
-		GMT_psxy('-W10,255/100/100,.');											# plot mean spectrum; dotted; entire range
+		GMT_psxy('-W2,255/100/100,.');											# plot mean spectrum; dotted; entire range
 		for (my($f)=$fs_fmin; $f<=$fs_fmax; $f++) {
 			my($k) = antsParam(sprintf("k.%d",$f-$pg_fmin));
 			printf(GMT "$k %g\n",$sumPwr[$f]/$nPwr[$f]);
@@ -406,12 +407,12 @@
 	}
 
 	if (@nGoodPwr) {
-		GMT_psxy('-W4/255/100/100');											# plot mean spectrum; entire range
+		GMT_psxy('-W1,255/100/100');											# plot mean spectrum; entire range
 		for (my($f)=$pg_fmin+1; $f<$pg_fmin+$nfreq; $f++) {
 			my($k) = antsParam(sprintf("k.%d",$f-$pg_fmin));
 			printf(GMT "$k %g\n",$sumGoodPwr[$f]/$nGoodPwr[$f]);
 		}
-		GMT_psxy('-W16/255/100/100');											# plot mean fs spectrum (heavy)
+		GMT_psxy('-W4,255/100/100');											# plot mean fs spectrum (heavy)
 		for (my($f)=$fs_fmin; $f<=$fs_fmax; $f++) {
 			my($k) = antsParam(sprintf("k.%d",$f-$pg_fmin));
 			printf(GMT "$k %g\n",$sumGoodPwr[$f]/$nGoodPwr[$f]);
@@ -425,23 +426,25 @@
 	GMT_psbasemap('-B3:"Vertical Wavelength [m]:N"');
 
 	GMT_unitcoords_logscale();													# print profile number 
-	GMT_pstext('-Gblue');
-	if (defined($outfile)) { printf(GMT "0.98 0.02 14 0 0 BR $outfile [$P{run_label}] %s\n",antsParam('input_data')); }
-	else { printf(GMT "0.98 0.02 14 0 0 BR %03d [$P{run_label}] %s\n",antsParam('profile_id'),antsParam('input_data')); }
+	GMT_pstext('-F+f14,Helvetica,blue+jBR -Gwhite');
+	if (defined($outfile)) { printf(GMT "0.98 0.02 $outfile [$P{run_label}] %s\n",antsParam('input_data')); }
+	else { printf(GMT "0.98 0.02 %03d [$P{run_label}] %s\n",antsParam('profile_id'),antsParam('input_data')); }
+	GMT_pstext('-F+f9,Helvetica,orange+jTR -N -Gwhite');
+		print(GMT "0.99 0.99 V$VERSION\n");
 
-	GMT_set('ANNOT_FONT_SIZE_PRIMARY 10','ANNOT_OFFSET_PRIMARY 0.01c',			# eps profile inset
-			'LABEL_FONT_SIZE 10','LABEL_OFFSET 0');
+	GMT_set('FONT_ANNOT_PRIMARY 10','MAP_ANNOT_OFFSET_PRIMARY 0.01c',			# eps profile inset
+			'FONT_LABEL 10','MAP_LABEL_OFFSET 0.2c');
 	$min_depth = 400 if ($min_depth > 1e4);
 	$max_depth = 1500 if ($max_depth < 0);
 	GMT_setR(sprintf("-R5e-13/1e-7/%d/%d",round($min_depth-250,500),round($max_depth+250,500))); 
 	GMT_setJ(sprintf('-JX%fl/-%f',$plotsize/2.2,$plotsize/2.2));
 	GMT_psbasemap('-X0.3 -Y0.3 -Bg1a1f3p:"@~e@~@-VKE@- [W kg@+-1@+]":/g1000a500f100:"Depth [m]":wEsN');
-	GMT_psxy('-M');
+	GMT_psxy();
 	for (my($r)=0; $r<@ants_; $r++) {
 		next unless numberp($ants_[$r][$wepsf]);
 		my($R) = 0; my($G) = int(200*(1-$r/@ants_));
 		my($B) = ($r < @ants_/2) ? 150 : int(100+100*(1-$r/@ants_));
-		print(GMT "> -W12,$R/$G/$B\n");
+		print(GMT "> -W2,$R/$G/$B\n");
 		print(GMT "$ants_[$r][$wepsf] $ants_[$r][$mindf]\n");
 		print(GMT "$ants_[$r][$wepsf] $ants_[$r][$maxdf]\n");
 	}
--- a/LADCP_w_CTD	Wed Mar 16 08:25:32 2016 -0400
+++ b/LADCP_w_CTD	Thu Mar 17 07:50:24 2016 -0400
@@ -2,9 +2,9 @@
 #======================================================================
 #                    L A D C P _ W _ C T D 
 #                    doc: Mon Nov  3 17:34:19 2014
-#                    dlm: Sun Mar 13 15:00:12 2016
+#                    dlm: Wed Mar 16 17:06:21 2016
 #                    (c) 2014 A.M. Thurnherr
-#                    uE-Info: 57 52 NIL 0 0 72 2 2 4 NIL ofnI
+#                    uE-Info: 598 40 NIL 0 0 72 2 2 4 NIL ofnI
 #======================================================================
 
 $antsSummary = 'pre-process SBE 9plus CTD data for LADCP_w';
@@ -55,6 +55,7 @@
 #	Mar 13, 2016: - added simple ASCII file format
 #				  - BUG: Layout error when input had no lat/lon
 #				  - added lon to simple ASCII format
+#	Mar 16, 2016: - adapted to gmt5
 
 ($ANTS)  = (`which ANTSlib`   =~ m{^(.*)/[^/]*$});
 ($WCALC) = ($0                =~ m{^(.*)/[^/]*$});
@@ -585,18 +586,18 @@
 	my($ymin) = -3; my($ymax) = 3;
 	my($plotsize) = '13c';
 	GMT_begin(sprintf($pfmt[0],$id),"-JX${plotsize}","-R$xmin/$xmax/$ymin/$ymax",'-X6 -Y4 -P');
-	GMT_psxy('-W2,255/127/80');
+	GMT_psxy('-W1,coral');
 	for ($r=0; $r<@w; $r++) {
 		printf(GMT "%f %f\n",$elapsed[$r]/60,$w_lp[2*$r]/@w_lp);
-		GMT_psxy('-W2,46/139/87') if ($r == $atBtm);
+		GMT_psxy('-W1,SeaGreen') if ($r == $atBtm);
 	}
 	GMT_psbasemap('-Bg60a30f5:"Elapsed Time [min]":/g1a1f0.1:"Vertical Package Velocity [ms@+-1@+]":WeSn');
 	GMT_unitcoords();
-	GMT_pstext('-G255/127/80'); print(GMT "0.98 0.98 14 0 0 TR dc\n");
-	GMT_pstext('-G46/139/87');  print(GMT "0.98 0.94 14 0 0 TR uc\n");
-	GMT_pstext('-Gblue');
-	if (defined($outfile)) { printf(GMT "0.02 0.02 14 0 0 BL $outfile\n",$id); }
-	else 				   { printf(GMT "0.02 0.02 14 0 0 BL %03d\n",$id); }
+	GMT_pstext('-F+f14,Helvetica,coral+jTR'); 	  print(GMT "0.98 0.98 dc\n");
+	GMT_pstext('-F+f14,Helvetica,SeaGreen+jTR');  print(GMT "0.98 0.94 uc\n");
+	GMT_pstext('-F+f14,Helvetica,blue+jTL -N');
+	if (defined($outfile)) { printf(GMT "0.01 1.06 $outfile\n",$id); }
+	else 				   { printf(GMT "0.01 1.06 %03d\n",$id); }
 	GMT_end();	                
 
 	my($xmin) = round($min_sspd-3,5);
@@ -605,17 +606,17 @@
 	my($plotsize) = '13c';
 	GMT_begin(sprintf($pfmt[1],$id),"-JX${plotsize}/-${plotsize}","-R$xmin/$xmax/$ymin/$ymax",'-X6 -Y4 -P');
 	GMT_psbasemap('-Bg10a10f1:"Speed of Sound [m/s]":/g1000a500f100:"Depth [m]":WeSn');
-	GMT_psxy('-W8,255/127/80');
+	GMT_psxy('-W2,coral');
 	for ($r=0; $r<@w; $r++) {
 		printf(GMT "%f %f\n",$sspd[$r],$depth[$r]);
-		GMT_psxy('-W6,46/139/87') if ($r == $atBtm);
+		GMT_psxy('-W1.5,SeaGreen') if ($r == $atBtm);
 	}
 	GMT_unitcoords();
-	GMT_pstext('-G255/127/80'); print(GMT "0.98 0.02 14 0 0 TR dc\n");
-	GMT_pstext('-G46/139/87');  print(GMT "0.98 0.06 14 0 0 TR uc\n");
-	GMT_pstext('-Gblue');
-	if (defined($outfile)) { printf(GMT "0.02 0.98 14 0 0 BL $outfile\n",$id); }
-	else 				   { printf(GMT "0.02 0.98 14 0 0 BL %03d\n",$id); }
+	GMT_pstext('-F+f14,Helvetica,coral+jTR'); 	print(GMT "0.98 0.02 dc\n");
+	GMT_pstext('-F+f14,Helvetica,SeaGreen+jTR');  print(GMT "0.98 0.06 uc\n");
+	GMT_pstext('-F+f14,Helvetica,blue+jTL -N');
+	if (defined($outfile)) { printf(GMT "0.01 -0.06 $outfile\n",$id); }
+	else 				   { printf(GMT "0.01 -0.06 %03d\n",$id); }
 	GMT_end();	                
 }
 
Binary file LADCP_w_howto.pdf has changed
--- a/LADCP_w_ocean	Wed Mar 16 08:25:32 2016 -0400
+++ b/LADCP_w_ocean	Thu Mar 17 07:50:24 2016 -0400
@@ -2,14 +2,13 @@
 #======================================================================
 #                    L A D C P _ W _ O C E A N 
 #                    doc: Fri Dec 17 18:11:13 2010
-#                    dlm: Sun Mar 13 15:08:59 2016
+#                    dlm: Thu Mar 17 05:55:25 2016
 #                    (c) 2010 A.M. Thurnherr
-#                    uE-Info: 473 122 NIL 0 3 72 0 2 4 NIL ofnI
+#                    uE-Info: 229 64 NIL 0 0 72 2 2 4 NIL ofnI
 #======================================================================
 
 # TODO:
 #	! plots:
-#		- make blue labels consistent
 #		- avoid over-plotting axis labels
 #		- allow for different nsamp magnitudes
 #		- add "dc" "uc" labels
@@ -225,6 +224,9 @@
 #	Mar  9, 2016: - added hab field to .wprof output
 #	Mar 13, 2016: - cleaned up warnings created before LADCP_file is defined
 #				  - added sanity checks and warnings
+#	Mar 17, 2016: - added {dc,uc}_rms_{tilt,w_pkg}
+#				  - replaced a couple of **2 by &SQR()
+#				  - replaced %ADCP_orientation values by DL & UL
 # HISTORY END
 
 # CTD REQUIREMENTS
@@ -765,11 +767,27 @@
 	last;
 }
 
+my($dc_sumsq,$dc_n,$uc_sumsq,$uc_n) = (0,0,0,0);
 $fprm = $pte = 0;
 for ($ens=0; $ens<=$#{$LADCP{ENSEMBLE}}; $ens++) {
-	$pte += editTilt($ens,$opt_t);
+	my($ne) = editTilt($ens,$opt_t);
+	if ($ne == 0) {
+		if ($ens <= $LADCP_atbottom) {
+			$dc_sumsq += &SQR($LADCP{ENSEMBLE}[$ens]->{TILT});
+			$dc_n++;
+        } else {
+			$uc_sumsq += &SQR($LADCP{ENSEMBLE}[$ens]->{TILT});
+			$uc_n++;
+        }
+    } else {
+		$pte += $ne;
+    }
 	$fprm += editFarBins($ens,$first_bad_bin) if defined($first_bad_bin);
 }
+my($dc_rms_tilt) = ($dc_n > 0) ? sqrt($dc_sumsq/$dc_n) : nan;
+my($uc_rms_tilt) = ($uc_n > 0) ? sqrt($uc_sumsq/$uc_n) : nan;
+&antsAddParams('dc_rms_tilt',$dc_rms_tilt,'uc_rms_tilt',$uc_rms_tilt);
+
 progress("\tattitude threshold (max_tilt = %d deg): %d velocites removed (%d%% of total)\n",
 	$opt_t,$pte,round(100*$pte/$nvv));
 progress("\tvelocities beyond bin $first_bad_bin (<%d%% valid values): %d velocites removed (%d%% of total in bins $LADCP_firstBin-$LADCP_lastBin)\n",
@@ -814,7 +832,7 @@
 $CTD{W_tt}[0] = $CTD{W_tt}[@{$CTD{ELAPSED}}] = nan;
 for (my($s)=1; $s<@{$CTD{ELAPSED}}-1; $s++) {								# centered differences for both
 	$CTD{W_t} [$s] = ($CTD{W}[$s+1] - $CTD{W}[$s-1]) / (2*$CTD{DT});
-	$CTD{W_tt}[$s] = ($CTD{W}[$s+1] + $CTD{W}[$s-1] - 2*$CTD{W}[$s]) / $CTD{DT}**2;
+	$CTD{W_tt}[$s] = ($CTD{W}[$s+1] + $CTD{W}[$s-1] - 2*$CTD{W}[$s]) / &SQR($CTD{DT});
 }
 
 error("$0: CTD start depth must be numeric\n")
@@ -958,6 +976,7 @@
 my($cli) = 0;																	# current-lag index
 my($lag) = $CTD_time_lag[$cli];													# current lag
 
+my($dc_sumsq,$dc_n,$uc_sumsq,$uc_n) = (0,0,0,0);								# for w_pkg calcs
 for (my($skipped)=0,my($ens)=$firstGoodEns; $ens<=$lastGoodEns; $ens++) {
 
 	if ($ens > $CTD_tl_toEns[$cli]) {											# use correct lag piece
@@ -999,6 +1018,11 @@
 				unless ($CTD{DEPTH}[$scan] >= 0);
 		$LADCP{ENSEMBLE}[$ens]->{CTD_DEPTH} = $CTD{DEPTH}[$scan];
 		$LADCP{ENSEMBLE}[$ens]->{CTD_SCAN} = $scan;
+		if ($ens <= $LADCP_atbottom) {
+			$dc_sumsq += &SQR($CTD{W}[$scan]); $dc_n++;
+        } else {
+			$uc_sumsq += &SQR($CTD{W}[$scan]); $uc_n++;
+		}
 		my($reflr_ocean_w) = $LADCP{ENSEMBLE}[$ens]->{REFLR_W} - $CTD{W}[$scan];
 		if (abs($reflr_ocean_w) <= $w_max_lim) {
 			$sumWsq += &SQR($reflr_ocean_w);
@@ -1016,6 +1040,10 @@
 	    undef($LADCP{ENSEMBLE}[$ens]->{CTD_DEPTH});						# old DEPTH from calcLADCPts() must be removed
 	}
 }
+
+my($dc_rms_wpkg) = ($dc_n > 0) ? sqrt($dc_sumsq / $dc_n) : nan;			# rms package velocity
+my($uc_rms_wpkg) = ($uc_n > 0) ? sqrt($uc_sumsq / $uc_n) : nan;
+&antsAddParams('dc_rms_w_pkg',$dc_rms_wpkg,'uc_rms_w_pkg',$uc_rms_wpkg);
 	
 if ($nWsq > 0 && $nWsqI > 0) {
 	&antsAddParams('rms_w_reflr_err',sqrt($sumWsq/$nWsq),'rms_w_reflr_err_interior',sqrt($sumWsqI/$nWsqI));
@@ -1111,7 +1139,7 @@
 }
 	
 if ($LADCP{ENSEMBLE}[$LADCP_atbottom]->{XDUCER_FACING_DOWN}) {				# DOWNLOOKER
-	&antsAddParams('ADCP_orientation','downlooker');
+	&antsAddParams('ADCP_orientation','DL');
 
 	if (defined($water_depth)) {
 		progress("Editing data to remove sidelobe interference from seabed...\n");
@@ -1149,7 +1177,7 @@
 	}
 	
 } else {																	# UPLOOKER
-	&antsAddParams('ADCP_orientation','uplooker');
+	&antsAddParams('ADCP_orientation','UL');
 
 	progress("Editing data to remove sidelobe interference from sea surface...\n");
 	($nvrm,$nerm) = editSideLobes($firstGoodEns,$lastGoodEns,undef);
--- a/LADCP_w_postproc	Wed Mar 16 08:25:32 2016 -0400
+++ b/LADCP_w_postproc	Thu Mar 17 07:50:24 2016 -0400
@@ -2,9 +2,9 @@
 #======================================================================
 #                    L A D C P _ W _ P O S T P R O C 
 #                    doc: Fri Apr 24 17:15:59 2015
-#                    dlm: Wed Mar  9 17:20:46 2016
+#                    dlm: Thu Mar 17 06:50:38 2016
 #                    (c) 2015 A.M. Thurnherr
-#                    uE-Info: 510 1 NIL 0 0 72 2 2 4 NIL ofnI
+#                    uE-Info: 325 30 NIL 0 0 72 2 2 4 NIL ofnI
 #======================================================================
 
 $antsSummary = 'edit and re-grid LADCP vertical-velocity samples';
@@ -60,6 +60,7 @@
 #					output
 #	Mar  7, 2016: - BUG: correlation stats were defined/used for single-head data
 #				  - removed good_bins() from library as -v allows more control
+#	Mar 16, 2016: - adapted to gmt5
 
 ($ANTS)  = (`which ANTSlib` =~ m{^(.*)/[^/]*$});
 ($WCALC) = ($0              =~ m{^(.*)/[^/]*$});
@@ -304,8 +305,8 @@
 
 my($R,$R2);
 if (defined($opt_p)) {												# begin summary plot
-	$xmin = -0.1; $x2min = -200;
-	$xmax = 0.35; $x2max =	200;
+	$xmin = -0.1; $x2min = -700;
+	$xmax = 0.35; $x2max =	500;
 	$ymin =  0;
 	$ymax = antsParam('water_depth');
 	$ymax = antsRequireParam('max_depth') unless numberp($ymax);
@@ -313,15 +314,15 @@
 	$R	= "-R$xmin/$xmax/$ymin/$ymax";
 	$R2 = "-R$x2min/$x2max/$ymin/$ymax";
 	GMT_begin(sprintf($sumPF,$id),"-JX$plotsize/-$plotsize",$R,'-P -X6 -Y4');
-	GMT_psxy('-W1');
+	GMT_psxy('-W0.5');
 	print(GMT "0 $ymin\n0 $ymax");
 	GMT_psxy('-L -G200');
 	print(GMT "0.07 $ymin\n0.07 $ymax\n0.18 $ymax\n0.18 $ymin\n");
 	GMT_setR($R2);
-	GMT_psxy('-M -W1');
+	GMT_psxy('-W0.5');
 	print(GMT ">\n50 $ymin\n50 $ymax\n");
-	print(GMT ">\n100 $ymin\n100 $ymax\n");
-	print(GMT ">\n150 $ymin\n150 $ymax\n");
+	print(GMT ">\n250 $ymin\n250 $ymax\n");
+	print(GMT ">\n450 $ymin\n450 $ymax\n");
 	GMT_setR($R);
 
 	if (defined($opt_b)) {
@@ -337,7 +338,7 @@
 		croak("$opt_b: file-layout error\n")
 			unless defined($BTdf) && defined($BTwf) &&
 				   defined($BTmf) && defined($BTnf);
-		GMT_psxy('-W6');
+		GMT_psxy('-W1.5');
 		while (@BT = &antsFileIn(BT)) {
 			next unless numberp($BT[$BTwf]);
 			printf(GMT "%f %f\n",$BT[$BTwf],$BT[$BTdf]);
@@ -415,11 +416,11 @@
 		}
 
 		if (defined($opt_p)) {													# 2nd file in dual-head profile => plot 1st
-			GMT_psxy('-W2,255/127/80,-');
+			GMT_psxy('-W1,coral,-');
 			for (my($bi)=0; $bi<=$#dcw1; $bi++) {
 				printf(GMT "%f %f\n",$DL_dc_median[$bi],($bi+0.5)*$opt_o);
 			}
-			GMT_psxy('-W2,46/139/87,-');
+			GMT_psxy('-W1,SeaGreen,-');
 			for (my($bi)=0; $bi<=$#ucw1; $bi++) {
 				printf(GMT "%f %f\n",$DL_uc_median[$bi],($bi+0.5)*$opt_o);
 			}
@@ -469,11 +470,11 @@
 				   'dc_residual_stddev',$dc_rsig,'uc_residual_stddev',$uc_rsig);
 
 	if (defined($opt_p)) {														# plot 2nd-instrument profiles
-		GMT_psxy('-W2,255/127/80,.');
+		GMT_psxy('-W1,coral,.');
 		for (my($bi)=0; $bi<=$#dcw1; $bi++) {
 			printf(GMT "%f %f\n",$UL_dc_median[$bi],($bi+0.5)*$opt_o);
 		}
-		GMT_psxy('-W2,46/139/87,.');
+		GMT_psxy('-W1,SeaGreen,.');
 		for (my($bi)=0; $bi<=$#ucw1; $bi++) {
 			printf(GMT "%f %f\n",$UL_uc_median[$bi],($bi+0.5)*$opt_o);
 		}
@@ -533,64 +534,64 @@
 
 if (defined($opt_p)) {																# complete summary plot
 	if ($dual_head) {
-		GMT_psxy('-W2/100/100/255');												# surface layer limit
+		GMT_psxy('-W1,100/100/255');												# surface layer limit
 			print(GMT "-0.1 $opt_s\n0.07 $opt_s\n");
 		if ($dc_R < 0.3 || !numberp($dc_R)) {										# correlation statistics
 			&antsInfo("WARNING: low dc correlation (r = %.1f) between UL and DL data",$dc_R);
-			GMT_pstext('-Gwhite -Wred');
-		} elsif ($dc_R < 0.5) { 	GMT_pstext('-Gblack -Wyellow'); }
-		else {						GMT_pstext('-Gblack -Wgreen'); }
-	        printf(GMT "%f %f 12 0 0 BL %.1f\n",-0.07,0.9*$ymax,$dc_R);
+			GMT_pstext('-F+f12,Helvetica,white+jBL -Gred');
+		} elsif ($dc_R < 0.5) { 	GMT_pstext('-F+f12,Helvetica,black+jBL -Gyellow'); }
+		else {						GMT_pstext('-F+f12,Helvetica,black+jBL -Ggreen'); }
+	        printf(GMT "%f %f %.1f\n",-0.07,0.94*$ymax,$dc_R);
 	}
-	GMT_pstext('-G255/127/80');
-		printf(GMT "%f %f 12 0 0 BL dc\n",-0.095,0.9*$ymax);
-		printf(GMT "%f %f 12 0 0 BL [%.1f/%.1f cm/s @~s@~\@-e/r\@-]\n",
-			0.02,0.9*$ymax,100*$dc_esig,100*$dc_rsig) if ($dual_head);
+	GMT_pstext('-F+f12,Helvetica,coral+jBL');
+		printf(GMT "%f %f dc\n",-0.095,0.94*$ymax);
+		printf(GMT "%f %f [%.1f/%.1f cm/s @~s@~\@-e/r\@-]\n",
+			0.02,0.94*$ymax,100*$dc_esig,100*$dc_rsig) if ($dual_head);
 	if ($dual_head) {
 		if ($uc_R < 0.3 || !numberp($uc_R)) {
 			&antsInfo("WARNING: low uc correlation (r = %.1f) between UL and DL data",$uc_R);
-			GMT_pstext('-Gwhite -Wred');
-		} elsif ($uc_R < 0.5) { 	GMT_pstext('-Gblack -Wyellow'); }
-		else {						GMT_pstext('-Gblack -Wgreen'); }
-	        printf(GMT "%f %f 12 0 0 BL %.1f\n",-0.07,0.95*$ymax,$uc_R);
+			GMT_pstext('-F+f12,Helvetica,white+jBL -Gred');
+		} elsif ($uc_R < 0.5) { 	GMT_pstext('-F+f12,Helvetica,black+jBL -Gyellow'); }
+		else {						GMT_pstext('-F+f12,Helvetica,black+jBL -Ggreen'); }
+	        printf(GMT "%f %f %.1f\n",-0.07,0.98*$ymax,$uc_R);
 	}
-	GMT_pstext('-G46/139/87');
-		printf(GMT "%f %f 12 0 0 BL uc\n",-0.095,0.95*$ymax);
-		printf(GMT "%f %f 12 0 0 BL [%.1f/%.1f cm/s @~s@~\@-e/r\@-]\n",
-			0.02,0.95*$ymax,100*$uc_esig,100*$uc_rsig) if ($dual_head);
+	GMT_pstext('-F+f12,Helvetica,SeaGreen+jBL');
+		printf(GMT "%f %f uc\n",-0.095,0.98*$ymax);
+		printf(GMT "%f %f [%.1f/%.1f cm/s @~s@~\@-e/r\@-]\n",
+			0.02,0.98*$ymax,100*$uc_esig,100*$uc_rsig) if ($dual_head);
 
 	GMT_setR($R);
 
-	GMT_psxy('-W4,255/127/80');														# median profiles
+	GMT_psxy('-W1.5,coral');														# median profiles
 	for (my($bi)=0; $bi<=$#dcw; $bi++) {
 		printf(GMT "%f %f\n",(($dcns[$bi]>=$opt_k)?$dcwm[$bi]:nan),($bi+0.5)*$opt_o);
 	}
-	GMT_psxy('-W4,46/139/87');
+	GMT_psxy('-W1.5,SeaGreen');
 	for (my($bi)=0; $bi<=$#ucw; $bi++) {
 		printf(GMT "%f %f\n",(($ucns[$bi]>=$opt_k)?$ucwm[$bi]:nan),($bi+0.5)*$opt_o);
 	}
 
-	GMT_psxy('-Sc0.1 -G255/127/80');												# m.a.d. profiles
+	GMT_psxy('-Sc0.1 -Gcoral');												# m.a.d. profiles
 	for (my($bi)=0; $bi<=$#dcw; $bi++) {
 		printf(GMT "%f %f\n",(($dcns[$bi]>=$opt_k)?$dcwmad[$bi]:nan),($bi+0.5)*$opt_o);
 	}
-	GMT_psxy('-Sc0.1 -G46/139/87');
+	GMT_psxy('-Sc0.1 -GSeaGreen');
 	for (my($bi)=0; $bi<=$#ucw; $bi++) {
 		printf(GMT "%f %f\n",(($ucns[$bi]>=$opt_k)?$ucwmad[$bi]:nan),($bi+0.5)*$opt_o);
 	}
 
 	GMT_setR($R2);
-	GMT_psxy('-Mn -W1,255/127/80');
+	GMT_psxy('-W0.7,coral');
 	for (my($bi)=0; $bi<=$#dcw; $bi++) {											# number of samples
 		printf(GMT "%f %f\n",$dcns[$bi],($bi+0.5)*$opt_o);
 	}
-	GMT_psxy('-Mn -W1,46/139/87');
+	GMT_psxy('-W0.7,SeaGreen');
 	for (my($bi)=0; $bi<=$#dcw; $bi++) {
 		printf(GMT "%f %f\n",$ucns[$bi],($bi+0.5)*$opt_o);
 	}
 
-	GMT_psbasemap('-Bf10a1000-950:"                                     # of Samples":N');
-	GMT_psbasemap('-Ba1000-900N'); GMT_psbasemap('-Ba1000-850N');
+	GMT_psbasemap('-Bf10a1000-950:"                                                  # of Samples":N');
+	GMT_psbasemap('-Ba2000-1550N'); GMT_psbasemap('-Ba1000-750N');
 
 	$depth_tics = ($ymax-$ymin< 1000) ? 'f10a100' : 'f100a500';
 	GMT_setR($R);
@@ -599,11 +600,14 @@
 	GMT_psbasemap('-Ba10-9.95S'); GMT_psbasemap('-Ba10-9.85S');
 
 	GMT_setR('-R0/1/0/1');
-	GMT_pstext('-Gblue -N');
-	if (defined($outfile)) { print(GMT "0.01 -0.06 14 0 0 TL $outfile [$P{run_label}]\n"); }
-	else { printf(GMT "0.01 -0.06 14 0 0 TL %03d\n [$P{run_label}]",$id); }
-	GMT_pstext();
-	print(GMT '0.62 0.98 12 0 0 MR m.a.d.');
+	GMT_pstext('-F+f14,Helvetica,blue+jTL -N');
+	if (defined($outfile)) { print(GMT "0.01 -0.06 $outfile [$P{run_label}]\n"); }
+	else { 					printf(GMT "0.01 -0.06 %03d\n [$P{run_label}]",$id); }
+	GMT_pstext('-F+f12,Helvetica+jMR');
+		print(GMT '0.62 0.98 m.a.d.');
+	GMT_pstext('-F+f9,Helvetica,orange+jTR -N -Gwhite');
+		print(GMT "0.99 0.01 V$VERSION\n");
+        
 	GMT_end();
 
 	if ($dual_head) {																# correlation plot
@@ -631,39 +635,39 @@
 							 $mwm,		 $mwm,
 							 $mwm-0.01,	 $mwm);
 													   
-		GMT_psxy('-W4,grey50');
+		GMT_psxy('-W2,grey50');
 			print(GMT "-$mwm -$mwm\n$mwm $mwm\n");
-		GMT_psxy('-Sc0.12c -G255/127/80 -W1,blue,-');
+		GMT_psxy('-Sc0.12c -Gcoral -W0.3,blue');
 			for (my($bi)=0; $bi<@DL_dc_median; $bi++) {
 				next unless numberp($DL_dc_median[$bi]) && numberp($UL_dc_median[$bi]);
 				my($depth) = ($bi+0.5)*$opt_o;
 				last if ($depth > $opt_s);
 				print(GMT "$DL_dc_median[$bi] $UL_dc_median[$bi]\n");
 	        }
-		GMT_psxy('-Sc0.12c -G255/127/80');
+		GMT_psxy('-Sc0.12c -Gcoral');
 			for (my($bi)=0; $bi<@DL_dc_median; $bi++) {
 				next unless numberp($DL_dc_median[$bi]) && numberp($UL_dc_median[$bi]);
 				my($depth) = ($bi+0.5)*$opt_o;
 				next unless ($depth > $opt_s);
 				print(GMT "$DL_dc_median[$bi] $UL_dc_median[$bi]\n");
 	        }
-		GMT_psxy('-Sc0.12c -G46/139/87 -W1,blue,-');
+		GMT_psxy('-Sc0.12c -GSeaGreen -W0.3,blue');
 			for (my($bi)=0; $bi<@DL_uc_median; $bi++) {
 				next unless numberp($DL_uc_median[$bi]) && numberp($UL_uc_median[$bi]);
 				my($depth) = ($bi+0.5)*$opt_o;
 				last if ($depth > $opt_s);
 				print(GMT "$DL_uc_median[$bi] $UL_uc_median[$bi]\n");
 	        }
-		GMT_psxy('-Sc0.12c -G46/139/87');
+		GMT_psxy('-Sc0.12c -GSeaGreen');
 			for (my($bi)=0; $bi<@DL_uc_median; $bi++) {
 				next unless numberp($DL_uc_median[$bi]) && numberp($UL_uc_median[$bi]);
 				my($depth) = ($bi+0.5)*$opt_o;
 				next unless ($depth > $opt_s);
 				print(GMT "$DL_uc_median[$bi] $UL_uc_median[$bi]\n");
 	        }
-		GMT_pstext('-Gblue -N');
-			if (defined($outfile)) { printf(GMT "%f %f 14 0 0 TL $outfile [$P{run_label}]\n",-$mwm,1.1*$mwm); }
-		    else { 					 printf(GMT "%f %f 14 0 0 TL %03d\n [$P{run_label}]",$id,-$mwm,1.1*$wmw); }
+		GMT_pstext('-F+f14,Helvetica,blue+jTL -N');
+			if (defined($outfile)) { printf(GMT "%f %f $outfile [$P{run_label}]\n",-$mwm,1.1*$mwm); }
+		    else { 					 printf(GMT "%f %f %03d\n [$P{run_label}]",$id,-$mwm,1.1*$wmw); }
 		GMT_psbasemap('-Bf0.01a0.05:"DL Vertical Velocity [m/s]":/f0.01a0.05:"UL Vertical Velocity [m/s]":WeSn');
 		GMT_end();
 		
--- a/plot_backscatter.pl	Wed Mar 16 08:25:32 2016 -0400
+++ b/plot_backscatter.pl	Thu Mar 17 07:50:24 2016 -0400
@@ -1,14 +1,15 @@
 #======================================================================
 #                    P L O T _ B A C K S C A T T E R . P L 
 #                    doc: Tue Jul 28 13:21:09 2015
-#                    dlm: Tue Jan 26 20:46:11 2016
+#                    dlm: Wed Mar 16 16:19:45 2016
 #                    (c) 2015 A.M. Thurnherr
-#                    uE-Info: 19 31 NIL 0 0 72 0 2 4 NIL ofnI
+#                    uE-Info: 57 44 NIL 0 0 72 0 2 4 NIL ofnI
 #======================================================================
 
 # HISTORY:
 #	Jul 28, 2015: - created from [LWplot_Sv]
 #	Jan 26, 2016: - added return on no data to plot
+#   Mar 16, 2016: - adapted to gmt5
 
 require "$ANTS/libGMT.pl";
 
@@ -53,8 +54,8 @@
 	}
 
 	GMT_unitcoords();																	# LABELS
-	GMT_pstext(-Gblue);
-		print(GMT "0.02 0.98 12 0 0 BL $P{out_basename} $P{run_label}\n");
+	GMT_pstext('-F+f14,Helvetica,blue+jTL -N');
+		print(GMT "0.01 -0.06 $P{out_basename} $P{run_label}\n");
 
 	my($depth_tics) = ($ymax < 1000 ) ? 'f10a100' : 'f100a500';							# AXES
 	my($ens_tics) =   ($ymax < 1000 ) ? 'f50a500' : 'f500a2000';
@@ -62,7 +63,8 @@
 	GMT_psbasemap("-B$ens_tics:'Ensemble [#]':/$depth_tics:'Depth [m]':WeSn");
 		 
 	GMT_setAnnotFontSize(7);															# SCALE BAR
-	GMT_psscale("-E -D8/2/3/0.4 $C -B/:S\@-v\@-:");
+#	GMT_psscale("-E -D8/2/3/0.4 $C -B/:S\@-v\@-:");
+	GMT_psscale("-Dn0.85/0.1+w3/0.4+e $C -B/:S\@-v\@-:");
 
 	GMT_end();																			# FINISH PLOT
 }
--- a/plot_correlation.pl	Wed Mar 16 08:25:32 2016 -0400
+++ b/plot_correlation.pl	Thu Mar 17 07:50:24 2016 -0400
@@ -1,14 +1,15 @@
 #======================================================================
 #                    P L O T _ C O R R E L A T I O N . P L 
 #                    doc: Tue Jul 28 13:21:09 2015
-#                    dlm: Tue Jan 26 20:46:18 2016
+#                    dlm: Wed Mar 16 16:26:09 2016
 #                    (c) 2015 A.M. Thurnherr
-#                    uE-Info: 19 31 NIL 0 0 72 0 2 4 NIL ofnI
+#                    uE-Info: 67 37 NIL 0 0 72 0 2 4 NIL ofnI
 #======================================================================
 
 # HISTORY:
 #	Jul 28, 2015: - created from [LWplot_corr]
 #   Jan 26, 2016: - added return on no data to plot
+#   Mar 16, 2016: - adapted to gmt5
 
 require "$ANTS/libGMT.pl";
 
@@ -53,8 +54,8 @@
 	}
 
 	GMT_unitcoords();																	# LABELS
-	GMT_pstext(-Gblue);
-		print(GMT "0.02 0.98 12 0 0 BL $P{out_basename} $P{run_label}\n");
+	GMT_pstext('-F+f14,Helvetica,blue+jTL -N');
+		print(GMT "0.01 -0.06 $P{out_basename} $P{run_label}\n");
 
 	my($depth_tics) = ($ymax < 1000 ) ? 'f10a100' : 'f100a500';							# AXES
 	my($ens_tics) =   ($ymax < 1000 ) ? 'f50a500' : 'f500a2000';
@@ -62,7 +63,8 @@
 	GMT_psbasemap("-B$ens_tics:'Ensemble [#]':/$depth_tics:'Depth [m]':WeSn");
 		 
 	GMT_setAnnotFontSize(7);															# SCALE BAR
-	GMT_psscale("-E -D8/2/3/0.4 $C -B/:corr:");
+#	GMT_psscale("-E -D8/2/3/0.4 $C -B/:corr:");
+	GMT_psscale("-Dn0.85/0.1+w3/0.4+e $C -B/:corr:");
 
 	GMT_end();																			# FINISH PLOT
 }
--- a/plot_mean_residuals.pl	Wed Mar 16 08:25:32 2016 -0400
+++ b/plot_mean_residuals.pl	Thu Mar 17 07:50:24 2016 -0400
@@ -1,9 +1,9 @@
 #======================================================================
 #                    P L O T _ M E A N _ R E S I D U A L S . P L 
 #                    doc: Tue Jul 28 13:21:09 2015
-#                    dlm: Tue Jan 26 20:13:56 2016
+#                    dlm: Wed Mar 16 15:55:14 2016
 #                    (c) 2015 A.M. Thurnherr
-#                    uE-Info: 16 33 NIL 0 0 72 2 2 4 NIL ofnI
+#                    uE-Info: 96 29 NIL 0 0 72 2 2 4 NIL ofnI
 #======================================================================
 
 # HISTORY:
@@ -14,6 +14,7 @@
 #	Jan 22, 2015: - many changes
 #				  - added quality assessment label
 #	Jan 25, 2016: - added return on no data
+#	Mar 16, 2016: - adapted to gmt5
 
 require "$ANTS/libGMT.pl";
 
@@ -32,7 +33,7 @@
 	GMT_begin($pfn,'-JX10/-10',$R,'-P');
 
 	if ($outGrid_firstBin>$LADCP_firstBin || $outGrid_lastBin<$LADCP_lastBin) {		# mark used bins
-		GMT_psxy('-G200 -M -L');
+		GMT_psxy('-G200 -L');
 		printf(GMT ">\n%f %f\n%f %f\n%f %f\n%f %f\n",
 			$xmin,$LADCP_firstBin-0.5,
 			$xmax,$LADCP_firstBin-0.5,
@@ -50,13 +51,13 @@
 	GMT_psxy('-W1');																# plot zero line
 	printf(GMT "0 $ymin\n0 $ymax\n");
 
-	GMT_psxy('-Mn -W4/coral');
+	GMT_psxy('-W2,coral');
 		for (my($bin)=$LADCP_firstBin; $bin<@dc_bres; $bin++) {						# SKIP FIRST BIN
 			next if ($bin+1<$outGrid_firstBin || $bin+1>$outGrid_lastBin);
 			next unless ($dc_bres_nsamp[$bin] >= $dc_bres_max_nsamp/3);
 			printf(GMT "%f %d\n",$dc_avg_bres[$bin],$bin+1);
         }
-	GMT_psxy('-Mn -Ex0.2/4/coral');
+	GMT_psxy('-Ex0.2/2,coral');
 		for (my($bin)=$LADCP_firstBin-1; $bin<@dc_bres; $bin++) {
 			printf(GMT "%f %d %f\n",
 							$dc_avg_bres[$bin],
@@ -64,13 +65,13 @@
 							($dc_bres_nsamp[$bin] > 1) ?
 								$dc_sig_bres[$bin]/sqrt($dc_bres_nsamp[$bin]-1) : 0);
         }
-	GMT_psxy('-Mn -W4/SeaGreen');
+	GMT_psxy('-W2,SeaGreen');
 		for (my($bin)=$LADCP_firstBin; $bin<@uc_bres; $bin++) {						# SKIP FIRST BIN
 			next if ($bin+1<$outGrid_firstBin || $bin+1>$outGrid_lastBin);
 			next unless ($uc_bres_nsamp[$bin] >= $uc_bres_max_nsamp/3);
 			printf(GMT "%f %d\n",$uc_avg_bres[$bin],$bin+1);
         }
-	GMT_psxy('-Mn -Ex0.2/4/SeaGreen');
+	GMT_psxy('-Ex0.2/2,SeaGreen');
 		for (my($bin)=$LADCP_firstBin-1; $bin<@uc_bres; $bin++) {
 			printf(GMT "%f %d %f\n",
 							$uc_avg_bres[$bin],
@@ -81,22 +82,22 @@
 
 	GMT_unitcoords();																	# LABELS
 
-	GMT_pstext('-Gblue -N');															# profile id
-		print(GMT "0.0 -0.03 14 0 0 BL $P{out_basename} $P{run_label}\n");
+	GMT_pstext('-F+f14,Helvetica,blue+jBL -N');											# profile id
+		print(GMT "0.0 -0.03 $P{out_basename} $P{run_label}\n");
 
-	GMT_pstext('-Gcoral');																# rms residuals
-		print(GMT "0.01 0.93 12 0 0 BL dc\n");
-	if ($dc_bres_rms >= 0.005) { 		GMT_pstext('-Gwhite -Wred'); }
-	elsif ($dc_bres_rms >= 0.001) { 	GMT_pstext('-Gblack -Wyellow'); }
-	else {						GMT_pstext('-Gblack -Wgreen'); }
-		printf(GMT "0.10 0.93 12 0 0 BL %.1f mm/s rms\n",1000*$dc_bres_rms);
+	GMT_pstext('-F+f12,Helvetica,coral+jBL');											# rms residuals
+		print(GMT "0.01 0.93 dc\n");
+	if ($dc_bres_rms >= 0.005) { 		GMT_pstext('-F+f12,Helvetica,white+jBL -Gred'); }
+	elsif ($dc_bres_rms >= 0.001) { 	GMT_pstext('-F+f12,Helvetica,black+jBL -Gyellow'); }
+	else {								GMT_pstext('-F+f12,Helvetica,black+jBL -Ggreen'); }
+		printf(GMT "0.10 0.93 %.1f mm/s rms\n",1000*$dc_bres_rms);
 
-	GMT_pstext('-GSeaGreen');
-		print(GMT "0.01 0.98 12 0 0 BL uc\n");
-	if ($uc_bres_rms >= 0.005) { 		GMT_pstext('-Gwhite -Wred'); }
-	elsif ($uc_bres_rms >= 0.001) { 	GMT_pstext('-Gblack -Wyellow'); }
-	else {						GMT_pstext('-Gblack -Wgreen'); }
-		printf(GMT "0.10 0.98 12 0 0 BL %.1f mm/s rms\n",1000*$uc_bres_rms);
+	GMT_pstext('-F+f12,Helvetica,SeaGreen+jBL');
+		print(GMT "0.01 0.98 uc\n");
+	if ($uc_bres_rms >= 0.005) { 		GMT_pstext('-F+f12,Helvetica,white+jBL -Gred'); }
+	elsif ($uc_bres_rms >= 0.001) { 	GMT_pstext('-F+f12,Helvetica,black+jBL -Gyellow'); }
+	else {								GMT_pstext('-F+f12,Helvetica,black+jBL -Ggreen'); }
+		printf(GMT "0.10 0.98 %.1f mm/s rms\n",1000*$uc_bres_rms);
 
 	my($bin_tics) = ($ymax <= 20) ? 'f1a1' : 'f1a2';
 	GMT_setR($R);																		# FINISH PLOT
--- a/plot_residuals.pl	Wed Mar 16 08:25:32 2016 -0400
+++ b/plot_residuals.pl	Thu Mar 17 07:50:24 2016 -0400
@@ -1,9 +1,9 @@
 #======================================================================
 #                    P L O T _ R E S I D U A L S . P L 
 #                    doc: Tue Jul 28 13:21:09 2015
-#                    dlm: Tue Jan 26 20:45:58 2016
+#                    dlm: Wed Mar 16 16:32:39 2016
 #                    (c) 2015 A.M. Thurnherr
-#                    uE-Info: 21 31 NIL 0 0 72 0 2 4 NIL ofnI
+#                    uE-Info: 83 24 NIL 0 0 72 0 2 4 NIL ofnI
 #======================================================================
 
 # HISTORY:
@@ -11,6 +11,7 @@
 #	Jul 30, 2015: - made it respect outGrid_ selection
 #				  - modified $ens_tics
 #   Jan 26, 2016: - added return on no data to plot
+#	Mar 16, 2016: - adapted to gmt5
 
 require "$ANTS/libGMT.pl";
 
@@ -69,8 +70,8 @@
 	}
 
 	GMT_unitcoords();																	# LABELS
-	GMT_pstext(-Gblue);
-		print(GMT "0.02 0.98 12 0 0 BL $P{out_basename} $P{run_label}\n");
+	GMT_pstext('-F+f14,Helvetica,blue+jTL -N');
+		print(GMT "0.01 -0.06 $P{out_basename} $P{run_label}\n");
 
 	my($depth_tics) = ($ymax < 1000 ) ? 'f10a100' : 'f100a500';							# AXES
 	my($ens_tics) =   ($ymax < 1000 ) ? 'f50a500' : 'f500a2000';
@@ -78,7 +79,8 @@
 	GMT_psbasemap("-B$ens_tics:'Ensemble [#]':/$depth_tics:'Depth [m]':WeSn");
 
 	GMT_setAnnotFontSize(7);															# SCALE BAR
-	GMT_psscale("-E -D8/2/3/0.4 $C -B/:residuals:");
+#	GMT_psscale("-E -D8/2/3/0.4 $C -B/:residuals:");
+	GMT_psscale("-Dn0.83/0.1+w3/0.4+e $C -B/:residuals:");
 		 
 	GMT_end();																			# FINISH PLOT
 }
--- a/plot_time_lags.pl	Wed Mar 16 08:25:32 2016 -0400
+++ b/plot_time_lags.pl	Thu Mar 17 07:50:24 2016 -0400
@@ -1,14 +1,15 @@
 #======================================================================
 #                    P L O T _ T I M E _ L A G S . P L 
 #                    doc: Tue Jul 28 13:21:09 2015
-#                    dlm: Tue Jan 26 20:14:53 2016
+#                    dlm: Wed Mar 16 16:42:42 2016
 #                    (c) 2015 A.M. Thurnherr
-#                    uE-Info: 19 38 NIL 0 0 72 2 2 4 NIL ofnI
+#                    uE-Info: 50 25 NIL 0 0 72 2 2 4 NIL ofnI
 #======================================================================
 
 # HISTORY:
 #	Jul 29, 2015: - created from [LWplot_TL]
 #   Jan 26, 2016: - added return on no data to plot
+#	Mar 16, 2016: - adapted to gmt5
 
 require "$ANTS/libGMT.pl";
 
@@ -37,7 +38,7 @@
 			printf(GMT "%f %f\n",$elapsed_buf[$wi]/60,$so_buf[$wi]);
         }
 
-	GMT_psxy('-W4/grey20 -M');
+	GMT_psxy('-W1,grey20');
 	for (my($i)=0; $i<@bmo_buf; $i++) {
 		printf(GMT ">\n%f %f\n%f %f\n",
 			$fg_buf[$i]/60-0.5,$bmo_buf[$i],
@@ -45,8 +46,8 @@
 	}
 
 	GMT_unitcoords();																	# LABELS
-	GMT_pstext(-Gblue);
-		print(GMT "0.02 0.02 12 0 0 BL $P{out_basename} $P{run_label}\n");
+	GMT_pstext('-F+f14,Helvetica,blue+jTL -N');
+		print(GMT "0.01 1.06 $P{out_basename} $P{run_label}\n");
 
 	GMT_setR($R);
 	GMT_end('-Bf1a30:"Elapsed Time [min]":/f1a5:"Best Offset [scans]":WeSn');			# FINISH PLOT
--- a/plot_wprof.pl	Wed Mar 16 08:25:32 2016 -0400
+++ b/plot_wprof.pl	Thu Mar 17 07:50:24 2016 -0400
@@ -1,15 +1,17 @@
 #======================================================================
 #                    P L O T _ W P R O F . P L 
 #                    doc: Sun Jul 26 11:08:50 2015
-#                    dlm: Mon Oct 12 13:20:47 2015
+#                    dlm: Thu Mar 17 06:02:11 2016
 #                    (c) 2015 A.M. Thurnherr
-#                    uE-Info: 53 40 NIL 0 0 72 2 2 4 NIL ofnI
+#                    uE-Info: 144 24 NIL 0 0 72 2 2 4 NIL ofnI
 #======================================================================
 
 # HISTORY:
 #	Jul 26, 2015: - created from LWplot_prof_2beam
 #	Jul 30, 2015: - moved main label outside plot area
 #	Oct 12, 2015: - BUG: gaps were not plotted as such
+#	Mar 16, 2016: - adapted to gmt5
+#	Mar 17, 2016: - improved
 
 # Tweakables:
 #
@@ -20,7 +22,8 @@
 require "$ANTS/libGMT.pl";
 
 sub setR1() { GMT_setR("-R$plot_wprof_xmin/0.35/0/$plot_wprof_ymax"); }
-sub setR2() { GMT_setR("-R-200/200/0/$plot_wprof_ymax"); }
+#sub setR2() { GMT_setR("-R-200/200/0/$plot_wprof_ymax"); }
+sub setR2() { GMT_setR("-R-450/350/0/$plot_wprof_ymax"); }
 
 sub plotDC($$)
 {
@@ -51,6 +54,7 @@
 	my($f,$minsamp) = @_;
 	for (my($bi)=0; $bi<=$#{$BT{$f}}; $bi++) {
 		if (numberp($BT{$f}[$bi]) && $BT{N_SAMP}[$bi]>=$minsamp) {
+			$have_BT = 1;
 			printf(GMT "%g %g\n",$BT{$f}[$bi],($bi+0.5)*$opt_o);
 		} else {
 			print(GMT "nan nan\n");
@@ -83,46 +87,72 @@
 	}
 
 	setR1();																			# FRAME
-	GMT_psxy('-W1');
+	GMT_psxy('-W0.5');
 		print(GMT "0 0\n 0 $plot_wprof_ymax\n");
 	setR2();
-	GMT_psxy('-W1 -M');
+	GMT_psxy('-W0.5');
 		print(GMT ">\n50 0\n 50 $plot_wprof_ymax\n");
-		print(GMT ">\n100 0\n 100 $plot_wprof_ymax\n");
 		print(GMT ">\n150 0\n 150 $plot_wprof_ymax\n");
+		print(GMT ">\n250 0\n 250 $plot_wprof_ymax\n");
 
 	setR1();																			# VERTICAL VELOCITIES
-	GMT_psxy('-Mn -W4,coral,6_2:0'); 		plotDC('MEDIAN_W12',$opt_k);
-	GMT_psxy('-Mn -W4,coral,4_6:0'); 		plotDC('MEDIAN_W34',$opt_k);
-	GMT_psxy('-Mn -W4,SeaGreen,6_2:0'); 	plotUC('MEDIAN_W12',$opt_k);
-	GMT_psxy('-Mn -W4,SeaGreen,4_6:0'); 	plotUC('MEDIAN_W34',$opt_k);
-	GMT_psxy('-Mn -W4,black'); 				plotBT('MEDIAN_W',$opt_k);
+	GMT_psxy('-W1,coral,8_2:0');		plotDC('MEDIAN_W12',$opt_k);
+	GMT_psxy('-W1,coral,1_1:0');		plotDC('MEDIAN_W34',$opt_k);
+	GMT_psxy('-W1,SeaGreen,8_2:0'); 	plotUC('MEDIAN_W12',$opt_k);
+	GMT_psxy('-W1,SeaGreen,1_1:0'); 	plotUC('MEDIAN_W34',$opt_k);
+	GMT_psxy('-W1,black');				plotBT('MEDIAN_W',$opt_k);
 
-	GMT_psxy('-Sc0.1c -Gcoral');			plotDC('MAD_W',0);							# MEAN ABSOLUTE DEVIATIONS
-	GMT_psxy('-Sc0.1c -GSeaGreen');			plotUC('MAD_W',0);	
-	GMT_psxy('-Sc0.1c -Gblack');			plotBT('MAD_W',0);	
+	GMT_psxy('-Sc0.1c -Gcoral');		plotDC('MAD_W',0);								# MEAN ABSOLUTE DEVIATIONS
+	GMT_psxy('-Sc0.1c -GSeaGreen');		plotUC('MAD_W',0);	
+	GMT_psxy('-Sc0.1c -Gblack');		plotBT('MAD_W',0);	
 
 	setR2();																			# SAMPLES
-	GMT_psxy('-Mn -W1/coral');				plotDC('N_SAMP',0);
-	GMT_psxy('-Mn -W1/SeaGreen');			plotUC('N_SAMP',0);	
-	GMT_psxy('-Mn -W1/black');				plotBT('N_SAMP',0);	
+	GMT_psxy('-W0.7,coral');			plotDC('N_SAMP',0);
+	GMT_psxy('-W0.7,SeaGreen');			plotUC('N_SAMP',0);	
+	GMT_psxy('-W0.7,black');			plotBT('N_SAMP',0);	
 	
 	GMT_unitcoords();																	# LABELS
-	GMT_pstext('-Gblue -N');
-		print(GMT "0.01 -0.06 14 0 0 TL $P{out_basename} [$P{run_label}]\n");
-	GMT_pstext();
-		print(GMT "0.6 0.98 12 0 0 BR m.a.d.\n");
+	GMT_pstext('-F+f14,Helvetica,blue+jTL -N');
+		print(GMT "0.01 -0.06 $P{out_basename} [$P{run_label}]\n");
+	GMT_pstext('-F+f12,Helvetica+jBR');
+		print(GMT "0.6 0.98 m.a.d.\n");
+	GMT_pstext('-F -N');
+		print(GMT "0.32 1.12 Vertical Velocity [m/s]\n");
+	GMT_pstext('-F+f9,Helvetica,orange+jTR -N -Gwhite');
+		print(GMT "0.99 0.01 V$VERSION\n");
 
+	GMT_pstext('-F+f12,Helvetica,coral+jTL -Gwhite');
+		print(GMT "0.02 0.01 dc\n");
+	GMT_pstext('-F+f12,Helvetica,SeaGreen+jTL -Gwhite');
+		print(GMT "0.02 0.06 uc\n");
+	if ($have_BT) {
+		GMT_pstext('-F+f12,Helvetica,black+jTL -Gwhite');
+			print(GMT "0.02 0.10 BT\n");
+	}
+
+	GMT_pstext('-F+f9,Helvetica,CornFlowerBlue+jTL -N');
+		printf(GMT "0.64 1.020 $LADCP{BEAM_FREQUENCY}kHz $LADCP{INSTRUMENT_TYPE} $P{ADCP_orientation}\n");
+		printf(GMT "0.64 1.055 bin setup\n		0.77 1.055 : %.1fm/%1.fm/%1.fm\n",
+			$LADCP{BLANKING_DISTANCE},$LADCP{TRANSMITTED_PULSE_LENGTH},$LADCP{BIN_LENGTH});
+		print(GMT "0.64 1.090 rms tilt\n 		0.77 1.096 :\n");
+		print(GMT "0.64 1.130 rms w\@-pkg\@-\n	0.77 1.1315 :\n");
+	GMT_pstext('-F+f9,Helvetica,coral+jTL -N');
+		printf(GMT "0.788 1.090 %.1f\\260\n",$P{dc_rms_tilt});
+		printf(GMT "0.788 1.125 %.1fm/s\n",$P{dc_rms_w_pkg});
+	GMT_pstext('-F+f9,Helvetica,SeaGreen+jTL -N');
+		printf(GMT "0.89 1.090 %.1f\\260\n",$P{uc_rms_tilt});
+		printf(GMT "0.89 1.125 %.1fm/s\n",$P{uc_rms_w_pkg});
+		
 	my($depth_tics) = ($plot_wprof_ymax < 1000 ) ? 'f10a100' : 'f100a500';				# AXES
 	setR1();
-	GMT_psbasemap("-Bf0.01:'Vertical Velocity [m/s]                               ':/$depth_tics:'Depth [m]':WeS");
+	GMT_psbasemap("-Bf0.01:'':/$depth_tics:'Depth [m]':WeS");
 	foreach my $t (split('\s+',$plot_wprof_xtics)) {
 		GMT_psbasemap(sprintf('-Ba10-%fS',10-$t));
 	}
 	setR2();
 	GMT_psbasemap('-Bf10a1000-950:"                                     # of Samples":N');
-	GMT_psbasemap('-Ba1000-900N');
 	GMT_psbasemap('-Ba1000-850N');
+	GMT_psbasemap('-Ba1000-750N');
 		 
 	GMT_end();																			# FINISH PLOT
 }
--- a/plot_wsamp.pl	Wed Mar 16 08:25:32 2016 -0400
+++ b/plot_wsamp.pl	Thu Mar 17 07:50:24 2016 -0400
@@ -1,9 +1,9 @@
 #======================================================================
 #                    P L O T _ W S A M P . P L 
 #                    doc: Tue Jul 28 13:21:09 2015
-#                    dlm: Tue Jan 26 20:46:47 2016
+#                    dlm: Wed Mar 16 16:29:52 2016
 #                    (c) 2015 A.M. Thurnherr
-#                    uE-Info: 22 31 NIL 0 0 72 0 2 4 NIL ofnI
+#                    uE-Info: 71 37 NIL 0 0 72 0 2 4 NIL ofnI
 #======================================================================
 
 # HISTORY:
@@ -12,6 +12,7 @@
 #	Sep 21, 2015: - BUG: function was still called plot_w()
 #	Oct 12, 2015: - move main label outside plot area
 #   Jan 26, 2016: - added return on no data to plot
+#	Mar 16, 2016: - adapted to gmt5
 
 require "$ANTS/libGMT.pl";
 
@@ -57,8 +58,8 @@
 	}
 
 	GMT_unitcoords();																	# LABELS
-	GMT_pstext('-Gblue -N');
-		print(GMT "0.01 -0.06 14 0 0 TL $P{out_basename} [$P{run_label}]\n");
+	GMT_pstext('-F+f14,Helvetica,blue+jTL -N');
+		print(GMT "0.01 -0.06 $P{out_basename} [$P{run_label}]\n");
 
 	my($depth_tics) = ($ymax < 1000 ) ? 'f10a100' : 'f100a500';							# AXES
 	my($ens_tics) =   ($ymax < 1000 ) ? 'f50a500' : 'f500a2000';
@@ -66,7 +67,8 @@
 	GMT_psbasemap("-B$ens_tics:'Ensemble [#]':/$depth_tics:'Depth [m]':WeSn");
 		 
 	GMT_setAnnotFontSize(7);															# SCALE BAR
-	GMT_psscale("-E -D8/2/3/0.4 $C -B/:w:");
+#	GMT_psscale("-E -D8/2/3/0.4 $C -B/:w:");
+	GMT_psscale("-Dn0.85/0.1+w3/0.4+e $C -B/:w:");
 
 	GMT_end();																			# FINISH PLOT
 }
--- a/version.pl	Wed Mar 16 08:25:32 2016 -0400
+++ b/version.pl	Thu Mar 17 07:50:24 2016 -0400
@@ -1,19 +1,20 @@
 #======================================================================
 #                    V E R S I O N . P L 
 #                    doc: Tue Oct 13 10:40:57 2015
-#                    dlm: Sun Mar 13 14:54:32 2016
+#                    dlm: Wed Mar 16 14:07:05 2016
 #                    (c) 2015 A.M. Thurnherr
-#                    uE-Info: 15 20 NIL 0 0 72 0 2 4 NIL ofnI
+#                    uE-Info: 16 20 NIL 0 0 72 0 2 4 NIL ofnI
 #======================================================================
 
 # HISTORY:
 #	Oct 13, 2015: - created
 #	Jan  4, 2016: - added $ADCP_tools_minVersion
 #	Mar  8, 2016: - updated antsMinLibVersion to 6.3
+#	Mar 16, 2016: - updated antsMinLibVersion to 6.4 (gmt5)
 
 #$VERSION = '1.1';				# Jan  4, 2016
-$VERSION = '1.2beta4';			# Jan  5, 2016
+$VERSION = '1.2beta5';			# Jan  5, 2016
 
-$antsMinLibVersion 		= 6.3;
+$antsMinLibVersion 		= 6.4;
 $ADCP_tools_minVersion 	= 1.4;