-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQC_01_02_EpicPlotMagnitudeDepth.m
72 lines (50 loc) · 1.67 KB
/
QC_01_02_EpicPlotMagnitudeDepth.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
%% --------
% QC_01_02_EpicPlotMagnitudeDepth(MeasCat)
% Displays simple epicentral plot with magnitude and depth of events
% Input: MeasCat - Measured catalogue
function QC_01_02_EpicPlotMagnitudeDepth(MeasCat, varargin)
PlotLimits = cell2mat(varargin);
close all
if ~isnumeric(MeasCat)
error('Load catagoue in the correct format (see readme for description)')
end
%% definition of variables
% 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
%% display plot
% color definition
FirstColor = [0 .47 .95];
SecondColor = [.95 .47 0];
ThirdColor = [.33 .66 0];
Grey = [.7 .7 .7];
% plot
if min(EventMag)<=0
MagShift = abs(min(EventMag)) + .5;
else
MagShift = 0;
end
DataScale = (EventMag + MagShift)*4;
figure('name', 'Epicentral Map w. magnitude and depth', 'Position', [100, 100, 1049, 895])
scatter(EventLon, EventLat, DataScale, EventDepth, 'filled', 'o')
if ~isempty(PlotLimits)
ylim([PlotLimits(1) PlotLimits(3)])
xlim([PlotLimits(2) PlotLimits(4)])
else
xlim([min(EventLon) max(EventLon)])
ylim([min(EventLat) max(EventLat)])
end
hold on
LonToLatRatio = (cosd((max(EventLat)-min(EventLat))/2)*111.3)/111.3;
daspect([1 LonToLatRatio 1])
h = colorbar;
ylabel(h, 'event depth')
title('Epicentral Map w. magnitude and depth', 'FontSize', 16, 'FontWeight', 'bold')
xlabel('Longitude')
ylabel('Latitude')
print(gcf,'CurrentFigures/QC_01_02_EpicentralMapMagDepth','-dpng', '-r300')