コード例 #1
0
ファイル: run_eigen.py プロジェクト: NoisyLeon/CPSPy
import modesum
import vmodel
import numpy as np

dset1   = modesum.modesumASDF()
model   = vmodel.Model1d(modelindex=2, earthindex=2)
model.ak135()
dset1.getmodel(inmodel=model)
dset1.run_disp(workingdir='/home/leon/code/CPSPy/test_spherical', outfname='/home/leon/code/CPSPy/test_spherical.asdf', nmodes=2,
            period=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100])

# dset1.run_disp(workingdir='/home/leon/code/CPSPy/test_spherical', outfname='/home/leon/code/CPSPy/test_spherical.asdf', nmodes=2,
#             period=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100])
# dset1.run_eigen(hs=10., infname='/home/leon/code/CPSPy/test_spherical.asdf', outfname='/home/leon/code/CPSPy/test_spherical.asdf')
# dset1.write_disp('test.txt')

# dset2 = modesum.modesumASDF()
# model=vmodel.Model1d(modelindex=1, earthindex=1)
# model.ak135()
# dset2.getmodel(inmodel=model)
# dset2.run_disp(workingdir='/home/leon/code/CPSPy/test_flat', outfname='/home/leon/code/CPSPy/test_flat.asdf', nmodes=2,
#             period=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100])
# dset2.run_eigen(hs=0., infname='/home/leon/code/CPSPy/test_flat.asdf', outfname='/home/leon/code/CPSPy/test_flat.asdf')
# 


# dset.run_disp(workingdir='/home/leon/code/CPSPy/test_modesum_iso', outfname='/home/leon/code/CPSPy/eigen002.asdf', nmodes=2, period=[10, 20, 30, 40])
# dset.run_eigen(hs=0., infname='/home/leon/code/CPSPy/eigen002.asdf', outfname='/home/leon/code/CPSPy/eigen002.asdf')
# dset.load('./kerneltest_ti_0.asdf')
# dset.plot_eigen(wavetype='ray', period=10., dtype='dcdav', zmax=120, showfig=False)
# dset.plot_eigen(wavetype='ray', period=20., dtype='dcdav', zmax=120, showfig=False, newfig=False)
コード例 #2
0
ファイル: test_derivative.py プロジェクト: NoisyLeon/CPSPy
import modesum, vmodel
import matplotlib.pyplot as plt

run =1
per=[10., 15., 20., 25., 30., 35., 40]
datatype='vph'
dm=-0.04
zmax=10.
wavetype='Love'
wavetype='Rayleigh'



dset0 = modesum.modesumASDF()
# dset0.getmodel(h=1, zmax=200., modelindex=2)
dset0.load('/home/leon/code/CPSPy/kerneltest_ti_0.asdf')

d1, d2 = dset0.test_derivative( zmax=100., period=10., mode=0)

fig, ax=plt.subplots()

plt.plot(d1, 'x--', lw=3, ms=10, label='m0')
plt.plot(d2, 'o', ms=10, label='m0 kernel predicted')

# 
# model1 = dset0.model1d.copy()
# model1.perturb(zmax=zmax, dm=dm, datatype=datatype)
# # dset0.perturb(inmodel=dset0.model1d.copy(), wavetype='ray', perlst=[10., 20., 30., 40])
# 
# dset1 = modesum.modesumASDF()
# dset1.getmodel(inmodel=model1)
コード例 #3
0
import modesum, vmodel
import matplotlib.pyplot as plt
import numpy as np
import os
run =1
per=[10., 15., 20., 25., 30., 35., 40]
dm=-0.05
zmax=20.
wavetype='love'
wavetype='ray'

dti0 = modesum.modesumASDF()
mti  = vmodel.Model1d(modelindex=2)
mti.ak135()
mti.trim(zmax=400.)

dti0.getmodel(h=1, zmax=200., modelindex=2)
# dti0.getmodel(inmodel=mti)

if run:
    dti0.run_disp(workingdir='/home/leon/code/CPSPy/benchmark_ti_iso', outfname='/home/leon/code/CPSPy/benchmark_ti_0.asdf', nmodes=1,
                period=per)
    dti0.run_eigen(infname='/home/leon/code/CPSPy/benchmark_ti_0.asdf', outfname='/home/leon/code/CPSPy/benchmark_ti_0.asdf')
    dti0.del_dir()

    
os.chdir('/home/leon/code/CPSPy')
diso0 = modesum.modesumASDF()
# miso  = vmodel.Model1d(modelindex=1)
# miso.ak135()
# miso.trim(zmax=400.)
コード例 #4
0
import modesum
import vmodel

dset = modesum.modesumASDF()
model = vmodel.Model1d(modelindex=2, earthindex=2)
model.ak135()
dset.getmodel(inmodel=model)
dset.run_disp(workingdir='/home/leon/code/CPSPy/test_synthetic_spherical',
              outfname='/home/leon/code/CPSPy/test_synthetic_spherical.asdf',
              nmodes=1)
dset.run_eigen(hs=10.,
               runtype='SYN',
               infname='/home/leon/code/CPSPy/test_synthetic_spherical.asdf',
               outfname='/home/leon/code/CPSPy/test_synthetic_spherical.asdf')
dset.run_pulse(infname='/home/leon/code/CPSPy/test_synthetic_spherical.asdf',
               run=True)
コード例 #5
0
ファイル: axisem_vs_cps.py プロジェクト: NoisyLeon/CPSPy
import modesum
import vmodel

dset    = modesum.modesumASDF()
model   = vmodel.Model1d(modelindex=2, earthindex=2)
model.read_axisem_bm('/home/leon/code/axisem/SOLVER/MESHES/prem_aniso_10s/1dmodel_axisem.bm')
# model.trim(zmax=1000.)
dset.getmodel(inmodel=model)
dset.run_disp(workingdir='/home/leon/code/CPSPy/axisem_benchmark', outfname='/home/leon/code/CPSPy/axisem_benchmark.asdf', nmodes=1)
dset.run_eigen(hs=10., runtype='SYN', infname='/home/leon/code/CPSPy/axisem_benchmark.asdf',
            outfname='/home/leon/code/CPSPy/axisem_benchmark.asdf', run=True)
# dset.run_pulse(infname='/home/leon/code/CPSPy/axisem_benchmark.asdf', run=False, dist0=1000, Nd=1)



コード例 #6
0
import modesum, vmodel
import matplotlib.pyplot as plt
import numpy as np
run = 1
per = [10., 15., 20., 25., 30., 35., 40]
datatype = 'vph'
dm = -0.01
zmax = 10.
wavetype = 'Love'
wavetype = 'Rayleigh'

dset0 = modesum.modesumASDF()
dset0.getmodel(h=1, zmax=200., modelindex=2)
dset0.model1d.earthtype = 'FLAT EARTH'
if run:
    dset0.run_disp(workingdir='/home/leon/code/CPSPy/kerneltest_ti',
                   outfname='/home/leon/code/CPSPy/kerneltest_ti_0.asdf',
                   nmodes=1,
                   period=per)
    dset0.run_eigen(infname='/home/leon/code/CPSPy/kerneltest_ti_0.asdf',
                    outfname='/home/leon/code/CPSPy/kerneltest_ti_0.asdf')
dset0.load('/home/leon/code/CPSPy/kerneltest_ti_0.asdf')

model1 = dset0.model1d.copy()
model1.perturb(zmax=zmax, dm=dm, datatype=datatype)
# dset0.perturb(inmodel=dset0.model1d.copy(), wavetype='ray', perlst=[10., 20., 30., 40])
#
# dset1 = modesum.modesumASDF()
# dset1.getmodel(inmodel=model1)
# if run:
#     dset1.run_disp(workingdir='/home/leon/code/CPSPy/kerneltest_ti', outfname='/home/leon/code/CPSPy/kerneltest_ti_1.asdf', nmodes=1,
コード例 #7
0
import modesum
import vmodel
import numpy as np

dset1 = modesum.modesumASDF()
model = vmodel.Model1d(modelindex=2, earthindex=2)
model.ak135()
dset1.getmodel(inmodel=model)
dset1.run_disp(workingdir='/home/leon/code/CPSPy/test_spherical',
               outfname='/home/leon/code/CPSPy/test_spherical.asdf',
               nmodes=2,
               period=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100])

# dset1.run_disp(workingdir='/home/leon/code/CPSPy/test_spherical', outfname='/home/leon/code/CPSPy/test_spherical.asdf', nmodes=2,
#             period=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100])
# dset1.run_eigen(hs=10., infname='/home/leon/code/CPSPy/test_spherical.asdf', outfname='/home/leon/code/CPSPy/test_spherical.asdf')
# dset1.write_disp('test.txt')

# dset2 = modesum.modesumASDF()
# model=vmodel.Model1d(modelindex=1, earthindex=1)
# model.ak135()
# dset2.getmodel(inmodel=model)
# dset2.run_disp(workingdir='/home/leon/code/CPSPy/test_flat', outfname='/home/leon/code/CPSPy/test_flat.asdf', nmodes=2,
#             period=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100])
# dset2.run_eigen(hs=0., infname='/home/leon/code/CPSPy/test_flat.asdf', outfname='/home/leon/code/CPSPy/test_flat.asdf')
#

# dset.run_disp(workingdir='/home/leon/code/CPSPy/test_modesum_iso', outfname='/home/leon/code/CPSPy/eigen002.asdf', nmodes=2, period=[10, 20, 30, 40])
# dset.run_eigen(hs=0., infname='/home/leon/code/CPSPy/eigen002.asdf', outfname='/home/leon/code/CPSPy/eigen002.asdf')
# dset.load('./kerneltest_ti_0.asdf')
# dset.plot_eigen(wavetype='ray', period=10., dtype='dcdav', zmax=120, showfig=False)