def run(nregs): nrough = nregs[0] ntop = nregs[1] outf = 'outs/nrough_%02d_ntop_%02d.h5'%(nrough, ntop) print(outf) stdout = sys.stdout fid = open(os.devnull,'w') sys.stdout = fid inv = StaticInversion( file_G = '../../green_function/G5_He63km_VisM1.0E19_Rake83.h5', file_d = '../../cumu_post_with_seafloor.h5', file_sd = '../sd/sd_seafloor_01.h5', file_sites_filter = 'sites_with_seafloor', regularization = None, basis = basis_b_spline, ) inv.set_data_except(excepts=['L']) reg = Composite().\ add_component(component = reg_north, arg = 1e5, arg_name = 'north').\ add_component(component = reg_south, arg = 1e5, arg_name = 'south').\ add_component(component = rough, arg = reg_roughs[nrough], arg_name = 'roughening').\ add_component(component = reg_top, arg = reg_tops[ntop], arg_name = 'top') inv.regularization = reg inv.set_data_L() inv.invert() inv.predict() inv.save(outf, overwrite=True) sys.stdout = stdout fid.close()
def run(nregs): nrough = nregs[0] ntop = nregs[1] outf = 'outs/nrough_%02d_ntop_%02d.h5' % (nrough, ntop) print(outf) stdout = sys.stdout fid = open(os.devnull, 'w') sys.stdout = fid inv = StaticInversion( file_G='../../green_function/G5_He63km_VisM1.0E19_Rake83.h5', file_d='../../cumu_post_with_seafloor.h5', file_sd='../sd/sd_seafloor_01.h5', file_sites_filter='sites_with_seafloor', regularization=None, basis=basis_b_spline, ) inv.set_data_except(excepts=['L']) reg = Composite().\ add_component(component = reg_north, arg = 1e5, arg_name = 'north').\ add_component(component = reg_south, arg = 1e5, arg_name = 'south').\ add_component(component = rough, arg = reg_roughs[nrough], arg_name = 'roughening').\ add_component(component = reg_top, arg = reg_tops[ntop], arg_name = 'top') inv.regularization = reg inv.set_data_L() inv.invert() inv.predict() inv.save(outf, overwrite=True) sys.stdout = stdout fid.close()
def run(epoch): print(epoch) stdout = sys.stdout fid = open(os.devnull, 'w') sys.stdout = fid inv = StaticInversion( file_G='../G_He40km_Vis1.1E19_Rake81.h5', file_d='../cumu_post_with_seafloor.h5', file_sd='../sd/sd_ozawa.h5', file_sites_filter='../sites_with_seafloor', regularization=None, basis=basis, epoch=epoch, ) inv.set_data_except(excepts=['L']) for nrough in range(len(roughs)): outf = 'outs/epoch_%04d_rough_%02d.h5' % (epoch, nrough) print(outf) reg = Composite().\ add_component(component = reg_north, arg = 1e5, arg_name = 'north').\ add_component(component = reg_south, arg = 1e5, arg_name = 'south').\ add_component(component = rough, arg = roughs[nrough], arg_name = 'roughening').\ add_component(component = reg_top, arg = 0.02, arg_name = 'top') inv.regularization = reg inv.set_data_L() inv.invert() inv.predict() inv.save(outf, overwrite=True) sys.stdout = stdout fid.close()
def run(epoch): print(epoch) stdout = sys.stdout fid = open(os.devnull,'w') sys.stdout = fid inv = StaticInversion( file_G = '../G_He40km_Vis1.1E19_Rake81.h5', file_d = '../cumu_post_with_seafloor.h5', file_sd = '../sd/sd_ozawa.h5', file_sites_filter = '../sites_with_seafloor', regularization = None, basis = basis, epoch = epoch, ) inv.set_data_except(excepts=['L']) for nrough in range(len(roughs)): outf = 'outs/epoch_%04d_rough_%02d.h5'%(epoch,nrough) print(outf) reg = Composite().\ add_component(component = reg_north, arg = 1e5, arg_name = 'north').\ add_component(component = reg_south, arg = 1e5, arg_name = 'south').\ add_component(component = rough, arg = roughs[nrough], arg_name = 'roughening').\ add_component(component = reg_top, arg = 0.02, arg_name = 'top') inv.regularization = reg inv.set_data_L() inv.invert() inv.predict() inv.save(outf, overwrite=True) sys.stdout = stdout fid.close()
reg_north = NorthBoundary.create_from_fault_file(fault_file) reg_south = SouthBoundary.create_from_fault_file(fault_file) reg_top = FaultTopBoundary.create_from_fault_file(fault_file) basis = BasisMatrix.create_from_fault_file(fault_file) basis_b_spline = BasisMatrixBSpline.create_from_fault_file(fault_file) inv = StaticInversion( file_G = '../../green_function/G5_He63km_VisM1.0E19_Rake83.h5', file_d = '../../cumu_post_with_seafloor.h5', file_sd = '../sd/sd_seafloor_inf.h5', file_sites_filter = 'sites_with_seafloor', regularization = None, basis = basis, ) inv.set_data_except(excepts=['L']) roughs = logspace(-4, 0, 30) for nrough in range(len(roughs)): outf = 'outs/rough_%02d.h5'%(nrough) print(outf) reg = Composite().add_component(component = rough, arg = roughs[nrough], arg_name = 'roughening') inv.regularization = reg inv.set_data_L() inv.invert() inv.predict() inv.save(outf, overwrite=True)
reg_north = NorthBoundary.create_from_fault_file(fault_file) reg_south = SouthBoundary.create_from_fault_file(fault_file) reg_top = FaultTopBoundary.create_from_fault_file(fault_file) basis = BasisMatrix.create_from_fault_file(fault_file) basis_b_spline = BasisMatrixBSpline.create_from_fault_file(fault_file) inv = StaticInversion( file_G='../../green_function/G5_He63km_VisM1.0E19_Rake83.h5', file_d='../../cumu_post_with_seafloor.h5', file_sd='../sd/sd_seafloor_01.h5', file_sites_filter='sites_with_seafloor', regularization=None, basis=basis_b_spline, ) inv.set_data_except(excepts=['L']) roughs = logspace(-4, 0, 30) for nrough in range(len(roughs)): outf = 'outs/rough_%02d.h5' % (nrough) print(outf) reg = Composite().add_component(component=rough, arg=roughs[nrough], arg_name='roughening') inv.regularization = reg inv.set_data_L() inv.invert() inv.predict() inv.save(outf, overwrite=True)