Exemplo n.º 1
0
 def init_eigensolver(self, inmodel=None, T=None, Tmin=10., Tmax=50., dT=5.,
         c=None, cmin=2500., cmax=5000., dc=50., nmodes=1, zmax=400., dz=1.):
     #####
     # initialize eigenfunction solver
     #####
     if isinstance(inmodel, vmodel.model1d):
         eigensolver  = eigen.eigen_solver(inmodel)
     else:
         m=vmodel.model1d()
         m.get_radius(zmax, dz)
         m.model_prem()
         eigensolver  = eigen.eigen_solver(m)
     if not isinstance(T, np.ndarray):
         T = np.arange(Tmin, Tmax+dT, dT, dtype=np.float32)
     if not isinstance(c, np.ndarray):
         c = np.arange(cmin, cmax+dc, dc, dtype=np.float32)
     rmin    = np.float32(6371000. - zmax*1000.)
     dr      = np.float32(dz*1000.)
     eigensolver.init_dbase(T, c, rmin, dr, np.int32(nmodes))
     # if newsolver: 
     #     self.eigensolver.init_dbase(T, c, rmin, dr, np.int32(nmodes))
     # else:
     #     r = np.arange(rmin, 6371000.+dr, dr, dtype=np.float32)
     #     if r.size == self.eigensolver.r.size and T.size == self.eigensolver.T.size and \
     #         c.size == self.eigensolver.c.size and nmodes == self.eigensolver.nmodes:
     #         if not (np.allclose(r, self.eigensolver.r) and np.allclose(T, self.eigensolver.T) \
     #                 and np.allclose(c, self.eigensolver.c) and nmodes == self.eigensolver.nmodes):
     #             self.eigensolver.init_dbase(T, c, rmin, dr, nmodes)
     #     else:
     #         self.eigensolver.init_dbase(T, c, rmin, dr, nmodes)
     return eigensolver
Exemplo n.º 2
0
kernels for vph/vpv has from eigen is about 8 times larger compared with tcps




"""
import eigen, tcps
import vmodel
import numpy as np
import matplotlib.pyplot as plt

m=vmodel.model1d()
m=vmodel.model1d()
m=vmodel.read_model(m, 'ak135.txt')
# m.earth_flattening()
eig1 = eigen.eigen_solver(m)
eig1.init_default()
eig1.solve_PSV()


tcps1 = tcps.tcps_solver(m)
tcps1.init_default()
tcps1.solve_PSV()

tcps2 = tcps.tcps_solver(m)
tcps2.init_default(nl=100., dh=2.)
tcps2.verbose=1
tcps2.solve_PSV()


i=5