import surfdbase import os import numpy as np dset = surfdbase.invhdf5( '/work1/leon/ALASKA_work/mc_inv_files/inversion_alaska_surf_20190404_no_osci.h5' ) dlst = np.array( [3., 10., 20., 30., 40., 50., 60., 70., 80., 90., 100., 110., 120., 130.]) # i = 0 outdir = '/home/leon/ALASKA_figs_un_no_osci' if not os.path.isdir(outdir): os.makedirs(outdir) cmap = surfdbase.discrete_cmap(8, 'hot_r') for depth in dlst: vmin = 0. vmax = 0.16 outfname = outdir + '/un_' + str(int(depth)) + 'km.jpg' print 'plotting: ' + outfname dset.plot_paraval(pindex='vs_std_ray', depth=depth, depthavg=0., is_smooth=True, clabel='Uncertainties (km/s)', cmap=cmap,\ title=str(int(depth))+' km', projection='lambert', vmin=vmin, vmax=vmax, showfig=False, outimg = outfname) # break i += 1
import surfdbase import copy # dset = surfdbase.invhdf5('/work1/leon/ALASKA_work/mc_inv_files/inversion_alaska_surf_20190327_no_ocsi_crust_15_mantle_0_vti.h5') # dset = surfdbase.invhdf5('/work1/leon/ALASKA_work/mc_inv_files/inversion_alaska_surf_20190327_no_ocsi_crust_15_mantle_0_vti_gr.h5') # dset = surfdbase.invhdf5('/work1/leon/ALASKA_work/mc_inv_files/inversion_alaska_surf_20190501_no_osci_vti_sed_25_crt_10_mantle_10_col.h5') dset = surfdbase.invhdf5( '/work1/leon/ALASKA_work/mc_inv_files/inversion_alaska_surf_20190501_no_osci_vti_sed_25_crt_10_mantle_0_col.h5' ) # # dset = surfdbase.invhdf5('/work1/leon/ALASKA_work/mc_inv_files/inversion_alaska_surf_20190327_no_ocsi_crust_0_mantle_10_vti_gr.h5') # dset = surfdbase.invhdf5('/work1/leon/ALASKA_work/mc_inv_files/inversion_alaska_surf_20190401_no_ocsi_crust_0_mantle_0_vti.h5') #------------------------- # before inversion #------------------------- # dset.read_hybridtomo_dbase(inh5fname='/work1/leon/ALASKA_work/hdf5_files/eikonal_hybrid_Love_20190318.h5',\ # runid=0, semfactor=2., Tmin=8., Tmax=50., wtype='lov') # ------------------------- # inversion # ------------------------- # # dset.mc_inv_vti(use_ref=True, outdir='/work1/leon/ALASKA_work/mc_inv_files/mc_alaska_surf_20190401_150000_crust_0_mantle_0_vti', # numbrun=150000, nprocess=20, verbose=False, group=False, Ntotalruns=1) # dset.mc_inv_vti(use_ref=True, outdir='/work1/leon/ALASKA_work/mc_inv_files/mc_alaska_surf_20190501_150000_sed_25_crust_10_mantle_10_vti_col', # numbrun=150000, nprocess=20, verbose=False, group=False, Ntotalruns=1) dset.mc_inv_vti( use_ref=True, outdir= '/work1/leon/ALASKA_work/mc_inv_files/mc_alaska_surf_20190501_150000_sed_25_crust_10_mantle_0_vti_col',
import surfdbase import copy # dset = surfdbase.invhdf5('/work1/leon/ALASKA_work/mc_inv_files/inversion_alaska_surf_20190327_no_ocsi_crust_15_mantle_0_vti.h5') dset = surfdbase.invhdf5( '/work1/leon/ALASKA_work/mc_inv_files/inversion_alaska_surf_20190327_no_ocsi_crust_15_mantle_0_vti_gr.h5' ) # dset = surfdbase.invhdf5('/work1/leon/ALASKA_work/mc_inv_files/inversion_alaska_surf_20190327_no_ocsi_crust_15_mantle_10_vti_gr.h5') # dset = surfdbase.invhdf5('/work1/leon/ALASKA_work/mc_inv_files/inversion_alaska_surf_20190327_no_ocsi_crust_0_mantle_10_vti_gr.h5') # dset = surfdbase.invhdf5('/work1/leon/ALASKA_work/mc_inv_files/inversion_alaska_surf_20190401_no_ocsi_crust_0_mantle_0_vti.h5') #------------------------- # before inversion #------------------------- # dset.read_hybridtomo_dbase(inh5fname='/work1/leon/ALASKA_work/hdf5_files/eikonal_hybrid_Love_20190318.h5',\ # runid=0, semfactor=2., Tmin=8., Tmax=50., wtype='lov') # ------------------------- # inversion # ------------------------- # # dset.mc_inv_vti(use_ref=True, outdir='/work1/leon/ALASKA_work/mc_inv_files/mc_alaska_surf_20190401_150000_crust_0_mantle_0_vti', # numbrun=150000, nprocess=20, verbose=False, group=False, Ntotalruns=1) # dset.mc_inv_vti(use_ref=True, outdir='/work1/leon/ALASKA_work/mc_inv_files/mc_alaska_surf_20190401_150000_crust_0_mantle_0_vti', # numbrun=150000, nprocess=20, verbose=False, group=False, Ntotalruns=1) #------------------------- # read inversion results #------------------------- # dset.read_inv_vti(datadir='/work1/leon/ALASKA_work/mc_inv_files/mc_alaska_surf_20190327_150000_crust_15_mantle_0_vti', avgqc=False) # dset.read_inv_vti_2(datadir='/work1/leon/ALASKA_work/mc_inv_files/mc_alaska_surf_20190327_150000_crust_15_mantle_0_vti', avgqc=False)
import surfdbase import os import numpy as np dset = surfdbase.invhdf5( '/work1/leon/ALASKA_work/mc_inv_files/inversion_alaska_surf_20181202.h5') dlst = np.array( [3., 10., 20., 30., 40., 50., 60., 70., 80., 90., 100., 110., 120., 130.]) vlst = [[2.5, 3.5], [3.0, 3.6], [3.4, 3.8], [3.7, 4.2], [3.8, 4.5], [4.1, 4.5], [4.2, 4.5]] # i = 0 outdir = '/home/leon/ALASKA_figs_vs_new' if not os.path.isdir(outdir): os.makedirs(outdir) for depth in dlst: if i <= 6: v = vlst[i] else: v = vlst[-1] vmin = v[0] vmax = v[1] outfname = outdir + '/vs_' + str(int(depth)) + 'km.jpg' print 'plotting: ' + outfname dset.plot_horizontal(depth=depth, dtype='avg', depthavg=3., is_smooth=True, shpfx=None, clabel='Vs (km/s)', cmap='cv', title=str(int(depth))+' km', projection='lambert', hillshade=False,\ geopolygons=None, vmin=vmin, vmax=vmax, showfig=False, outfname = outfname) i += 1 import obspy cat = obspy.read_events('alaska_events.xml') i = 0
import surfdbase import copy # dset = surfdbase.invhdf5('/work1/leon/ALASKA_work/azi_inv_files/azi_20190624_useref.h5') # dset = surfdbase.invhdf5('/work1/leon/ALASKA_work/azi_inv_files/azi_20190626.h5') # dset = surfdbase.invhdf5('/work1/leon/ALASKA_work/azi_inv_files/azi_20190624_unamp_4.h5') # dset = surfdbase.invhdf5('/work1/leon/ALASKA_work/azi_inv_files/azi_20190701_fourlay.h5') dset = surfdbase.invhdf5( '/work1/leon/ALASKA_work/azi_inv_files/azi_20190701.h5') #------------------------- # before inversion #------------------------- # dset.read_eik_azi_aniso(inh5fname='/work1/leon/ALASKA_work/hdf5_files/azi_2deg_0.05_20190617.h5') # ------------------------- # inversion # ------------------------- # dset.compute_kernels_hti(misfit_thresh=5.) # vpr = dset.compute_kernels_hti(misfit_thresh=5.) # vpr = dset.compute_kernels_hti(outlon=209., outlat=63.1) # vpr = dset.linear_inv_hti(outlon=-150.+360., outlat = 65., depth_mid_mantle=80.) # vpr = dset.linear_inv_hti(outlon=-155.+360., outlat = 63.) # vpr = dset.linear_inv_hti(misfit_thresh=10.) # dset.linear_inv_hti(misfit_thresh=5.) # # # # # dset.construct_hti_model() # vpr = dset.linear_inv_hti(outlon=-150.+360., outlat = 65., depth_mid_mantle=80.)
import surfdbase import copy dset = surfdbase.invhdf5( '/work1/leon/ALASKA_work/mc_inv_files/inversion_alaska_surf_20190320_no_ocsi_vti.h5' ) # # vpr1 = dset.mc_inv_vti(use_ref=True, outdir='/work1/leon/ALASKA_work/mc_inv_files/mc_alaska_surf_20190325_150000_vti', # numbrun=150000, nprocess=35, verbose=False, group=False, outlon=-142., outlat = 60.) vpr2 = dset.mc_inv_vti( use_ref=True, outdir= '/work1/leon/ALASKA_work/mc_inv_files/mc_alaska_surf_20190325_150000_vti', numbrun=150000, nprocess=35, verbose=False, group=False, outlon=-150., outlat=65.) vpr2.model.vtimod.para2mod() vpr2.model.vtimod.get_paraind() vpr2.model.vtimod.update() vpr2.model.get_vti_vmodel() vpr2.model.vtimod.mod2para() vpr2.get_period() vpr2.compute_tcps_vti() vpr3 = copy.deepcopy(vpr2) # #