Skip to content

Commit

Permalink
Add P-wave polarisation direction to MS_phasevels
Browse files Browse the repository at this point in the history
We may want to know the polarisation direction for
the qP wave. This can be added to the output in a
fairly straight forward way. However, we still need
to think about the reference frame - see issue #23.
  • Loading branch information
andreww committed May 7, 2015
1 parent 2323eb2 commit 05fb575
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions msat/MS_phasevels.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
% Winterstein D. F. (1990). Velocity anisotropy terminology
% for geophysicists. Geophysics, vol 55, pp1070-1088.

% Copyright (c) 2011-2012, James Wookey and Andrew Walker
% Copyright (c) 2011-2015, James Wookey and Andrew Walker
% Copyright (c) 2007-2011, James Wookey
% All rights reserved.
%
Expand Down Expand Up @@ -83,7 +83,7 @@
% OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
% SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

function [pol,avs,vs1,vs2,vp, S1P, S2P] = MS_phasevels(C,rh,inc,azi)
function [pol,avs,vs1,vs2,vp, S1P, S2P, PP] = MS_phasevels(C,rh,inc,azi)

if (length(inc)~=length(azi))
error('MS:ListsMustMatch', ...
Expand Down Expand Up @@ -112,6 +112,8 @@
S1 = zeros(length(azi),3) ;
S1P = zeros(length(azi),3) ;
S2P = zeros(length(azi),3) ;

PP = zeros(length(azi),3) ;

% ** Handle isotropic case quickly
if isIsotropic(C, isotol)
Expand Down Expand Up @@ -159,6 +161,9 @@
S1P(ipair,:) = V_cross(XI,S1N);
S2N = V_cross(XI,S2) ;
S2P(ipair,:) = V_cross(XI,S2N);

PPN = V_cross(XI,P);
PP(ipair,:) = V_cross(XI,PPN);

% ** rotate into y-z plane to calculate angles
% (use functions optimised for the two needed
Expand Down

0 comments on commit 05fb575

Please sign in to comment.