-
Notifications
You must be signed in to change notification settings - Fork 4
Source component
The second step is to declare a Source object. This object has as attributes an array with the names of the parameters (parameters), a Data object to project the results from the model (data), an initial guess for the parameters (x0), the lower (low_bounds) and upper bounds (high_bounds) for the parameters and two boolean parameters to indicate if the model is a discretization from another model (reg, False by default), and a parameter to indicate if the model should resolve for an offset on each of the components in the data (offsets).
To declare a Source object the user should give an initial guess (set_x0) for the parameters and the bounds for these (set_bounds).
VMOD implements the point source model from Mogi (1958). The parameters for this model are the location, depth and change of volume.
from source import Mogi
mog = Mogi(obs)
# The order of the parameters are xcen, ycen, depth, and change of volume
mog.set_x0([0,0,4e3,1e6])
mog.set_bounds(low_bounds=[-2e3,-2e3,0,-1e6], high_bounds=[2e3,2e3,4e3,1e6])VMOD includes a spherical model from the McTigue (1989) implementation. The parameters for this model are the location, depth, radius and change of volume.
from source import Mctigue
mct = Mctigue(obs)
# The order of the parameters are xcen, ycen, depth, radius and change of volume
mct.set_x0([0,0,4e3,1e3,1e6])
mct.set_bounds(low_bounds=[-2e3,-2e3,0,0,-1e6], high_bounds=[2e3,2e3,4e3,3e3,1e6])VMOD includes planar dislocation that can represent sill/dikes or faults. If it is a tensile dislocation the parameters for this model are the location and depth of the center, length, width, opening, strike and dip angles in degrees. Otherwise the parameters are the location and depth of the center, length, width, slip, strike, dip and rake angles in degrees.
from source import Okada
ok = Okada(obs)
# The order of the parameters are xcen, ycen, depth of the center, length, width, opening, strike and dip angles in degrees
ok.set_x0([8e3,-4e3,7e3,9e3,5e2,-0.3,50,1])
ok.set_bounds(low_bounds = [-20e3,-20e3,1e3,1e1,1e1,-100,1,1], high_bounds = [20e3,20e3,15e3,3e4,3e4,1,359,89])VMOD includes a penny shaped crack model from the Fialko (2001) implementation. The parameters for this model are the location, depth, radius and pressure.
from source import Penny
pen = Penny(obs)
# The order of the parameters are xcen, ycen, depth, radius and change of volume
pen.set_x0([0,0,4e3,1e3,0.1])
pen.set_bounds(low_bounds=[-2e3,-2e3,0,0,0], high_bounds=[2e3,2e3,4e3,3e3,1])VMOD has an implementation for a pressurized prolate spheroid. The parameters for this model are the location, depth, pressure, semimajor axis, semiminor axis, strike and dip angles in degrees.
from source import Yang
yg = Yang(obs)
# The order of the parameters are xcen, ycen, depth, pressure, semimajor axis, semiminor axis, strike and dip angles in degrees
yg.set_x0([[8e3,-4e3,5e3,-2e5,5e3,1e3,1,1])
yg.set_bounds([-10e3,-10e3,1e3,-1e9,1e3,1e3,0.1,0.1], high_bounds = [20e3,20e3,15e3,1e9,7e3,7e3,359,89])VMOD has an implementation for a pressurized open conduit. The parameters for this model are the location, depth, radius and length of a conduit and pressure of the conduit.
from source import Nish
nish = Nish(obs)
# The order of the parameters are xcen, ycen, depth, radius, length and pressure
nish.set_x0([0,0,2e3,90,3.9e3,-1e8])
nish.set_bounds(low_bounds=[-1e3,-1e3,5e2,1,1,-1e9], high_bounds=[1e3,1e3,7e3,1e3,5e3,1e9])VMOD has an implementation for a pressurized sphere within a viscoelastic medium. The parameters for this model are the location, depth, radius, of the sphere, pressure and a relaxation time. The deformation in the first time step is the deformation by the Mogi model. Therefore if the data does not have time steps the model would give the deformation of the Mogi model
from source import Vsphere
vsphere = Vsphere(obs)
# The order of the parameters are xcen, ycen, depth, radius, pressure and relaxation time
vsphere.set_x0([0,0,4e3,1e3,-1e6,5e5])
vsphere.set_bounds(low_bounds=[-10e3,-10e3,2e3,5e2,-1e9,1e4], high_bounds=[10e3,10e3,7e3,4e3,1e9,1e7])VMOD has an implementation for a pressurized sphere within a viscoelastic shell. The parameters for this model are the location, depth, radius, of the sphere, pressure and a relaxation time. The deformation in the first time step is the deformation by the Mogi model. Therefore if the data does not have time steps the model would give the deformation of the Mogi model
from source import Vshell
vshell = Vshell(obs)
# The order of the parameters are xcen, ycen, depth, radius1, radius2, pressure and relaxation time
vshell.set_x0([0,0,4e3,1e3,2e3,5e6,5e5])
vshell.set_bounds(low_bounds=[-10e3,-10e3,2e3,5e2,5e2,1e6,1e4], high_bounds=[10e3,10e3,7e3,3e3,3e3,1e7,1e6])VMOD implements the analytical solution for a pressurized well in a porelastic medium. The parameters for this model are the location, depth, width, overpressure and diffusivity.
from source import Wellsite
well=Wellsite(lvl)
well.set_x0([0,0,1000,70,60,6e-3,7])
well.set_bounds(low_bounds=[-10e3,-10e3,1,1,1,1e-4,1],high_bounds=[10e3,10e3,1e3,5e2,1e2,0.1,1e2])VMOD implements planar discretized distributions of dislocations. The parameters for this model are the openings or slips distributions in the patches. The parameters 'ln' and 'wn' refer to the patches along width and length and lamb is the regularization constant to be used in the inversion.
from source import Regdis
reg = Regdis(obs,typ='open',ln=5,wn=5,length=16000,width=12000,depth=5000,lamb=1e-9)
reg.set_x0(-20.0)
reg.set_bounds(low_bound = -20, high_bound = 20)VMOD implements a discretized distribution of dislocations to represent a ring fault. The parameters for this model are location, depth, slip, opening, semimajor axis, semiminor axis, width and strike.
from source import RFault
rf = RFault(obs)
rf.set_x0([0.0,0.0,3e3,-2.0,3.0,4e3,4e3,1e3,0.0])
#Bounds for parameters
rf.set_bounds(low_bounds = [-3e4,-3e4,1e3,-5.0,-5,1e3,1e3,5e2,0.0], high_bounds = [3e4,3e4,10e3,5.0,5,1e4,1e4,5e3,360])Users wishing to include a new model should clone the source repository and create a new file in the source folder. This file should contain a new class that inherit from the 'Source' class and that has a function returning the names of the parameters in your model and a function that gives the implementation of your model and return the 3d displacement. If you want to use this model with data that has a temporal dependency you should include the function 'model_t' that implements a time-dependant model. As an option you can include additional functions that return tilt displacements with the function 'model_tilt' or if it has a temporal dependency 'model_tilt_t'. For example, here we show the required functions in our Mogi model:
class Mogi(Source):
def set_parnames(self):
self.parameters=("xcen","ycen","depth","dV")
def model(self,x,y, xcen, ycen, d, dV, nu=0.25):
# Center coordinate grid on point source
x = x - xcen
y = y - ycen
# Convert to surface cylindrical coordinates
th, rho = util.cart2pol(x,y) # surface angle and radial distance
R = np.sqrt(d**2+rho**2) # radial distance from source
# Mogi displacement calculation
C = ((1-nu) / np.pi) * dV
ur = C * rho / R**3 # horizontal displacement, m
uz = C * d / R**3 # vertical displacement, m
ux, uy = util.pol2cart(th, ur)
return ux, uy, uz #returns tuple