import quakedbase import numpy as np import timeit import matplotlib.pyplot as plt import CURefPy import obspy import copy # Initialize ASDF dataset # dset=quakedbase.quakeASDF('/scratch/summit/life9360/ALASKA_work/ASDF_data/ref_Alaska.h5') dset = quakedbase.quakeASDF('ref_Alaska.h5') # dset.cat = quakedbase.obspy.read_events('/scratch/summit/life9360/ALASKA_work/quakeml/alaska_2017_aug.ml') dset.cat = quakedbase.obspy.read_events('test.ml') staid = 'TA.C23K' st = dset.waveforms[staid]['body_ev_00001'] stla, elev, stlo = dset.waveforms[staid].coordinates.values() porigin = dset.cat[0].preferred_origin() evlo = porigin.longitude evla = porigin.latitude evdp = porigin.depth for tr in st: tr.stats.sac = obspy.core.util.attribdict.AttribDict() tr.stats.sac['evlo'] = evlo tr.stats.sac['evla'] = evla tr.stats.sac['evdp'] = evdp tr.stats.sac['stlo'] = stlo tr.stats.sac['stla'] = stla inrefparam = CURefPy.InputRefparam() refTr = CURefPy.RFTrace() refTr.get_data(Ztr=st.select(component='Z')[0], RTtr=st.select(component=inrefparam.reftype)[0],
import quakedbase import numpy as np import timeit import matplotlib.pyplot as plt # Initialize ASDF dataset # dset1=quakedbase.quakeASDF('/scratch/summit/life9360/ALASKA_work/ASDF_data/ref_Alaska_002.h5') # # # dset1 # dset1.copy_asdf('/scratch/summit/life9360/ALASKA_work/ASDF_data/debug_AK.BESE.h5', 'AK', 'BESE') dset2=quakedbase.quakeASDF('/scratch/summit/life9360/ALASKA_work/ASDF_data/debug_AK.BESE.h5') # dset=quakedbase.quakeASDF('ref_Alaska.h5') # dset.cat = quakedbase.obspy.read_events('/scratch/summit/life9360/ALASKA_work/quakeml/alaska_2017_aug.ml') # dset.cat = quakedbase.obspy.read_events('test.ml') # print dset.events[0] # Retrieving earthquake catalog # ISC catalog # dset.get_events(startdate='1991-01-01', enddate='2015-02-01', Mmin=5.5, magnitudetype='mb', gcmt=True) # gcmt catalog # dset.get_events(startdate='1991-01-01', enddate='2017-08-31', Mmin=5.5, magnitudetype='mb', gcmt=True) # Getting station information # dset.get_stations(channel='BH*', minlatitude=52., maxlatitude=72.5, minlongitude=-172., maxlongitude=-122.) # Downloading data # t1=timeit.default_timer() # # st=dset.get_body_waveforms() # dset.read_body_waveforms_DMT_rtz(datadir='/scratch/summit/life9360/ALASKA_work/p_wave_19910101_20170831') # t2=timeit.default_timer() # print t2-t1, 'sec' #
import quakedbase import numpy as np import timeit import matplotlib.pyplot as plt # Initialize ASDF dataset dset=quakedbase.quakeASDF('/work1/leon/ALASKA_work_20180808_old/ASDF_data/ref_Alaska_hs_bk.h5') # dset.add_quakeml('/scratch/summit/life9360/ALASKA_work/quakeml/alaska_2017_aug.ml') # dset=quakedbase.quakeASDF('ref_Alaska.h5') # dset.cat = quakedbase.obspy.read_events('/scratch/summit/life9360/ALASKA_work/quakeml/alaska_2017_aug.ml') # dset.cat = quakedbase.obspy.read_events('test.ml') # print dset.events[0] # Retrieving earthquake catalog # ISC catalog # dset.get_events(startdate='1991-01-01', enddate='2015-02-01', Mmin=5.5, magnitudetype='mb', gcmt=True) # gcmt catalog # dset.get_events(startdate='1991-01-01', enddate='2017-08-31', Mmin=5.5, magnitudetype='mb', gcmt=True) # Getting station information # dset.get_stations(channel='BH*', minlatitude=52., maxlatitude=72.5, minlongitude=-172., maxlongitude=-122.) # Downloading data # t1=timeit.default_timer() # # st=dset.get_body_waveforms() # dset.read_body_waveforms_DMT_rtz(datadir='/scratch/summit/life9360/ALASKA_work/p_wave_19910101_20170831') # t2=timeit.default_timer() # print t2-t1, 'sec' # # # Computing receiver function # dset.compute_ref(walltimeinhours=135., startind=78) # dset.compute_ref(walltimeinhours=150, startind=92)
import quakedbase import numpy as np import timeit import matplotlib.pyplot as plt # Initialize ASDF dataset # dset1=quakedbase.quakeASDF('/scratch/summit/life9360/ALASKA_work/ASDF_data/ref_Alaska_002.h5') # # # dset1 # dset1.copy_asdf('/scratch/summit/life9360/ALASKA_work/ASDF_data/debug_AK.BESE.h5', 'AK', 'BESE') dset2 = quakedbase.quakeASDF( '/scratch/summit/life9360/ALASKA_work/ASDF_data/debug_AK.BESE.h5') # dset=quakedbase.quakeASDF('ref_Alaska.h5') # dset.cat = quakedbase.obspy.read_events('/scratch/summit/life9360/ALASKA_work/quakeml/alaska_2017_aug.ml') # dset.cat = quakedbase.obspy.read_events('test.ml') # print dset.events[0] # Retrieving earthquake catalog # ISC catalog # dset.get_events(startdate='1991-01-01', enddate='2015-02-01', Mmin=5.5, magnitudetype='mb', gcmt=True) # gcmt catalog # dset.get_events(startdate='1991-01-01', enddate='2017-08-31', Mmin=5.5, magnitudetype='mb', gcmt=True) # Getting station information # dset.get_stations(channel='BH*', minlatitude=52., maxlatitude=72.5, minlongitude=-172., maxlongitude=-122.) # Downloading data # t1=timeit.default_timer() # # st=dset.get_body_waveforms() # dset.read_body_waveforms_DMT_rtz(datadir='/scratch/summit/life9360/ALASKA_work/p_wave_19910101_20170831') # t2=timeit.default_timer() # print t2-t1, 'sec'
import quakedbase import numpy as np import timeit import matplotlib.pyplot as plt # Initialize ASDF dataset dset = quakedbase.quakeASDF( '/work1/leon/ALASKA_work_20180808_old/ASDF_data/ref_Alaska_hs_bk.h5') # dset.add_quakeml('/scratch/summit/life9360/ALASKA_work/quakeml/alaska_2017_aug.ml') # dset=quakedbase.quakeASDF('ref_Alaska.h5') # dset.cat = quakedbase.obspy.read_events('/scratch/summit/life9360/ALASKA_work/quakeml/alaska_2017_aug.ml') # dset.cat = quakedbase.obspy.read_events('test.ml') # print dset.events[0] # Retrieving earthquake catalog # ISC catalog # dset.get_events(startdate='1991-01-01', enddate='2015-02-01', Mmin=5.5, magnitudetype='mb', gcmt=True) # gcmt catalog # dset.get_events(startdate='1991-01-01', enddate='2017-08-31', Mmin=5.5, magnitudetype='mb', gcmt=True) # Getting station information # dset.get_stations(channel='BH*', minlatitude=52., maxlatitude=72.5, minlongitude=-172., maxlongitude=-122.) # Downloading data # t1=timeit.default_timer() # # st=dset.get_body_waveforms() # dset.read_body_waveforms_DMT_rtz(datadir='/scratch/summit/life9360/ALASKA_work/p_wave_19910101_20170831') # t2=timeit.default_timer() # print t2-t1, 'sec' # # # Computing receiver function # dset.compute_ref(walltimeinhours=135., startind=78)
import quakedbase import numpy as np import pyaftan dset = quakedbase.quakeASDF('/scratch/summit/life9360/WUS_quake.h5') # dset.get_events(startdate='2005-1-01', enddate='2011-12-31', Mmin=5.5, magnitudetype='MS') # dset.get_stations(startdate='2005-1-01', enddate='2011-12-31', channel='LHZ', network='TA,US,IU,CI,AZ,BK,NN,UU' , # minlatitude=25.0, maxlatitude=50.0, minlongitude=-130.0, maxlongitude=-100.0) # dset.get_surf_waveforms_mp(outdir='/work3/leon/downloaded_waveforms', subsize=1000, deletemseed=True, nprocess=6, snumb=1930) # print dset.events[0] # Retrieving earthquake catalog # ISC catalog # dset.get_events(startdate='1991-01-01', enddate='2015-02-01', Mmin=5.5, magnitudetype='mb', gcmt=True) # gcmt catalog # dset.get_events(startdate='1991-01-01', enddate='2017-08-31', Mmin=5.5, magnitudetype='mb', gcmt=True) # # Getting station information # dset.get_stations(channel='LHZ', minlatitude=52., maxlatitude=72.5, minlongitude=-172., maxlongitude=-122.) # # Downloading data # t1=timeit.default_timer() # dset.read_surf_waveforms_DMT(datadir='/scratch/summit/life9360/ALASKA_work/surf_19950101_20170831', verbose=False) # dset.quake_prephp(outdir='/scratch/summit/life9360/WUS_quake_working_dir/pre_disp') # inftan = pyaftan.InputFtanParam() # inftan.tmax = 100. # inftan.tmin = 5. # dset.quake_aftan(prephdir='/scratch/summit/life9360/WUS_quake_working_dir/pre_disp_R', inftan=inftan) # dset.interp_disp(verbose=True) # dset.quake_get_field() import eikonaltomo
import quakedbase import numpy as np import timeit import matplotlib.pyplot as plt import pyaftan #------------------------------ # Initialize ASDF dataset #------------------------------ dset = quakedbase.quakeASDF('/work1/leon/US_work/ASDF_data/USCON_TA.h5') # dset.copy_catalog_fromasdf(inasdffname = '/work1/leon/ALASKA_work/ASDF_data/surf_Alaska_Love.h5_cat_inv') #------------------------------ # Retrieving earthquake catalog #------------------------------ # ISC catalog # dset.get_events(startdate='1991-01-01', enddate='2015-02-01', Mmin=5.5, magnitudetype='mb', gcmt=True) # gcmt catalog # dset.get_events(startdate='1991-01-01', enddate='2017-08-31', Mmin=5.5, magnitudetype='mb', gcmt=True) # gcmt catalog, updated on 20180831 # dset.get_events(startdate='2017-09-01', enddate='2018-04-30', Mmin=5.5, magnitudetype='mb', gcmt=True) # gcmt catalog, updated on 20190218 # dset.get_events(startdate='2018-05-01', enddate='2018-10-30', Mmin=5.5, magnitudetype='mb', gcmt=True) #------------------------------ # Getting station information #------------------------------ # # # dset.get_stations(channel='LHZ', minlatitude=52., maxlatitude=72.5, minlongitude=-172., maxlongitude=-122.) #------------------------------ # Download/Read data
import quakedbase import numpy as np import timeit import matplotlib.pyplot as plt # Initialize ASDF dataset dset=quakedbase.quakeASDF('../ref_AK.FID.h5') # # # # Retrieving earthquake catalog # dset.get_events(startdate='2010-07-26', enddate='2016-12-31', Mmin=5.5, magnitudetype='mb', add2dbase=True) # # # # # # # Getting station information # dset.get_stations(channel='BH*', station='FID', network='AK') # # # # # # Downloading data # # # # t1=timeit.default_timer() # st=dset.get_body_waveforms() # st=dset.get_body_waveforms_mp( outdir='./downloaded_P', verbose=False, nprocess=6) # t2=timeit.default_timer() # print t2-t1, 'sec' # # # Computing receiver function # dset.compute_ref() # dset.compute_ref_mp(outdir='/work3/leon/ref_working', verbose=True, nprocess=4) # try: del dset.auxiliary_data.RefRHS # except: pass # # # Harmonic analysis # dset.read_quakeml('U15A_cat.ml') # dset.harmonic_stripping(outdir='../test_ref_working') # dset.harmonic_stripping() # t2=timeit.default_timer() # print t2-t1, 'sec' # dset.plot_ref(network='AE', station='U15A', phase='P', datatype='RefRHS')
import quakedbase import numpy as np import timeit import matplotlib.pyplot as plt import pyaftan #------------------------------ # Initialize ASDF dataset #------------------------------ dset = quakedbase.quakeASDF('/work1/leon/ALASKA_work/ASDF_data/surf_Alaska.h5') # # # dset.add_quakeml('/scratch/summit/life9360/ALASKA_work/quakeml/alaska_2017_aug.ml') # # # print dset.events[0] #------------------------------ # Retrieving earthquake catalog #------------------------------ # ISC catalog # dset.get_events(startdate='1991-01-01', enddate='2015-02-01', Mmin=5.5, magnitudetype='mb', gcmt=True) # gcmt catalog # dset.get_events(startdate='1991-01-01', enddate='2017-08-31', Mmin=5.5, magnitudetype='mb', gcmt=True) # gcmt catalog, updated on 20180831 # dset.get_events(startdate='2017-09-01', enddate='2018-04-30', Mmin=5.5, magnitudetype='mb', gcmt=True) # gcmt catalog, updated on 20190218 # dset.get_events(startdate='2018-05-01', enddate='2018-10-30', Mmin=5.5, magnitudetype='mb', gcmt=True) #------------------------------ # Getting station information #------------------------------ # # # dset.get_stations(channel='LHZ', minlatitude=52., maxlatitude=72.5, minlongitude=-172., maxlongitude=-122.) #------------------------------
import quakedbase import numpy as np import pyaftan dset=quakedbase.quakeASDF('/scratch/summit/life9360/WUS_quake.h5') # dset.get_events(startdate='2005-1-01', enddate='2011-12-31', Mmin=5.5, magnitudetype='MS') # dset.get_stations(startdate='2005-1-01', enddate='2011-12-31', channel='LHZ', network='TA,US,IU,CI,AZ,BK,NN,UU' , # minlatitude=25.0, maxlatitude=50.0, minlongitude=-130.0, maxlongitude=-100.0) # dset.get_surf_waveforms_mp(outdir='/work3/leon/downloaded_waveforms', subsize=1000, deletemseed=True, nprocess=6, snumb=1930) # print dset.events[0] # Retrieving earthquake catalog # ISC catalog # dset.get_events(startdate='1991-01-01', enddate='2015-02-01', Mmin=5.5, magnitudetype='mb', gcmt=True) # gcmt catalog # dset.get_events(startdate='1991-01-01', enddate='2017-08-31', Mmin=5.5, magnitudetype='mb', gcmt=True) # # Getting station information # dset.get_stations(channel='LHZ', minlatitude=52., maxlatitude=72.5, minlongitude=-172., maxlongitude=-122.) # # Downloading data # t1=timeit.default_timer() # dset.read_surf_waveforms_DMT(datadir='/scratch/summit/life9360/ALASKA_work/surf_19950101_20170831', verbose=False) # dset.quake_prephp(outdir='/scratch/summit/life9360/WUS_quake_working_dir/pre_disp') # inftan = pyaftan.InputFtanParam() # inftan.tmax = 100. # inftan.tmin = 5. # dset.quake_aftan(prephdir='/scratch/summit/life9360/WUS_quake_working_dir/pre_disp_R', inftan=inftan) # dset.interp_disp(verbose=True) # dset.quake_get_field()
import quakedbase import numpy as np import timeit import matplotlib.pyplot as plt import CURefPy import obspy import copy # Initialize ASDF dataset # dset=quakedbase.quakeASDF('/scratch/summit/life9360/ALASKA_work/ASDF_data/ref_Alaska.h5') dset=quakedbase.quakeASDF('ref_Alaska.h5') # dset.cat = quakedbase.obspy.read_events('/scratch/summit/life9360/ALASKA_work/quakeml/alaska_2017_aug.ml') dset.cat= quakedbase.obspy.read_events('test.ml') staid = 'TA.C23K' st = dset.waveforms[staid]['body_ev_00001'] stla, elev, stlo = dset.waveforms[staid].coordinates.values() porigin = dset.cat[0].preferred_origin() evlo = porigin.longitude evla = porigin.latitude evdp = porigin.depth for tr in st: tr.stats.sac = obspy.core.util.attribdict.AttribDict() tr.stats.sac['evlo']= evlo tr.stats.sac['evla']= evla tr.stats.sac['evdp']= evdp tr.stats.sac['stlo']= stlo tr.stats.sac['stla']= stla inrefparam = CURefPy.InputRefparam() refTr = CURefPy.RFTrace() refTr.get_data(Ztr=st.select(component='Z')[0], RTtr=st.select(component=inrefparam.reftype)[0], tbeg=inrefparam.tbeg, tend=inrefparam.tend) refTr.IterDeconv( tdel=inrefparam.tdel, f0 = inrefparam.f0, niter=inrefparam.niter, minderr=inrefparam.minderr, phase='P' )