author | A.M. Thurnherr <athurnherr@yahoo.com> |
Mon, 12 Oct 2015 16:57:30 +0000 | |
changeset 32 | 6041a20feb39 |
parent 31 | d0ae3cb99021 |
child 34 | e550db661c17 |
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 |
32
6041a20feb39
V1.0 release candidate
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
31
diff
changeset
|
4 |
# dlm: Mon Oct 12 13:37:27 2015 |
30 | 5 |
# (c) 2015 A.M. Thurnherr |
32
6041a20feb39
V1.0 release candidate
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
31
diff
changeset
|
6 |
# uE-Info: 13 53 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 |
30 | 14 |
|
15 |
require "$ANTS/libGMT.pl"; |
|
16 |
||
32
6041a20feb39
V1.0 release candidate
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
31
diff
changeset
|
17 |
sub plot_wsamp($) |
30 | 18 |
{ |
19 |
my($pfn) = @_; |
|
20 |
||
21 |
my($xmin) = $P{min_ens}-0.5; |
|
22 |
my($xmax) = $P{max_ens}+0.5; |
|
23 |
my($ymin) = 0; |
|
24 |
my($ymax) = ($P{water_depth} > 0) ? |
|
25 |
round($P{water_depth} + 25) : |
|
26 |
round($P{max_depth} + $P{ADCP_bin_length}); |
|
27 |
||
28 |
my($ens_width) = 10 / ($P{max_ens} - $P{min_ens} + 1); |
|
29 |
my($bin_length) = 10 * $P{ADCP_bin_length} / |
|
30 |
($P{max_depth}-$P{min_depth}+$P{ADCP_bin_length}); |
|
31 |
||
32 |
my($R) = "-R$xmin/$xmax/$ymin/$ymax"; |
|
33 |
GMT_begin($pfn,'-JX10/-10',$R,'-P'); |
|
34 |
||
35 |
my($C) = "-C$WCALC/w.cpt"; |
|
36 |
GMT_psxy("$C -Sr"); |
|
37 |
for ($ens=$firstGoodEns; $ens<=$realLastGoodEns; $ens++) { |
|
38 |
next unless numberp($LADCP{ENSEMBLE}[$ens]->{CTD_DEPTH}); |
|
39 |
my(@bindepth) = calc_binDepths($ens); |
|
40 |
for ($bin=$LADCP_firstBin-1; $bin<=$LADCP_lastBin-1; $bin++) { |
|
31 | 41 |
next unless ($bin+1>=$outGrid_firstBin && $bin+1<=$outGrid_lastBin); |
30 | 42 |
next unless numberp($LADCP{ENSEMBLE}[$ens]->{W}[$bin]); |
43 |
my($bi) = $bindepth[$bin]/$opt_o; |
|
44 |
printf(GMT "%d %f %f $ens_width $bin_length\n", |
|
45 |
$LADCP{ENSEMBLE}[$ens]->{NUMBER}, |
|
46 |
$bindepth[$bin], |
|
47 |
$LADCP{ENSEMBLE}[$ens]->{SSCORRECTED_OCEAN_W}[$bin]); |
|
48 |
} |
|
49 |
} |
|
50 |
||
51 |
if ($P{water_depth} > 0) { # SEABED |
|
52 |
GMT_psxy('-G204/153/102'); |
|
53 |
print(GMT "$xmin $ymax\n$xmax $ymax\n$xmax $P{water_depth}\n $xmin $P{water_depth}\n"); |
|
54 |
} |
|
55 |
||
56 |
GMT_unitcoords(); # LABELS |
|
32
6041a20feb39
V1.0 release candidate
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
31
diff
changeset
|
57 |
GMT_pstext('-Gblue -N'); |
6041a20feb39
V1.0 release candidate
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
31
diff
changeset
|
58 |
print(GMT "0.01 -0.06 14 0 0 TL $P{out_basename} [$P{run_label}]\n"); |
30 | 59 |
|
60 |
my($depth_tics) = ($ymax < 1000 ) ? 'f10a100' : 'f100a500'; # AXES |
|
31 | 61 |
my($ens_tics) = ($ymax < 1000 ) ? 'f50a500' : 'f500a2000'; |
30 | 62 |
GMT_setR($R); |
63 |
GMT_psbasemap("-B$ens_tics:'Ensemble [#]':/$depth_tics:'Depth [m]':WeSn"); |
|
64 |
||
65 |
GMT_setAnnotFontSize(7); # SCALE BAR |
|
66 |
GMT_psscale("-E -D8/2/3/0.4 $C -B/:w:"); |
|
67 |
||
68 |
GMT_end(); # FINISH PLOT |
|
69 |
} |
|
70 |
||
71 |
1; # return true on require |