author | A.M. Thurnherr <athurnherr@yahoo.com> |
Fri, 05 Aug 2016 11:02:51 -0400 | |
changeset 47 | 2ccb81b7cea5 |
parent 46 | cc6c4309828a |
child 53 | b4374f1ebd60 |
permissions | -rw-r--r-- |
30 | 1 |
#====================================================================== |
2 |
# P L O T _ C O R R E L A T I O N . P L |
|
3 |
# doc: Tue Jul 28 13:21:09 2015 |
|
46 | 4 |
# dlm: Tue May 24 23:10:09 2016 |
30 | 5 |
# (c) 2015 A.M. Thurnherr |
46 | 6 |
# uE-Info: 67 38 NIL 0 0 72 0 2 4 NIL ofnI |
30 | 7 |
#====================================================================== |
8 |
||
9 |
# HISTORY: |
|
10 |
# Jul 28, 2015: - created from [LWplot_corr] |
|
34 | 11 |
# Jan 26, 2016: - added return on no data to plot |
41 | 12 |
# 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
|
13 |
# May 18, 2016: - added version |
6d49c7420a6c
stable V1.3beta, just before implementing bin interpolation
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
41
diff
changeset
|
14 |
# - expunged $realLastGoodEns |
46 | 15 |
# May 24, 2016: - calc_binDepths() -> binDepths() |
16 |
# - fixed for partial-depth casts |
|
30 | 17 |
|
18 |
require "$ANTS/libGMT.pl"; |
|
19 |
||
20 |
sub plot_correlation($) |
|
21 |
{ |
|
22 |
my($pfn) = @_; |
|
23 |
||
34 | 24 |
return unless ($P{max_depth}); |
25 |
||
30 | 26 |
my($xmin) = $P{min_ens}-0.5; |
27 |
my($xmax) = $P{max_ens}+0.5; |
|
46 | 28 |
my($ymin) = round(antsParam('min_depth')-25,50); |
30 | 29 |
my($ymax) = ($P{water_depth} > 0) ? |
46 | 30 |
round($P{water_depth}+25,50) : |
31 |
round($P{max_depth}+$P{ADCP_bin_length}+25,50); |
|
30 | 32 |
|
33 |
my($ens_width) = 10 / ($P{max_ens} - $P{min_ens} + 1); |
|
34 |
my($bin_length) = 10 * $P{ADCP_bin_length} / |
|
35 |
($P{max_depth}-$P{min_depth}+$P{ADCP_bin_length}); |
|
36 |
||
37 |
my($R) = "-R$xmin/$xmax/$ymin/$ymax"; |
|
38 |
GMT_begin($pfn,'-JX10/-10',$R,'-P'); |
|
39 |
||
40 |
my($C) = "-C$WCALC/corr.cpt"; |
|
41 |
GMT_psxy("$C -Sr"); |
|
45
6d49c7420a6c
stable V1.3beta, just before implementing bin interpolation
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
41
diff
changeset
|
42 |
for ($ens=$firstGoodEns; $ens<=$lastGoodEns; $ens++) { |
30 | 43 |
next unless numberp($LADCP{ENSEMBLE}[$ens]->{CTD_DEPTH}); |
46 | 44 |
my(@bindepth) = binDepths($ens); |
30 | 45 |
for ($bin=$LADCP_firstBin-1; $bin<=$LADCP_lastBin-1; $bin++) { |
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]->{CORRELATION}[$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 |
|
45
6d49c7420a6c
stable V1.3beta, just before implementing bin interpolation
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
41
diff
changeset
|
61 |
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
|
62 |
print(GMT "0.99 0.01 V$VERSION\n"); |
41 | 63 |
GMT_pstext('-F+f14,Helvetica,blue+jTL -N'); |
64 |
print(GMT "0.01 -0.06 $P{out_basename} $P{run_label}\n"); |
|
30 | 65 |
|
46 | 66 |
my($depth_tics) = ($ymax-$ymin < 1000) ? 'f10a100' : 'f100a500'; # AXES |
67 |
my($ens_tics) = ($xmax-$xmin < 4000) ? 'f50a500' : 'f500a2000'; |
|
30 | 68 |
GMT_setR($R); |
69 |
GMT_psbasemap("-B$ens_tics:'Ensemble [#]':/$depth_tics:'Depth [m]':WeSn"); |
|
70 |
||
71 |
GMT_setAnnotFontSize(7); # SCALE BAR |
|
41 | 72 |
# GMT_psscale("-E -D8/2/3/0.4 $C -B/:corr:"); |
73 |
GMT_psscale("-Dn0.85/0.1+w3/0.4+e $C -B/:corr:"); |
|
30 | 74 |
|
75 |
GMT_end(); # FINISH PLOT |
|
76 |
} |
|
77 |
||
78 |
1; # return true on require |