author | A.M. Thurnherr <athurnherr@yahoo.com> |
Fri, 05 Aug 2016 11:02:51 -0400 | |
changeset 47 | 2ccb81b7cea5 |
parent 46 | cc6c4309828a |
child 48 | d9309804b6cf |
permissions | -rw-r--r-- |
30 | 1 |
#====================================================================== |
2 |
# P L O T _ T I M E _ L A G S . P L |
|
3 |
# doc: Tue Jul 28 13:21:09 2015 |
|
46 | 4 |
# dlm: Tue May 24 22:11:30 2016 |
30 | 5 |
# (c) 2015 A.M. Thurnherr |
46 | 6 |
# uE-Info: 59 81 NIL 0 0 72 2 2 4 NIL ofnI |
30 | 7 |
#====================================================================== |
8 |
||
9 |
# HISTORY: |
|
10 |
# Jul 29, 2015: - created from [LWplot_TL] |
|
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 |
46 | 14 |
# May 24, 2016: - fixed for partial-depth casts |
15 |
||
30 | 16 |
|
17 |
require "$ANTS/libGMT.pl"; |
|
18 |
||
19 |
sub plot_time_lags($) |
|
20 |
{ |
|
21 |
my($pfn) = @_; |
|
22 |
||
34 | 23 |
return unless ($P{'elapsed.min'}); |
24 |
||
30 | 25 |
my($xmin) = $P{'elapsed.min'}/60; |
26 |
my($xmax) = $P{'elapsed.max'}/60; |
|
27 |
my($ymin) = -24; |
|
28 |
my($ymax) = 24; |
|
29 |
||
30 |
my($R) = "-R$xmin/$xmax/$ymin/$ymax"; |
|
31 |
GMT_begin($pfn,'-JX10',$R,'-P'); |
|
32 |
||
33 |
GMT_psxy('-Sc0.1 -Gcoral'); |
|
34 |
for (my($wi)=0; $wi<@elapsed_buf; $wi++) { |
|
35 |
last unless ($elapsed_buf[$wi]<$LADCP{ENSEMBLE}[$LADCP_atbottom]->{ELAPSED}); |
|
36 |
printf(GMT "%f %f\n",$elapsed_buf[$wi]/60,$so_buf[$wi]); |
|
37 |
} |
|
38 |
GMT_psxy('-Sc0.1 -GSeaGreen'); |
|
39 |
for (my($wi)=0; $wi<@elapsed_buf; $wi++) { |
|
40 |
next if ($elapsed_buf[$wi]<$LADCP{ENSEMBLE}[$LADCP_atbottom]->{ELAPSED}); |
|
41 |
printf(GMT "%f %f\n",$elapsed_buf[$wi]/60,$so_buf[$wi]); |
|
42 |
} |
|
43 |
||
41 | 44 |
GMT_psxy('-W1,grey20'); |
30 | 45 |
for (my($i)=0; $i<@bmo_buf; $i++) { |
46 |
printf(GMT ">\n%f %f\n%f %f\n", |
|
34 | 47 |
$fg_buf[$i]/60-0.5,$bmo_buf[$i], |
48 |
$lg_buf[$i]/60+0.5,$bmo_buf[$i]); |
|
30 | 49 |
} |
50 |
||
51 |
GMT_unitcoords(); # LABELS |
|
45
6d49c7420a6c
stable V1.3beta, just before implementing bin interpolation
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
41
diff
changeset
|
52 |
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
|
53 |
print(GMT "0.99 0.99 V$VERSION\n"); |
41 | 54 |
GMT_pstext('-F+f14,Helvetica,blue+jTL -N'); |
55 |
print(GMT "0.01 1.06 $P{out_basename} $P{run_label}\n"); |
|
30 | 56 |
|
57 |
GMT_setR($R); |
|
46 | 58 |
my($elapsed_tics) = ($xmax-$xmin < 45) ? 'f1a5' : 'f1a30'; |
59 |
GMT_end("-B$elapsed_tics:'Elapsed Time [min]':/f1a5:'Best Offset [CTD records]':WeSn"); # FINISH PLOT |
|
30 | 60 |
} |
61 |
||
62 |
1; # return true on require |