author | A.M. Thurnherr <athurnherr@yahoo.com> |
Thu, 17 Mar 2016 07:50:24 -0400 | |
changeset 41 | 6bddb82924e3 |
parent 34 | e550db661c17 |
child 45 | 6d49c7420a6c |
permissions | -rw-r--r-- |
30 | 1 |
#====================================================================== |
32
6041a20feb39
V1.0 release candidate
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
31
diff
changeset
|
2 |
# P L O T _ W S A M P . P L |
30 | 3 |
# doc: Tue Jul 28 13:21:09 2015 |
41 | 4 |
# dlm: Wed Mar 16 16:29:52 2016 |
30 | 5 |
# (c) 2015 A.M. Thurnherr |
41 | 6 |
# uE-Info: 71 37 NIL 0 0 72 0 2 4 NIL ofnI |
30 | 7 |
#====================================================================== |
8 |
||
9 |
# HISTORY: |
|
10 |
# Jul 28, 2015: - created from [LWplot_w] |
|
31 | 11 |
# Jul 30, 2015: - added support for outGrid_* |
32
6041a20feb39
V1.0 release candidate
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
31
diff
changeset
|
12 |
# Sep 21, 2015: - BUG: function was still called plot_w() |
6041a20feb39
V1.0 release candidate
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
31
diff
changeset
|
13 |
# Oct 12, 2015: - move main label outside plot area |
34 | 14 |
# Jan 26, 2016: - added return on no data to plot |
41 | 15 |
# Mar 16, 2016: - adapted to gmt5 |
30 | 16 |
|
17 |
require "$ANTS/libGMT.pl"; |
|
18 |
||
32
6041a20feb39
V1.0 release candidate
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
31
diff
changeset
|
19 |
sub plot_wsamp($) |
30 | 20 |
{ |
21 |
my($pfn) = @_; |
|
22 |
||
34 | 23 |
return unless ($P{max_depth}); |
24 |
||
30 | 25 |
my($xmin) = $P{min_ens}-0.5; |
26 |
my($xmax) = $P{max_ens}+0.5; |
|
27 |
my($ymin) = 0; |
|
28 |
my($ymax) = ($P{water_depth} > 0) ? |
|
29 |
round($P{water_depth} + 25) : |
|
30 |
round($P{max_depth} + $P{ADCP_bin_length}); |
|
31 |
||
32 |
my($ens_width) = 10 / ($P{max_ens} - $P{min_ens} + 1); |
|
33 |
my($bin_length) = 10 * $P{ADCP_bin_length} / |
|
34 |
($P{max_depth}-$P{min_depth}+$P{ADCP_bin_length}); |
|
35 |
||
36 |
my($R) = "-R$xmin/$xmax/$ymin/$ymax"; |
|
37 |
GMT_begin($pfn,'-JX10/-10',$R,'-P'); |
|
38 |
||
39 |
my($C) = "-C$WCALC/w.cpt"; |
|
40 |
GMT_psxy("$C -Sr"); |
|
41 |
for ($ens=$firstGoodEns; $ens<=$realLastGoodEns; $ens++) { |
|
42 |
next unless numberp($LADCP{ENSEMBLE}[$ens]->{CTD_DEPTH}); |
|
43 |
my(@bindepth) = calc_binDepths($ens); |
|
44 |
for ($bin=$LADCP_firstBin-1; $bin<=$LADCP_lastBin-1; $bin++) { |
|
31 | 45 |
next unless ($bin+1>=$outGrid_firstBin && $bin+1<=$outGrid_lastBin); |
30 | 46 |
next unless numberp($LADCP{ENSEMBLE}[$ens]->{W}[$bin]); |
47 |
my($bi) = $bindepth[$bin]/$opt_o; |
|
48 |
printf(GMT "%d %f %f $ens_width $bin_length\n", |
|
49 |
$LADCP{ENSEMBLE}[$ens]->{NUMBER}, |
|
50 |
$bindepth[$bin], |
|
51 |
$LADCP{ENSEMBLE}[$ens]->{SSCORRECTED_OCEAN_W}[$bin]); |
|
52 |
} |
|
53 |
} |
|
54 |
||
55 |
if ($P{water_depth} > 0) { # SEABED |
|
56 |
GMT_psxy('-G204/153/102'); |
|
57 |
print(GMT "$xmin $ymax\n$xmax $ymax\n$xmax $P{water_depth}\n $xmin $P{water_depth}\n"); |
|
58 |
} |
|
59 |
||
60 |
GMT_unitcoords(); # LABELS |
|
41 | 61 |
GMT_pstext('-F+f14,Helvetica,blue+jTL -N'); |
62 |
print(GMT "0.01 -0.06 $P{out_basename} [$P{run_label}]\n"); |
|
30 | 63 |
|
64 |
my($depth_tics) = ($ymax < 1000 ) ? 'f10a100' : 'f100a500'; # AXES |
|
31 | 65 |
my($ens_tics) = ($ymax < 1000 ) ? 'f50a500' : 'f500a2000'; |
30 | 66 |
GMT_setR($R); |
67 |
GMT_psbasemap("-B$ens_tics:'Ensemble [#]':/$depth_tics:'Depth [m]':WeSn"); |
|
68 |
||
69 |
GMT_setAnnotFontSize(7); # SCALE BAR |
|
41 | 70 |
# GMT_psscale("-E -D8/2/3/0.4 $C -B/:w:"); |
71 |
GMT_psscale("-Dn0.85/0.1+w3/0.4+e $C -B/:w:"); |
|
30 | 72 |
|
73 |
GMT_end(); # FINISH PLOT |
|
74 |
} |
|
75 |
||
76 |
1; # return true on require |