-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEQ_print_bfitFile.m
executable file
·63 lines (54 loc) · 2.07 KB
/
EQ_print_bfitFile.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
function [ fID ] = EQ_print_bfitFile (name,data,EQin,sites,vel)
% EQ_print_bfitFile.m
% EQ Function that defines the names of the bfit files
% Nathanael Wong Zhixin, Feng Lujia
%
% This function defines the names of the various EQ files that are used for
% post processing and analysis. The function then creates an input file
% based on the imported data for the earthquake event.
%
% INPUT:
% -- name : earthquake event name/ID
% -- data : information on the earthquake event
% -- EQin : earthquake fault input information
% -- sites : GPS station input information
% -- vel : GPS displacement information
%
% OUTPUT:
% -- fID : structure containing information on file names
%
% FORMAT OF CALL: EQ_print_bfitFile (name,data,EQin,sites,vel)
%
% OVERVIEW:
% 1) This function extracts information on the GTdef-fault and GPS
% information type
%
% 2) The function then creates the filenames for the respective earthquake
%
% 3) The function then creates an input file based on the information for
% the earthquake imported from the parent function.
%
% VERSIONS:
% 1) -- Final version validated and commented on 20190811 by Nathanael Wong
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
flt = data.type(1); pnt = data.type(2);
fID.in = {}; fID.in = [ name '.in' ];
fID.out = {}; fID.out = [ name '_fwd.out' ];
fID.pch = {}; fID.pch = [ name '_fwd_patches.out' ];
fID.pnt = {}; fID.pnt = [ name '_fwd_point.out' ];
fID.xsc = {}; fID.xsc = [ name '_fwd_xsection.out' ];
fID.fit = {}; fID.fit = [ name '_fit1.txt' ];
fID.fat = {}; fID.fat = [ name '_fit2.txt' ];
fID.mve = {}; fID.mve = [ name '_mve.txt' ];
fEQin = fopen (fID.in,'w');
if flt == 1, EQ_print_flt1 (fEQin,data,EQin);
elseif flt == 2, EQ_print_flt2 (fEQin,data,EQin);
elseif flt == 3, EQ_print_flt3 (fEQin,data,EQin);
elseif flt == 4, EQ_print_flt4 (fEQin,data,EQin);
end
if pnt == 1, EQ_print_pnt1 (fEQin,sites,vel);
elseif pnt == 2, EQ_print_pnt2 (fEQin,sites,vel);
elseif pnt == 3, EQ_print_pnt3 (fEQin,sites,vel);
end
fclose (fEQin);
end