forked from uafgeotools/capuaf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlam2nualpha.m
More file actions
69 lines (61 loc) · 2.16 KB
/
lam2nualpha.m
File metadata and controls
69 lines (61 loc) · 2.16 KB
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
function [nu,alpha] = lam2nualpha(lam)
%LAM2NUALPHA converts eigenvalues to nu and alpha
%
% INPUT
% lam 3 x n set of eigenvalue triples
%
% OUTPUT
% nu n x 1 vector of Poisson parameters (unitless)
% alpha n x 1 vector of angles between fault normal and slip vector, degrees [0,180]
%
% Reverse function is nualpha2lam.m
% See Tape and Tape (2013), "The classical model for moment tensors"
%
% Note that nu can take on any value for the double couple (alpha = 90).
%
% Carl Tape, 08-Jan-2013
%
lam = lamsort(lam);
lam1 = lam(1,:);
lam2 = lam(2,:);
lam3 = lam(3,:);
% TT2013, Eqs 32ab
alpha = 180/pi* acos( (lam1 - 2*lam2 + lam3) ./ (lam1 - lam3) );
nu = lam2 ./ (lam1 + lam3);
% column vectors
alpha = alpha(:);
nu = nu(:);
%==========================================================================
% EXAMPLES
if 0==1
%% example from TT2013, App A.
lam = [ 8.802 2.584 -1.851]';
[nu,alpha] = lam2nualpha(lam)
lamcheck = nualpha2lam(nu,alpha)
lam / norm(lam)
%% grid of values on the lune
dd = 0.5;
gvec = [-29:dd:29];
dvec = [-89:dd:89];
[Gamma,Delta] = meshgrid(gvec,dvec);
gamma = Gamma(:); delta = Delta(:);
lam = lune2lam(gamma,delta);
% calculate nu and alpha
[nu,alpha] = lam2nualpha(lam);
% scatter plot
figure; subplot(1,2,1); scatter(gamma,delta,4^2,nu,'filled');
axis equal, axis tight; caxis([-1 0.5]); colorbar;
xlabel('lune longitude'); ylabel('lune latitude'); title('\nu');
subplot(1,2,2); scatter(gamma,delta,4^2,alpha,'filled');
axis equal, axis tight; caxis([0 180]); colorbar;
xlabel('lune longitude'); ylabel('lune latitude'); title('\alpha');
% contour lines
nucons = [-2 -1:0.1:0.5 2];
figure; subplot(1,2,1); contour(Gamma,Delta,reshape(nu,size(Gamma)),nucons);
axis equal, axis tight; caxis([-1 0.5]); colorbar;
xlabel('lune longitude'); ylabel('lune latitude'); title('\nu');
subplot(1,2,2); contour(Gamma,Delta,reshape(alpha,size(Gamma)));
axis equal, axis tight; caxis([0 180]); colorbar;
xlabel('lune longitude'); ylabel('lune latitude'); title('\alpha');
end
%==========================================================================