mirror of
https://github.com/wassname/simpegSeis.git
synced 2026-09-09 11:34:31 +08:00
Fix bug about averaging
Add Wiggle plot from Brendan
This commit is contained in:
+20229
-20241
File diff suppressed because it is too large
Load Diff
+9173
-7969
File diff suppressed because one or more lines are too long
@@ -179,7 +179,8 @@ class AcousticProblemSponge(Problem.BaseProblem):
|
||||
|
||||
Grad = self.mesh.cellGrad
|
||||
Div = self.mesh.faceDiv
|
||||
AvF2CC = self.mesh.aveF2CC
|
||||
# Be careful about averaging operator
|
||||
AvF2CC = self.mesh.dim*self.mesh.aveF2CC
|
||||
rho = 0.27*np.ones(self.mesh.nC)
|
||||
mu = rho*v**2
|
||||
DSig = sdiag(self.sig)
|
||||
@@ -342,7 +343,8 @@ class AcousticProblemPML(Problem.BaseProblem):
|
||||
self.mesh.setCellGradBC([['dirichlet', 'neumann'], ['dirichlet', 'neumann']])
|
||||
|
||||
Grad = self.mesh.cellGrad
|
||||
AvF2CC = self.mesh.aveF2CC
|
||||
# Be careful about averaging operator
|
||||
AvF2CC = self.mesh.dim*self.mesh.aveF2CC
|
||||
AvF2CCv = self.mesh.aveF2CCV
|
||||
rho = 0.27*np.ones(self.mesh.nC)
|
||||
mu = rho*v**2
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
def clipsign (value, clip):
|
||||
clipthese = abs(value) > clip
|
||||
return value * ~clipthese + np.sign(value)*clip*clipthese
|
||||
|
||||
def wiggle (traces,skipt=1,scale=1.,lwidth=.1,offsets=None,redvel=0.,tshift=0.,sampr=1.,clip=10.,color='black',fill=True,line=True):
|
||||
|
||||
ns = traces.shape[1]
|
||||
ntr = traces.shape[0]
|
||||
t = np.arange(ns)*sampr
|
||||
timereduce = lambda offsets, redvel, shift: [float(offset) / redvel + shift for offset in offsets]
|
||||
|
||||
if (offsets is not None):
|
||||
shifts = timereduce(offsets, redvel, tshift)
|
||||
else:
|
||||
shifts = np.zeros((ntr,))
|
||||
|
||||
for i in range(0, ntr, skipt):
|
||||
trace = traces[i].copy()
|
||||
trace[0] = 0
|
||||
trace[-1] = 0
|
||||
|
||||
if (line):
|
||||
plt.plot(i + clipsign(trace / scale, clip), t - shifts[i], color=color, linewidth=lwidth)
|
||||
if (fill):
|
||||
for j in range(ns):
|
||||
if (trace[j] < 0):
|
||||
trace[j] = 0
|
||||
plt.fill(i + clipsign(trace / scale, clip), t - shifts[i], color=color, linewidth=0)
|
||||
plt.grid(True)
|
||||
@@ -1,2 +1,3 @@
|
||||
from SeisAcousticTime import *
|
||||
from UtilsSeis import *
|
||||
|
||||
|
||||
Reference in New Issue
Block a user