30
|
1 |
#======================================================================
|
|
2 |
# P L O T _ M E A N _ R E S I D U A L S . P L
|
|
3 |
# doc: Tue Jul 28 13:21:09 2015
|
31
|
4 |
# dlm: Thu Jul 30 12:38:12 2015
|
30
|
5 |
# (c) 2015 A.M. Thurnherr
|
31
|
6 |
# uE-Info: 39 36 NIL 0 0 72 2 2 4 NIL ofnI
|
30
|
7 |
#======================================================================
|
|
8 |
|
|
9 |
# HISTORY:
|
|
10 |
# Jul 28, 2015: - created from [LWplot_BR]
|
|
11 |
# Jul 29, 2015: - finished
|
31
|
12 |
# Jul 30, 2015: - added bin_tics
|
|
13 |
# - added outGrid_* support
|
30
|
14 |
|
|
15 |
require "$ANTS/libGMT.pl";
|
|
16 |
|
|
17 |
sub plot_mean_residuals($)
|
|
18 |
{
|
|
19 |
my($pfn) = @_;
|
|
20 |
|
|
21 |
my($xmin) = -0.05;
|
|
22 |
my($xmax) = 0.05;
|
|
23 |
my($ymin) = 0.5;
|
|
24 |
my($ymax) = $P{BR_max_bin} + 0.5;
|
|
25 |
|
|
26 |
my($R) = "-R$xmin/$xmax/$ymin/$ymax";
|
|
27 |
GMT_begin($pfn,'-JX10/-10',$R,'-P');
|
|
28 |
|
31
|
29 |
if ($outGrid_firstBin>$LADCP_firstBin || $outGrid_lastBin<$LADCP_lastBin) {
|
|
30 |
GMT_psxy('-G200 -M -L');
|
|
31 |
printf(GMT ">\n%f %f\n%f %f\n%f %f\n%f %f\n",
|
|
32 |
$xmin,$LADCP_firstBin-0.5,
|
|
33 |
$xmax,$LADCP_firstBin-0.5,
|
|
34 |
$xmax,$outGrid_firstBin-0.5,
|
|
35 |
$xmin,$outGrid_firstBin-0.5)
|
|
36 |
if ($outGrid_firstBin>$LADCP_firstBin);
|
|
37 |
printf(GMT ">\n%f %f\n%f %f\n%f %f\n%f %f\n",
|
|
38 |
$xmin,$LADCP_lastBin+0.5,
|
|
39 |
$xmax,$LADCP_lastBin+0.5,
|
|
40 |
$xmax,$outGrid_lastBin+0.5,
|
|
41 |
$xmin,$outGrid_lastBin+0.5)
|
|
42 |
if ($outGrid_lastBin<$LADCP_lastBin);
|
|
43 |
}
|
|
44 |
|
30
|
45 |
GMT_psxy('-W1');
|
|
46 |
printf(GMT "0 $ymin\n0 $ymax\n");
|
|
47 |
|
|
48 |
GMT_psxy('-Mn -W4/coral');
|
|
49 |
for (my($bin)=0; $bin<scalar(@dc_bres); $bin++) {
|
|
50 |
printf(GMT "%f %d\n",$dc_avg_bres[$bin],$bin+1);
|
|
51 |
}
|
|
52 |
GMT_psxy('-Mn -Ex0.2/4/coral');
|
|
53 |
for (my($bin)=0; $bin<scalar(@dc_bres); $bin++) {
|
|
54 |
printf(GMT "%f %d %f\n",
|
|
55 |
$dc_avg_bres[$bin],
|
|
56 |
$bin+1,
|
|
57 |
(scalar(@{$dc_bres[$bin]}) > 1) ?
|
|
58 |
$dc_sig_bres[$bin]/sqrt(scalar(@{$dc_bres[$bin]})-1) : 0);
|
|
59 |
}
|
|
60 |
GMT_psxy('-Mn -W4/SeaGreen');
|
|
61 |
for (my($bin)=0; $bin<scalar(@uc_bres); $bin++) {
|
|
62 |
printf(GMT "%f %d\n",$uc_avg_bres[$bin],$bin+1);
|
|
63 |
}
|
|
64 |
GMT_psxy('-Mn -Ex0.2/4/SeaGreen');
|
|
65 |
for (my($bin)=0; $bin<scalar(@uc_bres); $bin++) {
|
|
66 |
printf(GMT "%f %d %f\n",
|
|
67 |
$uc_avg_bres[$bin],
|
|
68 |
$bin+1,
|
|
69 |
(scalar(@{$uc_bres[$bin]}) > 1) ?
|
|
70 |
$uc_sig_bres[$bin]/sqrt(scalar(@{$uc_bres[$bin]})-1) : 0);
|
|
71 |
}
|
|
72 |
|
|
73 |
GMT_unitcoords(); # LABELS
|
|
74 |
GMT_pstext(-Gblue);
|
|
75 |
print(GMT "0.02 0.98 12 0 0 BL $P{out_basename} $P{run_label}\n");
|
|
76 |
|
31
|
77 |
my($bin_tics) = ($ymax <= 20) ? 'f1a1' : 'f1a2';
|
30
|
78 |
GMT_setR($R); # FINISH PLOT
|
31
|
79 |
GMT_end("-Bf0.005a0.02:'Residual Vertical Velocity [m/s]':/$bin_tics:'Bin [#]':WeSn");
|
30
|
80 |
}
|
|
81 |
|
|
82 |
1; # return true on require
|