Esempio n. 1
0
def simple():
  pgeo = {'o1':0,'d1':0.0608,'n1':15,
          'o2':0,'d2':0.0608,'n2':15}

  dwav = {'o1':0.0,'d1':0.004,'n1':251}

  vel  = np.ones((15,15),'f')*2
  
  vmod = lib.rsf2darray(**pgeo) 
  vmod.put(vel)

  wav = lib.rsf1darray(**dwav)
  wav.ricker(15.0,0.15)
  fftobj = lib.rsffft1(wav,Aunit='Hz',Aname='$f$')
  fir = fftobj.fft()
  fir.rsf = np.abs(fir.rsf)
  sx=0.12
  sz=0.02
  h_obj = lib.helmhotz(vmod,wav,sx,sz,nw=1,N=5,f=10.,free=True)
  h_obj.solve()

  matrix = h_obj.lhs(13.0)

  fig = plt2.figure(11,figsize=(10,5))
  ax  = fig.add_subplot(111)
  ax.imshow(matrix.todense().real)
Esempio n. 2
0
def goPluto(fn=1):
  '''
  This function produces the response at 
  f = 10Hz for the Pluto synthetic model, which
  mimics the marine geology of the Gulf of Mexico.
  '''
  pgeo = {'o1':0,'d1':0.0608,'n1':15,
          'o2':0,'d2':0.0608,'n2':15}

  dwav = {'o1':0.0,'d1':0.004,'n1':251}

  
  pluto = lib.rsf2darray(**pgeo)  
  vel =  np.ones((pgeo['n2'],pgeo['n1']),'f')*2.0
  for i1 in range(pgeo['n2']):
    if i1>7:
      vel[i1,:] *= 1.5
  #pluto.read('plutovel@')
  pluto.put(vel)
  plt.plotvel(pluto,fn=fn)
  
  wav = lib.rsf1darray(**dwav)
  wav.ricker(15.0,0.15)
  plt.plot1d(wav,fn=fn+1)

  fftobj = lib.rsffft1(wav,Aunit='Hz',Aname='$f$')
  fir = fftobj.fft()
  fir.rsf = np.abs(fir.rsf)
  plt.plot1d(fir,fn=fn+2)

  par = pgeo.copy()
  sx,sz = par['n2']*0.5*par['d2'] , par['n1']*0.5*par['d1'] 
  h_obj = lib.helmhotz(pluto,wav,sx,sz,nw=1,N=11,f=10.,free=True)

  u = h_obj.solve()
  
  wavefield = lib.rsf2darray(**pgeo)
  wavefield.put(u[0])
  plt.plotwavefield(wavefield,fn=fn+3,s=0.15)

  h_obj = lib.helmhotz(pluto,wav,sx,sz,nw=1,N=5,f=10.,free=False)

  u = h_obj.solve()
  wavefield = lib.rsf2darray(**pgeo)
  wavefield.put(u[0])
  plt.plotwavefield(wavefield,fn=fn+10,s=0.15)

  A = h_obj.returnA()

  
  fig = plt2.figure(20,figsize=(10,5))
  ax  = fig.add_subplot(111)
  im = ax.imshow(A.todense().real)
  divider = make_axes_locatable(ax)
  cax = divider.append_axes("right", size="2%", pad=0.05)
  cb = fig.colorbar(im,cax=cax)
Esempio n. 3
0
def goImpulse(d=2,fn=1,morder=12,fname=None):
  diff = []*3
  order = range(2,morder+1,2)
  i=0  
  ir = lib.rsf1darray(0,1,200)
  for o in order:
    diff = lib.Diff(order=d,n=o+1,h=1.) 
    i+=1 
    a = np.zeros(201)
    a[100] = 1.
    ir.rsf = np.convolve(a,diff.filter(),mode='same')
    fftobj = lib.rsffft1(ir)
    fir = fftobj.fft()
    fir.rsf = np.abs(fir.rsf)
    plt.plot1d(fir,fn=fn)
  fir.rsf = (fir.grid()*2.*np.pi)**d
  plt.plot1d(fir,fn=fn,fname=fname)
Esempio n. 4
0
def goPluto(fn=1):
  '''
  This function produces the response at 
  f = 10Hz for the Pluto synthetic model, which
  mimics the marine geology of the Gulf of Mexico.
  '''
  pgeo = {'o1':0,'d1':0.0608,'n1':125,
          'o2':0,'d2':0.0608,'n2':527}

  dwav = {'o1':0.0,'d1':0.004,'n1':251}

  
  pluto = lib.rsf2darray(**pgeo)  
  pluto.read('plutovel@')
  plt.plotvel(pluto,fn=fn,fname=dirFig+'Pluto.pdf')
  
  wav = lib.rsf1darray(**dwav)
  wav.ricker(15.0,0.15)
  plt.plot1d(wav,fn=fn+1,fname=dirFig+'twav.pdf')

  fftobj = lib.rsffft1(wav,Aunit='Hz',Aname='$f$')
  fir = fftobj.fft()
  fir.rsf = np.abs(fir.rsf)
  plt.plot1d(fir,fn=fn+2,fname=dirFig+'wwav.pdf')

  sx,sz = 16.,  0.05
  h_obj = lib.helmhotz(pluto,wav,sx,sz,nw=1,N=5,f=10.,free=True)

  u = h_obj.solve()
  
  wavefield = lib.rsf2darray(**pgeo)
  wavefield.put(u[0])
  plt.plotwavefield(wavefield,fn=fn+3,s=0.15,fname=dirFig+'free10Hz.pdf')

  h_obj = lib.helmhotz(pluto,wav,sx,sz,nw=1,N=5,f=10.,free=False)

  u = h_obj.solve()
  wavefield = lib.rsf2darray(**pgeo)
  wavefield.put(u[0])
  plt.plotwavefield(wavefield,fn=fn+10,s=0.15,fname=dirFig+'abc10Hz.pdf')