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