forked from pieropoli/Seismic_Matlab_Functions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaup_pierce.m
More file actions
23 lines (15 loc) · 743 Bytes
/
Taup_pierce.m
File metadata and controls
23 lines (15 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function [s] = Taup_pierce(phase,evdep,mod,evlat,evlon,stlat,stlon)
if strcmp(phase,'ttp+') ~=1
I = [num2str(now) '-' num2str(rand(1)) '-' num2str(rand(1)) '-' num2str(rand(1)) '-' num2str(rand(1))];
system(['taup_pierce -mod ' char(mod) ' -evt ' num2str(evlat) ' ' num2str(evlon) ' -sta ' num2str(stlat) ' ' num2str(stlon) ' --ph ' char(phase) ' -h ' int2str(evdep) ' -o taup' num2str(I) '.tmp']);
% read the output
if exist(['taup' num2str(I) '.tmp'],'file') == 2
[s.dist, s.dep, s.time, s.lat, s.lon ]=textread(['taup' num2str(I) '.tmp'],'%f %f %f %f %f %*[^\n]','headerlines',1);
else
s= nan;
end
system(['rm -fr taup' num2str(I) '.tmp']);
else
disp('ERROR!!! The pahse need to be declared. You cannot use ttp+')
s=NaN;
end