-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEQ_print_pnt3.m
executable file
·102 lines (87 loc) · 3.32 KB
/
EQ_print_pnt3.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
function EQ_print_pnt3 (finput,sites,vel)
% EQ_print_pnt3.m
% EQ Function that Format Prints Type 3 GPS Data recorded by SuGAr
% Nathanael Wong Zhixin, Feng Lujia
%
% INPUT:
% -- finput
% -- imported GPS Data recorded by SuGAr stations (siteList, vel)
% 1) list of GPS stations (siteList)
% 2) data recorded by GPS stations (vel)
%
% OUTPUT:
% -- r : Number of SuGAr stations
% -- Formatted print (fprintf) of the GPS data of format type 3
%
% FORMAT OF CALL: EQ_print_pnt3 (finput, Stations, Data)
%
% OVERVIEW:
% 1) This function will take as input imported GPS data of format type 3.
%
% 2) This function will then format print the header for the GPS data of
% format type 3.
%
% 3) The function will then count the number of GPS stations that recorded
% significant displacements from the earthquake event.
%
% 4) For each GPS station, the function will then read the imported GPS
% data and save them into the point parameters. These parameters are
% defined by measurements of displacements of the respective SuGAr
% stations affected by the individual events.
%
% -- type : type of GPS point data collected
% -- name : name of GPS station
%
% -- lon : longitude of GPS station (?)
% -- lat : latitude of GPS station (?)
% -- z : elevation of GPS station wrt sea-level (m)
%
% -- Ue : easting displacement measured by GPS station (m)
% -- Un : northing displacement measured by GPS station (m)
% -- Uz : vertical displacement measured by GPS station (m)
%
% -- eUe : error in measured easting displacement (m)
% -- eUn : error in measured northing displacement (m)
% -- eUz : error in measured vertical displacement (m)
%
% -- weight : reliability of GPS station (m)
%
% 5) It will then format print all these input parameters into an input
% file that is defined by finput.
%
% VERSIONS:
% 1) -- Created on 20160614 by Nathanael Wong
%
% 2) -- Final version validated and commented on 20190811 by Nathanael Wong
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PRINT HEADER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fprintf(finput,'# point type name');
fprintf(finput,' ');
fprintf(finput,'lon (d) lat (d) z (m)');
fprintf(finput,' ');
fprintf(finput,'Ue(m) Un (m) Uv (m)');
fprintf(finput,' ');
fprintf(finput,'eUe (m) eUn (m) eUv (m)');
fprintf(finput,' ');
fprintf(finput,'weight\n');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LOOP PRINT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[ r,~ ] = size(vel);
for i = 1:r
%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINE VARIABLES %%%%%%%%%%%%%%%%%%%%%%%%%%%
site = sites{i}; loc = vel(i,1:3);
disp = vel(i,4:6)/1000; err = vel(i,7:9)/1000;
wgt = vel(i,10);
%%%%%%%%%%%%%%%%%%%%%%%%%%% PRINT VARIABLES %%%%%%%%%%%%%%%%%%%%%%%%%%%
fprintf(finput,' point 3 %s',site);
fprintf(finput,' ');
fprintf(finput,'%-10.5f %-10.5f %-7.3f',loc);
fprintf(finput,' ');
fprintf(finput,'%-8.5f %-8.5f %-8.5f',disp);
fprintf(finput,' ');
fprintf(finput,'%-7.5f %-7.5f %-7.5f',err);
fprintf(finput,' ');
fprintf(finput,'%-3.1f\n',wgt);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end
fprintf (finput, ' \n');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end