-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQC_01_09b_CrossSectionsAll.m
184 lines (127 loc) · 4.69 KB
/
QC_01_09b_CrossSectionsAll.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
%% --------
% QC_01_09_CrossSections(MeasCat)
% Displays sum of all sections with predefined parameters
% Input: MeasCat - Measured catalogue
function QC_01_09b_CrossSectionsAll(MeasCat, InLineDistance, SelectionDepth, Limits, varargin)
close all
if ~isnumeric(MeasCat)
error('Load catagoue in the correct format (see readme for description)')
end
PlotLimits = cell2mat(varargin);
%% definition of variables
disp(' ')
warning('Parameters for the density plot might need some adjustment')
GridStepSection = 1; % distance between closest grid points in km
MaxDistSection = 1; % maximum distance to event in km
GridStepMap = .01; % distance between closest grid points in km
MaxDistMap = .1; % maximum distance to event in km
% definition of event origin time, latitude, longitude, depth and magnitude
OriginTime = datenum(MeasCat(:,1), MeasCat(:,2), MeasCat(:,3), MeasCat(:,4), MeasCat(:,5), MeasCat(:,6));
EventLat = MeasCat(:, 7);
EventLon = MeasCat(:, 8);
EventDepth = MeasCat(:, 9);
EventMag = MeasCat(:, 10);
% freeing up the memory
clear MeasCat
% degree length
LatDegreeLength = 111.132;
LonToLatRatio = (cosd(((max(EventLat)-min(EventLat))/2)+min(EventLat))*111.3)/111.3;
LonDegreeLength = LatDegreeLength*LonToLatRatio;
%% plot
% color definition
FirstColor = [0 .47 .95];
SecondColor = [.95 .47 0];
ThirdColor = [.33 .66 0];
Grey = [.7 .7 .7];
figure('name', 'Epicentral map with denoted cross sections', 'Position', [100, 100, 1049, 1500])
subplot(2,1,1)
plot(EventLon, EventLat, '.', 'Color', FirstColor, 'MarkerSize', 2)
if ~isempty(PlotLimits)
xlim([PlotLimits(1) PlotLimits(3)])
ylim([PlotLimits(5) PlotLimits(7)])
else
xlim([min(EventLon) max(EventLon)])
ylim([min(EventLat) max(EventLat)])
end
hold on
daspect([1 LonToLatRatio 1])
xlabel('Longitude')
ylabel('Latitude')
plot(Limits(1,:), Limits(2,:), '-', 'Color', SecondColor)
plot(Limits(3,:), Limits(4,:), '-', 'Color', SecondColor)
plot(Limits(5,:), Limits(6,:), '-', 'Color', SecondColor)
plot(Limits(7,:), Limits(8,:), '-', 'Color', SecondColor)
plot(Limits(9,:), Limits(10,:), '-', 'Color', SecondColor)
% display faults
subplot(2,1,2)
plot(InLineDistance, SelectionDepth, '.', 'MarkerSize', 2, 'Color', FirstColor, 'LineWidth', 2)
if ~isempty(PlotLimits)
xlim([PlotLimits(2) PlotLimits(4)])
ylim([PlotLimits(6) PlotLimits(8)])
else
xlim([min(InLineDistance) max(InLineDistance)])
ylim([0 max(EventDepth)])
end
set(gca, 'YDir', 'reverse')
daspect([1 1 1])
xlabel('In-line Distance [km]')
ylabel('Hypocenter Depth [km]')
% title('In-line distance vs. depth', 'FontSize', 16, 'FontWeight', 'bold')
print(gcf,'CurrentFigures/QC_01_09_InLineVsDepth_section','-dpng', '-r300')
%% event density
%% epicental map density
[Density, X, Y] = xDensityPlot(EventLon, EventLat, GridStepMap, MaxDistMap);
% plot
figure('name', 'Event Density Map', 'Position', [100, 100, 1049, 1500])
subplot(2,1,1)
surf(X, Y, Density, 'LineStyle', 'none', 'FaceColor', 'interp')
daspect([1 LonToLatRatio 1])
view(0, 90)
h = colorbar;
% set(h, 'Position', [.92 .6 .02 .2])
ylabel(h, 'log10 of Number of Events')
grid off
if ~isempty(PlotLimits)
xlim([PlotLimits(1) PlotLimits(3)])
ylim([PlotLimits(5) PlotLimits(7)])
else
xlim([min(EventLon) max(EventLon)])
ylim([min(EventLat) max(EventLat)])
end
hold on
plot3(Limits(1,:), Limits(2,:), ones(5, 1) + 5, '-', 'Color', SecondColor)
plot3(Limits(3,:), Limits(4,:), ones(5, 1) + 5, '-', 'Color', SecondColor)
plot3(Limits(5,:), Limits(6,:), ones(5, 1) + 5, '-', 'Color', SecondColor)
plot3(Limits(7,:), Limits(8,:), ones(5, 1) + 5, '-', 'Color', SecondColor)
plot3(Limits(9,:), Limits(10,:), ones(5, 1) + 5, '-', 'Color', SecondColor)
disp(['Circle radius: ' num2str(MaxDistSection)])
disp(['Grid step: ' num2str(GridStepSection)])
disp(' ')
% title('Event Density Map', 'FontSize', 16, 'FontWeight', 'bold')
ylabel('Longitude')
xlabel('Latitude')
%% cross section
[Density, X, Y] = xDensityPlot(InLineDistance, SelectionDepth, GridStepSection, MaxDistSection);
% plot
subplot(2,1,2)
surf(X, Y, Density, 'LineStyle', 'none', 'FaceColor', 'interp')
view(0,-90)
daspect([1 1 1])
h = colorbar;
% set(h, 'Position', [.92 .1 .02 .2])
ylabel(h, 'log10 of Number of Events')
if ~isempty(PlotLimits)
xlim([PlotLimits(2) PlotLimits(4)])
ylim([PlotLimits(6) PlotLimits(8)])
else
xlim([min(InLineDistance) max(InLineDistance)])
ylim([0 max(EventDepth)])
end
disp(['Circle radius: ' num2str(MaxDistSection)])
disp(['Grid step: ' num2str(GridStepSection)])
disp(' ')
grid off
% title('Event Density Map', 'FontSize', 16, 'FontWeight', 'bold')
xlabel('Hypocenter Depth [km]')
ylabel('In-line Distance [km]')
print(gcf,'CurrentFigures/QC_01_09b_InLineVsDepthDens_sectionAll','-dpng', '-r300')