-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathplotsac.m
53 lines (48 loc) · 1.52 KB
/
plotsac.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
function varargout=plotsac(SeisData,HdrData,varargin)
% [ph,tl,xl,yl]=PLOTSAC(SeisData,HdrData,'Property','Value')
%
% Plots SAC data and puts a Guyotcentric title on it
%
% INPUT
%
% SeisData The numbers vector (e.g. from READSAC)
% HdrData The header structure array (e.g. from READSAC)
% 'Property' Some plot handle property
% 'Value' Some plot handle value
% ... You can input any number of pairs of these two
%
% OUTPUT
%
% ph The plot handle or object
% tl The title handle
% xl The x-label handle
% yl The y-label handle
%
% SEE ALSO
%
% READSAC, WRITESAC, MCM2SMAT
%
% Last modified by fjsimons-at-alum.mit.edu, 02/24/2020
% Guyot Hall STLO and STLA, check with SAC2SAC, check with HdrData
lola=guyotphysics(0);
% Plot the trace
ph=plot(linspace(HdrData.B,HdrData.E,HdrData.NPTS),SeisData);
% Cosmetics and annotation
tl=title(sprintf('recorded at Princeton University Guyot Hall %s (%10.5f%s,%10.5f%s)',...
deblank(HdrData.KSTNM),...
lola(1),176,lola(2),176),...
'FontWeight','Normal');
yl=ylabel(sprintf('uncorrected %s component',...
HdrData.KCMPNM));
xl=xlabel(sprintf('time (s) since %4.4i (%3.3i) %2.2i:%2.2i:%2.2i.%3.3i GMT',...
HdrData.NZYEAR,HdrData.NZJDAY,...
HdrData.NZHOUR,HdrData.NZMIN,HdrData.NZSEC,HdrData.NZMSEC));
axis tight
longticks(gca,2)
% Touch up, if requested
if ~isempty(varargin)
setx(ph,varargin{:})
end
% Optional output
varns={ph,tl,xl,yl};
varargout=varns(1:nargout);