author | A.M. Thurnherr <athurnherr@yahoo.com> |
Mon, 08 Mar 2021 12:07:26 -0500 | |
changeset 54 | 828e5466391b |
parent 53 | b4374f1ebd60 |
child 56 | 8f120b9f795a |
permissions | -rw-r--r-- |
30 | 1 |
#====================================================================== |
2 |
# P L O T _ B A C K S C A T T E R . P L |
|
3 |
# doc: Tue Jul 28 13:21:09 2015 |
|
53
b4374f1ebd60
updated psscale -B argument to gmt5 syntax
Andreas Thurnherr
parents:
46
diff
changeset
|
4 |
# dlm: Tue Oct 29 13:13:02 2019 |
30 | 5 |
# (c) 2015 A.M. Thurnherr |
53
b4374f1ebd60
updated psscale -B argument to gmt5 syntax
Andreas Thurnherr
parents:
46
diff
changeset
|
6 |
# uE-Info: 73 54 NIL 0 0 72 0 2 4 NIL ofnI |
30 | 7 |
#====================================================================== |
8 |
||
9 |
# HISTORY: |
|
10 |
# Jul 28, 2015: - created from [LWplot_Sv] |
|
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 |
|
53
b4374f1ebd60
updated psscale -B argument to gmt5 syntax
Andreas Thurnherr
parents:
46
diff
changeset
|
17 |
# Oct 29, 2019: - updated psscale -B to gmt5 syntax |
30 | 18 |
|
19 |
require "$ANTS/libGMT.pl"; |
|
20 |
||
21 |
sub plot_backscatter($) |
|
22 |
{ |
|
23 |
my($pfn) = @_; |
|
24 |
||
34 | 25 |
return unless ($P{max_depth}); |
26 |
||
30 | 27 |
my($xmin) = $P{min_ens}-0.5; |
28 |
my($xmax) = $P{max_ens}+0.5; |
|
46 | 29 |
my($ymin) = round(antsParam('min_depth')-25,50); |
30 | 30 |
my($ymax) = ($P{water_depth} > 0) ? |
46 | 31 |
round($P{water_depth}+25,50) : |
32 |
round($P{max_depth}+$P{ADCP_bin_length}+25,50); |
|
30 | 33 |
|
34 |
my($ens_width) = 10 / ($P{max_ens} - $P{min_ens} + 1); |
|
35 |
my($bin_length) = 10 * $P{ADCP_bin_length} / |
|
36 |
($P{max_depth}-$P{min_depth}+$P{ADCP_bin_length}); |
|
37 |
||
38 |
my($R) = "-R$xmin/$xmax/$ymin/$ymax"; |
|
39 |
GMT_begin($pfn,'-JX10/-10',$R,'-P'); |
|
40 |
||
41 |
my($C) = "-C$WCALC/Sv.cpt"; |
|
42 |
GMT_psxy("$C -Sr"); |
|
45
6d49c7420a6c
stable V1.3beta, just before implementing bin interpolation
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
41
diff
changeset
|
43 |
for ($ens=$firstGoodEns; $ens<=$lastGoodEns; $ens++) { |
30 | 44 |
next unless numberp($LADCP{ENSEMBLE}[$ens]->{CTD_DEPTH}); |
46 | 45 |
my(@bindepth) = binDepths($ens); |
30 | 46 |
for ($bin=$LADCP_firstBin-1; $bin<=$LADCP_lastBin-1; $bin++) { |
47 |
next unless numberp($LADCP{ENSEMBLE}[$ens]->{W}[$bin]); |
|
48 |
my($bi) = $bindepth[$bin]/$opt_o; |
|
49 |
printf(GMT "%d %f %f $ens_width $bin_length\n", |
|
50 |
$LADCP{ENSEMBLE}[$ens]->{NUMBER}, |
|
51 |
$bindepth[$bin], |
|
52 |
$LADCP{ENSEMBLE}[$ens]->{SV}[$bin]); |
|
53 |
} |
|
54 |
} |
|
55 |
||
56 |
if ($P{water_depth} > 0) { # SEABED |
|
57 |
GMT_psxy('-G204/153/102'); |
|
58 |
print(GMT "$xmin $ymax\n$xmax $ymax\n$xmax $P{water_depth}\n $xmin $P{water_depth}\n"); |
|
59 |
} |
|
60 |
||
46 | 61 |
my($depth_tics) = ($ymax-$ymin < 1000) ? 'f10a100' : 'f100a500'; # AXES |
62 |
my($ens_tics) = ($xmax-$xmin < 4000) ? 'f50a500' : 'f500a2000'; |
|
63 |
GMT_psxy("-B$ens_tics:'Ensemble [#]':/$depth_tics:'Depth [m]':WeSn"); |
|
64 |
||
30 | 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"); |
41 | 68 |
GMT_pstext('-F+f14,Helvetica,blue+jTL -N'); |
69 |
print(GMT "0.01 -0.06 $P{out_basename} $P{run_label}\n"); |
|
30 | 70 |
|
71 |
GMT_setAnnotFontSize(7); # SCALE BAR |
|
53
b4374f1ebd60
updated psscale -B argument to gmt5 syntax
Andreas Thurnherr
parents:
46
diff
changeset
|
72 |
# GMT_psscale("-Dn0.85/0.1+w3/0.4+e $C -B/:S\@-v\@-:"); |
b4374f1ebd60
updated psscale -B argument to gmt5 syntax
Andreas Thurnherr
parents:
46
diff
changeset
|
73 |
GMT_psscale("-Dn0.85/0.1+w3/0.4+e $C -By+lS\@-v\@-"); |
30 | 74 |
|
75 |
GMT_end(); # FINISH PLOT |
|
76 |
} |
|
77 |
||
78 |
1; # return true on require |