File: mogi.py

package info (click to toggle)
python-bumps 0.7.11-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 10,264 kB
  • sloc: python: 22,226; ansic: 4,973; cpp: 4,849; xml: 493; makefile: 163; perl: 108; sh: 101
file content (32 lines) | stat: -rwxr-xr-x 919 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/env python

"""
Mogi's model of surface displacements from a point spherical source in an
elastic half space

References::
    [3] Mogi, K. Relations between the eruptions of various
    volcanoes and the deformations of the ground surfaces around them,
    Bull. Earthquake. Res. Inst., 36, 99-134, 1958.
"""

from numpy import array, pi

def mogi(data, x0, y0, z0, dV):
    """
    Computes surface displacements Ux, Uy, Uz in meters from a point spherical
    pressure source in an elastic half space [3].

    evaluate a single Mogi peak over a 2D (2 by N) numpy array of evalpts,
    where coeffs = (x0,y0,z0,dV)
    """
    dx = data[0,:] - x0
    dy = data[1,:] - y0
    dz = 0 - z0
    c = dV * 3. / 4. * pi
    # or equivalently c= (3/4) a^3 dP / rigidity
    # where a = sphere radius, dP = delta Pressure
    r2 = dx*dx + dy*dy + dz*dz
    C = c / pow(r2, 1.5)
    return array((C*dx,C*dy,C*dz))