예제 #1
0
    def __init__(self,
                 file_G0,
                 files_Gs,
                 nlin_par_names,                 
                 file_d,
                 file_sd,
                 sites,
                 epochs,                 
                 regularization,
                 basis,
                 file_slip0,
                 ):
        super().__init__(file_G0, files_Gs, nlin_par_names,
                         file_d, file_sd, sites, epochs,
                         regularization, basis, file_slip0)

        assert self.epochs[0] == 0, 'The first epoch must be zero.'
        self.num_epochs = len(self.epochs) - 1

        ep = vj.EpochalIncrSlip(file_slip0)
        self.num_subflts = len(ep[0].flatten())

        ep = vj.EpochalDisplacement(file_sd, sites)
        self.num_obs = len(ep[0].flatten())

        self._compute_disp_caused_by_coseismic_slip()
예제 #2
0
import viscojapan as vj

ep = vj.EpochalDisplacement('cumu_post_with_seafloor.h5')

disp_co = ep[0]
epochs = ep.get_epochs()

ep2 = vj.EpochalData('post_obs.h5')

for epoch in epochs:
    print(epoch)
    disp = ep[epoch] - disp_co
    ep2[epoch] = disp

ep2.copy_info_from('cumu_post_with_seafloor.h5')
예제 #3
0
import numpy as np
from pylab import plt
from mpl_toolkits.axes_grid1 import make_axes_locatable

import viscojapan as vj

tp = np.loadtxt('ozawa_2011_obs_file', '4a,3f')
sites = [ii[0] for ii in tp]
disp0 = np.asarray([ii[1] for ii in tp]).flatten()
us0 = disp0[2::3]

ep = vj.EpochalDisplacement('cumu_post_with_seafloor.h5', filter_sites=sites)
disp1 = ep[0]
us1 = disp1[2::3]

plt.subplot(121)
bm = vj.MyBasemap(region_code='near')
mplt = vj.MapPlotDisplacement(basemap=bm)
mplt.plot_scalor(us0, sites, cmap='RdBu')
mplt = vj.MapPlotSlab(basemap=bm)
mplt.plot_top()
plt.clim([-1., 1.])

plt.subplot(122)
bm = vj.MyBasemap(region_code='near')
mplt = vj.MapPlotDisplacement(basemap=bm)
im = mplt.plot_scalor(us1, sites, cmap='RdBu')
mplt = vj.MapPlotSlab(basemap=bm)
mplt.plot_top()
plt.clim([-1., 1.])
예제 #4
0
파일: disp.py 프로젝트: geodesy/viscojapan
import h5py
from numpy import dot
from numpy.linalg import norm

import viscojapan as vj

g = vj.EpochalG('../../../greens_function/G_Rake80.h5')

G = g[0]


with h5py.File('../outs/ano_10.h5','r') as fid:
    Bm = fid['Bm'][...]
slip = Bm[:-1,:]

##with h5py.File('../../../final_slip/outs/ano_10.h5','r') as fid:
##    Bm = fid['Bm'][...]
##slip = Bm

d_pred = dot(G,slip)
print(d_pred)

d_ep = vj.EpochalDisplacement('../../../true_model/d_simu.h5')
d_true = d_ep[0]
print(d_true)
print(norm(d_pred-d_true))
예제 #5
0
import numpy as np

import viscojapan as vj

ep = vj.EpochalDisplacement('../../cumu_post.h5')

co = ep[0]
disp = ep[1200] - co
sites = ep.get_sites

sites_7_2EXPs = vj.tsana.get_sites_according_to_postmodel(
    '../../../config/postmodel', 7, '2EXPs')
sites_6_2EXPs = vj.tsana.get_sites_according_to_postmodel(
    '../../../config/postmodel', 6, '2EXPs')
sites_7_EXP = vj.tsana.get_sites_according_to_postmodel(
    '../../../config/postmodel', 7, 'EXP')
sites_6_EXP = vj.tsana.get_sites_according_to_postmodel(
    '../../../config/postmodel', 6, 'EXP')

##
scale = 1.7
U = 0.1

bm = vj.plots.MyBasemap(
    region_code='H',
    #region_box = (128,29,146,46),
    x_interval=2,
    y_interval=2)

mplt = vj.plots.MapPlotSlab(basemap=bm)
mplt.plot_top()
예제 #6
0
sites = np.loadtxt('../sites', '4a')
##ep = vj.EpochalDisplacement('../../cumu_post_with_seafloor.h5','../sites')
##slip_co = ep[0]
##
##
##mplt = vj.MapPlotDisplacement()
##
##mplt.plot_disp(slip_co,sites)
##plt.show()

ep = vj.EpochalSlip('../slip0/incr_slip0.h5')
slip_co = ep[0]

##mplt = vj.MapPlotFault('../fault_model/fault_bott50km.h5')
##mplt.plot_slip(slip_co)

ep_obs = vj.EpochalDisplacement('../../cumu_post_with_seafloor.h5', '../sites')

f_G = '../green_function/G_He50km_Vis5.8E18_Rake90.h5'
ep_co_disp = vj.EpochalG(f_G, filter_sites=sites)
for epoch in epochs:
    G = ep_co_disp[epoch]
    disp = np.dot(G, slip_co)
    disp_obs = ep_obs[epoch]

    mplt = vj.MapPlotDisplacement()
    mplt.plot_disp(disp_obs, sites, color='red')
    mplt.plot_disp(disp, sites)
    plt.title('%d' % epoch)
    plt.show()
예제 #7
0
from pylab import plt
import numpy as np

import viscojapan as vj

sites = np.loadtxt('sites', '4a')

ep = vj.EpochalDisplacement('post_obs.h5', filter_sites = sites)

bm = vj.MyBasemap(region_code='E')

mplt = vj.MapPlotDisplacement(bm)

scale=.0007
disp = ep[1]
mplt.plot_disp(disp, sites, color='red', scale=scale,
               X=0.8, Y=0.9, U=0.0001, label='0.1mm, 1 day')

scale = .5
disp = ep[1199]
mplt.plot_disp(disp, sites, scale=scale,
               X=0.8, Y=0.8, U=.05, label='5cm, 1199 day')
#mplt.plot_sites(sites)

plt.savefig('post_disp.pdf')
plt.show()