In [1]:
%matplotlib inline
import scipy
import numpy
import matplotlib.pyplot as plt
from utils import plot_planes_at


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-d04e1370b3df> in <module>()
      3 import numpy
      4 import matplotlib.pyplot as plt
----> 5 from utils import plot_planes_at

/Users/mpagani/Projects/oq-subduction/utils.py in <module>()
      3 import matplotlib.pyplot as plt
      4 
----> 5 from openquake.hazardlib.scalerel.wc1994 import WC1994
      6 
      7 

ImportError: No module named openquake.hazardlib.scalerel.wc1994

Note that in our case the p parameter of the Hessian form of the two planes is 0 since both are passing through the origin


In [ ]:
# FM plane
strike = 78
dip = 20
# Cross-section plane
strikecs = 110
dipcs = 89
inter = get_line_of_intersection(strike, dip, strikecs, dipcs) dlt = 5 pnt1 = dlt * inter xp = (sum(pnt1[:-1]**2))**.5 print xp, pnt1

In [ ]:
fig = plt.figure()
plot_planes_at(0,0, [strike], [dip], strikecs, dipcs)
plt.grid()
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D origin = numpy.zeros(3) d1 = -numpy.sum(origin*pln1[:-1]) d2 = -numpy.sum(origin*pln2[:-1]) # create x,y xx, yy = numpy.meshgrid(numpy.arange(-30, 30, 0.5), numpy.arange(-30, 30, 0.5)) # calculate corresponding z z1 = (-pln1[0]*xx - pln1[1]*yy - d1)*1./pln1[2] z2 = (-pln2[0]*xx - pln2[1]*yy - d2)*1./pln2[2] # plot the surface plt3d = plt.figure().gca(projection='3d') plt3d.plot_surface(xx,yy,z1, color='blue') plt3d.plot_surface(xx,yy,z2, color='red') t = numpy.arange(-50, 50, 0.1) xl = t*inter[0] yl = t*inter[1] zl = t*inter[2] aa = plt3d.plot(xl, yl, zl, '--r', lw=3)

In [ ]: