def test_Deconvoluation(self): file_G = join(self.share_dir, 'G.h5') file_d = join(self.share_dir, 'cumu_post_with_seafloor.h5') file_sd = join(self.share_dir, 'sites_sd.h5') file_sites_filter = join(self.share_dir, 'sites_0462') fault_file = join(self.share_dir, 'fault_He50km_east.h5') epochs = [0, 10, 30] basis = BasisMatrix.create_from_fault_file(fault_file, len(epochs)) rough = 1. temp = 1. reg = create_roughening_temporal_regularization( fault_file, epochs, rough, temp) inv = Deconvolution(file_G=file_G, file_d=file_d, file_sd=file_sd, file_sites_filter=file_sites_filter, epochs=epochs, regularization=reg, basis=basis) inv.set_data_all() inv.invert() inv.predict() inv.save(join(self.outs_dir, 'test.h5'), overwrite=True)
def test_StaticInversion(self): fault_file = join(self.share_dir, 'fault_He50km_east.h5') rough = Roughening.create_from_fault_file(fault_file) reg = Composite().add_component(rough, 1., 'roughening') basis = BasisMatrix.create_from_fault_file(fault_file) inv = StaticInversion( file_G=join(self.share_dir, 'G.h5'), file_d=join(self.share_dir, 'cumu_post_with_seafloor.h5'), file_sd=join(self.share_dir, 'sites_sd.h5'), file_sites_filter=join(self.share_dir, 'sites_with_seafloor'), regularization=reg, basis=basis, ) inv.set_data_all() inv.run() inv.save(join(self.outs_dir, 'out.h5'), overwrite=True)
def test_StaticInversion(self): fault_file = join(self.share_dir, 'fault_He50km_east.h5') rough = Roughening.create_from_fault_file(fault_file) reg = Composite().add_component(rough, 1., 'roughening') basis = BasisMatrix.create_from_fault_file(fault_file) inv = StaticInversion( file_G = join(self.share_dir, 'G.h5'), file_d = join(self.share_dir,'cumu_post_with_seafloor.h5'), file_sd = join(self.share_dir, 'sites_sd.h5'), file_sites_filter = join(self.share_dir, 'sites_with_seafloor'), regularization = reg, basis = basis, ) inv.set_data_all() inv.run() inv.save(join(self.outs_dir,'out.h5'), overwrite=True)
from os import makedirs from numpy import logspace import numpy as np import viscojapan as vj from viscojapan.inversion.basis_function import BasisMatrix, BasisMatrixBSpline from epochs import epochs fault_file = '../../fault_model/fault_bott80km.h5' rough = vj.inv.reg.Roughening.create_from_fault_file(fault_file) intensity = vj.inv.reg.Intensity.create_from_fault_file(fault_file) basis = BasisMatrix.create_from_fault_file(fault_file) basis_b_spline = BasisMatrixBSpline.create_from_fault_file(fault_file) regs_rough = logspace(-3,1,20) regs_aslip = logspace(-3,1,20) for epoch in epochs[1:]: inv = vj.inv.PostseismicStaticInversion( file_G = '../../green_function/G0_He50km_VisM6.3E18_Rake83.h5', file_d = '../../obs/cumu_post_with_seafloor.h5', file_sd = 'sd/sd_uniform.h5', filter_sites_file = 'sites_with_seafloor', regularization = None, basis = basis, fault_file = fault_file, epoch = epoch,
from numpy import logspace from os.path import exists import viscojapan as vj from viscojapan.inversion.regularization import Roughening, Composite from viscojapan.inversion.basis_function import BasisMatrix from epochs import epochs from reg_roughes import reg_roughes fault_file = '../fault_model/fault_bott50km.h5' basis = BasisMatrix.create_from_fault_file(fault_file, num_epochs = len(epochs)) inv = vj.OccamDeconvolutionSeparateCoPost2( file_G0 = '../green_function/G_He50km_Vis2.8E19_Rake90.h5', files_Gs = ['../green_function/G_He50km_Vis4.0E19_Rake90.h5', '../green_function/G_He45km_Vis2.8E19_Rake90.h5', '../green_function/G_He50km_Vis2.8E19_Rake85.h5' ], nlin_par_names = ['log10(visM)','log10(He)','rake'], file_d = '../obs/post_obs.h5', file_sd = 'sd/sd_hor_1_ver_5_sea_inf.h5', file_incr_slip0 = '../slip0/incr_slip0.h5', file_co_slip = '../slip0/incr_slip0.h5', filter_sites_file = 'sites_without_seafloor', epochs = epochs, regularization = None, basis = basis,
import viscojapan as vj from viscojapan.inversion import OccamDeconvolution from viscojapan.inversion.regularization import \ create_temporal_edge_roughening from viscojapan.inversion.basis_function import BasisMatrix from epochs import epochs from reg_edges import reg_edges from reg_roughes import reg_roughes fault_file = '../fault_model/fault_bott40km.h5' epochs = epochs[0:4] basis = BasisMatrix.create_from_fault_file(fault_file, num_epochs = len(epochs)) inv = OccamDeconvolution( file_G0 = '../green_function/G0_He40km_Vis5.8E18_Rake81.h5', files_Gs = ['../green_function/G1_He40km_Vis1.1E19_Rake81.h5', '../green_function/G2_He45km_Vis5.8E18_Rake81.h5', '../green_function/G3_He40km_Vis5.8E18_Rake90.h5' ], nlin_par_names = ['log10(visM)','log10(He)','rake'], file_d = '../obs/cumu_post_with_seafloor.h5', file_sd = 'sd/sd_uniform_seafloor_inf.h5', file_incr_slip0 = 'slip0/incr_slip0.h5', filter_sites_file = 'sites_2EXPs', epochs = epochs,
TemporalRegularization, Roughening, Composite, \ create_roughening_temporal_regularization from viscojapan.inversion.basis_function import BasisMatrix from epochs_log import epochs as epochs_log from alphas import alphas from betas import betas file_G = '../green_function/G_He40km_Vis5.8E18_Rake83.h5' file_d = '../../cumu_post_with_seafloor.h5' file_sd = '../../sites_sd/sites_sd.h5' file_sites_filter = 'sites_with_seafloor' fault_file = '../fault_model/fault_bott40km.h5' basis = BasisMatrix.create_from_fault_file(fault_file, len(epochs_log)) inv = Deconvolution(file_G=file_G, file_d=file_d, file_sd=file_sd, file_sites_filter=file_sites_filter, epochs=epochs_log, regularization=None, basis=basis) inv.set_data_except_L() for bno, beta in enumerate(betas): if bno != 10: continue for ano, alpha in enumerate(alphas): outfname = 'outs/ano_%02d_bno_%02d.h5' % (ano, bno)
create_roughening_temporal_regularization from viscojapan.inversion.basis_function import BasisMatrix from epochs_log import epochs as epochs_log from alphas import alphas from betas import betas file_G = '../green_function/G_He40km_Vis5.8E18_Rake83.h5' file_d = '../../cumu_post_with_seafloor.h5' file_sd = '../../sites_sd/sites_sd.h5' file_sites_filter = 'sites_with_seafloor' fault_file = '../fault_model/fault_bott40km.h5' basis = BasisMatrix.create_from_fault_file( fault_file, len(epochs_log)) inv = Deconvolution( file_G = file_G, file_d = file_d, file_sd = file_sd, file_sites_filter = file_sites_filter, epochs = epochs_log, regularization = None, basis = basis ) inv.set_data_except_L() for bno, beta in enumerate(betas): if bno != 10: