def makeTestImages(): dip = 30.0 shift = 16 n1,n2 = 501,501; f = FakeData.seismic2d2011A(n1,n2,dip) #n1,n2 = 462,951; f = readImage("/data/seis/f3d/f3d75.dat",n1,n2) f = sub(f,sum(f)/n1/n2) #w = Warp2.constant(shift,0.0,n1,n2) w = Warp2.sinusoid(shift,0.0,n1,n2) g = w.warp(f) f = addNoise(nrms,f,seed=10*seed+1) g = addNoise(nrms,g,seed=10*seed+2) s = zerofloat(n1,n2) for i2 in range(n2): for i1 in range(n1): s[i2][i1] = w.u1x(i1,i2) return f,g,s
def flatten(): #f = readImage(ffile) f = FakeData.seismic2d2011A(n1,n2,45) plot(f) #sigma = 8.0 sigma = 1.0 pmax = 10.0 lsf = LocalSlopeFinder(sigma,pmax) sigma1 = 6.0 sigma2 = 12.0 for fl in [FlattenerCg(sigma1,sigma2)]: p2 = zerofloat(n1,n2) el = zerofloat(n1,n2) lsf.findSlopes(f,p2,el) el = pow(el,6) #plot(el,gray) #plot(p2,gray,-1,1) s = fl.findShifts(p2,el) g = fl.applyShifts(f,s) plot(g) plot(s,jet) print "average shift =",sum(s)/(n1*n2),"samples"
def flatten(): #f = readImage(ffile) f = FakeData.seismic2d2011A(n1, n2, 45) plot(f) #sigma = 8.0 sigma = 1.0 pmax = 10.0 lsf = LocalSlopeFinder(sigma, pmax) sigma1 = 6.0 sigma2 = 12.0 for fl in [FlattenerCg(sigma1, sigma2)]: p2 = zerofloat(n1, n2) el = zerofloat(n1, n2) lsf.findSlopes(f, p2, el) el = pow(el, 6) #plot(el,gray) #plot(p2,gray,-1,1) s = fl.findShifts(p2, el) g = fl.applyShifts(f, s) plot(g) plot(s, jet) print "average shift =", sum(s) / (n1 * n2), "samples"