-
Notifications
You must be signed in to change notification settings - Fork 65
/
plotts.m
109 lines (92 loc) · 1.86 KB
/
plotts.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
%
% PLOTTS
%
% plotts(basename, bk, ek, comp, scale)
%
% Input:
% basename - Name of receiever data file
% bk: int
% ek: int
% comp: component number in usgs file
% scale: constant scale factor applied to all time series
%
function plotts(basename, bk, ek, comp, scale)
% assume comp=5 for now (pressure)
comp=5;
% first find global min and max in time series
pmax = -9e7;
pmin = 9e7;
for k=bk:ek
% make string for filename
fname=sprintf('%s%i.txt', basename, k);
[t r u1 u2 u3 p]=readusgs(fname);
lmax = max(p);
lmin = min(p);
if (lmax > pmax)
pmax = lmax;
end;
if (lmin < pmin)
pmin = lmin;
end;
end;
pmax;
pmin;
grange=pmax-pmin;
% now read the time series again and plot them with consistent scales
clf;
hold on;
for k=bk:ek
% make string for filename
fname=sprintf('%s%i.txt', basename, k);
[t r u1 u2 u3 p]=readusgs(fname);
lmax = max(p);
lmin = min(p);
lrange = lmax-lmin;
if (lmax > pmax)
pmax = lmax;
end;
if (lmin < pmin)
pmin = lmin;
end;
% scale = lrange/grange;
% scale = 1.;
% scale = 10000 * grange/lrange;
k0 = 5;
% reduced time: k-k0 is range on a 10 km scale
toff = abs(k-k0)*10/0.4;
rscale = sqrt(0.5 + abs(k-k0));
plot(t - toff,((k-k0)*10.0 + rscale* p.*scale),'k','linewidth',2);
end;
hold off;
% tmp
return
if (erase ~= 0)
clf;
end
% east component
subplot(3,1,1)
if (erase == 0)
hold on;
end
h=plot(t+tshift,ux,colorstring);
%set(h,'LineWidth',2.0)
set(gca,'FontSize',20)
axis tight;
% north component
subplot(3,1,2)
if (erase == 0)
hold on;
end
h=plot(t+tshift,uy,colorstring);
%set(h,'LineWidth',2.0)
set(gca,'FontSize',20)
axis tight;
% up component
subplot(3,1,3)
if (erase == 0)
hold on;
end
h=plot(t+tshift,uz,colorstring);
%set(h,'LineWidth',2.0)
set(gca,'FontSize',20)
axis tight;