author | A.M. Thurnherr <athurnherr@yahoo.com> |
Wed, 28 Aug 2019 17:51:34 -0400 | |
changeset 52 | 4ccccbf69dfd |
parent 49 | 5006e9158207 |
child 56 | 8f120b9f795a |
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 |
|
49 | 4 |
# dlm: Thu Mar 22 10:56:17 2018 |
30 | 5 |
# (c) 2015 A.M. Thurnherr |
49 | 6 |
# uE-Info: 40 0 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 |
49 | 15 |
# Mar 7, 2017: - added time lines for -p |
16 |
# Mar 22, 2018: - removed plotting of yellow runs on -l |
|
30 | 17 |
|
18 |
require "$ANTS/libGMT.pl"; |
|
19 |
||
20 |
sub plot_time_lags($) |
|
21 |
{ |
|
22 |
my($pfn) = @_; |
|
23 |
||
34 | 24 |
return unless ($P{'elapsed.min'}); |
25 |
||
30 | 26 |
my($xmin) = $P{'elapsed.min'}/60; |
27 |
my($xmax) = $P{'elapsed.max'}/60; |
|
28 |
my($ymin) = -24; |
|
29 |
my($ymax) = 24; |
|
30 |
||
31 |
my($R) = "-R$xmin/$xmax/$ymin/$ymax"; |
|
32 |
GMT_begin($pfn,'-JX10',$R,'-P'); |
|
33 |
||
48 | 34 |
GMT_psxy('-W1,grey30'); # time lines |
35 |
for (my($x)=round($xmin,10); $x<=$xmax; $x+=10) { |
|
36 |
printf(GMT "%f $ymin\n%f $ymax\n>\n",$x,$x); |
|
37 |
} |
|
38 |
||
49 | 39 |
unless ($opt_l) { |
40 |
GMT_psxy('-W8,yellow'); # indicate valid runs |
|
41 |
for (my($i)=0; $i<@bmo_buf; $i++) { |
|
42 |
printf(GMT ">\n%f %f\n%f %f\n", |
|
43 |
$fg_buf[$i]/60-0.5,$bmo_buf[$i], |
|
44 |
$lg_buf[$i]/60+0.5,$bmo_buf[$i]); |
|
45 |
} |
|
48 | 46 |
} |
47 |
||
48 |
GMT_psxy('-Sc0.1 -Gcoral'); # individual offsets |
|
30 | 49 |
for (my($wi)=0; $wi<@elapsed_buf; $wi++) { |
50 |
last unless ($elapsed_buf[$wi]<$LADCP{ENSEMBLE}[$LADCP_atbottom]->{ELAPSED}); |
|
51 |
printf(GMT "%f %f\n",$elapsed_buf[$wi]/60,$so_buf[$wi]); |
|
52 |
} |
|
53 |
GMT_psxy('-Sc0.1 -GSeaGreen'); |
|
54 |
for (my($wi)=0; $wi<@elapsed_buf; $wi++) { |
|
55 |
next if ($elapsed_buf[$wi]<$LADCP{ENSEMBLE}[$LADCP_atbottom]->{ELAPSED}); |
|
56 |
printf(GMT "%f %f\n",$elapsed_buf[$wi]/60,$so_buf[$wi]); |
|
57 |
} |
|
58 |
||
48 | 59 |
GMT_unitcoords(); # labels |
45
6d49c7420a6c
stable V1.3beta, just before implementing bin interpolation
A.M. Thurnherr <athurnherr@yahoo.com>
parents:
41
diff
changeset
|
60 |
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
|
61 |
print(GMT "0.99 0.99 V$VERSION\n"); |
41 | 62 |
GMT_pstext('-F+f14,Helvetica,blue+jTL -N'); |
63 |
print(GMT "0.01 1.06 $P{out_basename} $P{run_label}\n"); |
|
30 | 64 |
|
65 |
GMT_setR($R); |
|
46 | 66 |
my($elapsed_tics) = ($xmax-$xmin < 45) ? 'f1a5' : 'f1a30'; |
67 |
GMT_end("-B$elapsed_tics:'Elapsed Time [min]':/f1a5:'Best Offset [CTD records]':WeSn"); # FINISH PLOT |
|
30 | 68 |
} |
69 |
||
70 |
1; # return true on require |