
%load source_center.dat 
load stressdrop.dat 
%load source_center_int.dat 

orig=[-73 -36];
sci = stressdrop;
%sci = source_center;
%sci = source_center_int;

cx = -69.877; 
cy = 20.084; 

savelist = [];
dip = 15;
strike = 16.8;
len = 670;
wid = 260;

R = 6380; 

for i=1:length(sci)
  x = cx + (sci(i,1)-len/2)*sind(strike) + sci(i,2)*cosd(dip)*cosd(strike);
  y = cy + (sci(i,1)-len/2)*cosd(strike) - sci(i,2)*cosd(dip)*sind(strike);
  lat = orig(2) + y / R / pi * 180;  
  lon = orig(1) + x / (R*cosd(lat)) / pi * 180;
  savelist = [savelist; lon lat sci(i,3) sci(i,4)];
end

save -ascii stressdrop_ll.dat savelist 
%save -ascii source_center_ll.dat savelist 


