author | A.M. Thurnherr <athurnherr@yahoo.com> |
Thu, 16 Mar 2017 11:53:27 -0400 | |
changeset 48 | d9309804b6cf |
parent 46 | cc6c4309828a |
child 53 | b4374f1ebd60 |
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 |
46 | 4 |
# dlm: Tue May 24 23:10:28 2016 |
30 | 5 |
# (c) 2015 A.M. Thurnherr |
46 | 6 |
# uE-Info: 73 38 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 |
45
6d49c7420a6c
stable V1.3beta, just before implementing bin interpolation
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
41
diff
changeset
|
16 |
# May 18, 2016: - added version |
6d49c7420a6c
stable V1.3beta, just before implementing bin interpolation
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
41
diff
changeset
|
17 |
# - expunged $realLastGoodEns |
46 | 18 |
# May 24, 2016: - calc_binDepths() -> binDepths() |
19 |
# - fixed for partial-depth profiles |
|
30 | 20 |
|
21 |
require "$ANTS/libGMT.pl"; |
|
22 |
||
32
6041a20feb39
V1.0 release candidate
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
31
diff
changeset
|
23 |
sub plot_wsamp($) |
30 | 24 |
{ |
25 |
my($pfn) = @_; |
|
26 |
||
34 | 27 |
return unless ($P{max_depth}); |
28 |
||
30 | 29 |
my($xmin) = $P{min_ens}-0.5; |
30 |
my($xmax) = $P{max_ens}+0.5; |
|
46 | 31 |
my($ymin) = round(antsParam('min_depth')-25,50); |
30 | 32 |
my($ymax) = ($P{water_depth} > 0) ? |
46 | 33 |
round($P{water_depth}+25,50) : |
34 |
round($P{max_depth}+$P{ADCP_bin_length}+25,50); |
|
35 |
||
30 | 36 |
|
37 |
my($ens_width) = 10 / ($P{max_ens} - $P{min_ens} + 1); |
|
38 |
my($bin_length) = 10 * $P{ADCP_bin_length} / |
|
39 |
($P{max_depth}-$P{min_depth}+$P{ADCP_bin_length}); |
|
40 |
||
41 |
my($R) = "-R$xmin/$xmax/$ymin/$ymax"; |
|
42 |
GMT_begin($pfn,'-JX10/-10',$R,'-P'); |
|
43 |
||
44 |
my($C) = "-C$WCALC/w.cpt"; |
|
45 |
GMT_psxy("$C -Sr"); |
|
45
6d49c7420a6c
stable V1.3beta, just before implementing bin interpolation
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
41
diff
changeset
|
46 |
for ($ens=$firstGoodEns; $ens<=$lastGoodEns; $ens++) { |
30 | 47 |
next unless numberp($LADCP{ENSEMBLE}[$ens]->{CTD_DEPTH}); |
46 | 48 |
my(@bindepth) = binDepths($ens); |
30 | 49 |
for ($bin=$LADCP_firstBin-1; $bin<=$LADCP_lastBin-1; $bin++) { |
31 | 50 |
next unless ($bin+1>=$outGrid_firstBin && $bin+1<=$outGrid_lastBin); |
30 | 51 |
next unless numberp($LADCP{ENSEMBLE}[$ens]->{W}[$bin]); |
52 |
my($bi) = $bindepth[$bin]/$opt_o; |
|
53 |
printf(GMT "%d %f %f $ens_width $bin_length\n", |
|
54 |
$LADCP{ENSEMBLE}[$ens]->{NUMBER}, |
|
55 |
$bindepth[$bin], |
|
56 |
$LADCP{ENSEMBLE}[$ens]->{SSCORRECTED_OCEAN_W}[$bin]); |
|
57 |
} |
|
58 |
} |
|
59 |
||
60 |
if ($P{water_depth} > 0) { # SEABED |
|
61 |
GMT_psxy('-G204/153/102'); |
|
62 |
print(GMT "$xmin $ymax\n$xmax $ymax\n$xmax $P{water_depth}\n $xmin $P{water_depth}\n"); |
|
63 |
} |
|
64 |
||
65 |
GMT_unitcoords(); # LABELS |
|
45
6d49c7420a6c
stable V1.3beta, just before implementing bin interpolation
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
41
diff
changeset
|
66 |
GMT_pstext('-F+f9,Helvetica,orange+jTR -N -Gwhite'); |
6d49c7420a6c
stable V1.3beta, just before implementing bin interpolation
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
41
diff
changeset
|
67 |
print(GMT "0.99 0.01 V$VERSION\n"); |
6d49c7420a6c
stable V1.3beta, just before implementing bin interpolation
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
41
diff
changeset
|
68 |
|
41 | 69 |
GMT_pstext('-F+f14,Helvetica,blue+jTL -N'); |
70 |
print(GMT "0.01 -0.06 $P{out_basename} [$P{run_label}]\n"); |
|
30 | 71 |
|
46 | 72 |
my($depth_tics) = ($ymax-$ymin < 1000) ? 'f10a100' : 'f100a500'; # AXES |
73 |
my($ens_tics) = ($xmax-$xmin < 4000) ? 'f50a500' : 'f500a2000'; |
|
30 | 74 |
GMT_setR($R); |
75 |
GMT_psbasemap("-B$ens_tics:'Ensemble [#]':/$depth_tics:'Depth [m]':WeSn"); |
|
76 |
||
77 |
GMT_setAnnotFontSize(7); # SCALE BAR |
|
46 | 78 |
GMT_psscale("-Dn0.85/0.1+w3/0.4+e $C -B/:w\@-ocean\@-:"); |
30 | 79 |
|
80 |
GMT_end(); # FINISH PLOT |
|
81 |
} |
|
82 |
||
83 |
1; # return true on require |