#!/usr/bin/env python import symdata import stations import numpy as np import obspy import obspy.signal.filter import matplotlib.pyplot as plt from scipy.fftpack import hilbert degree_sign = u'\N{DEGREE SIGN}' datadir = '/lustre/janus_scratch/life9360/ses3d_working_dir_2016/OUTPUT' stafile = '/lustre/janus_scratch/life9360/ses3d_working_dir_2016/INPUT/recfile_1' dbase = symdata.ses3dASDF( '/lustre/janus_scratch/life9360/ASDF_data/ses3d_2016_10sec_3comp.h5') SLst = stations.StaLst() SLst.read(stafile) evlo = 129.0 evla = 41.306 st = dbase.get_stream(staid='SES.98S47', SLst=SLst) st.decimate(10) stla, elve, stlo = dbase.waveforms['SES.98S47'].coordinates.values() dt = st[0].stats.delta dist, az, baz_ev = obspy.geodetics.gps2dist_azimuth(stla, stlo, evla, evlo) dist = dist / 1000. bazArr = baz_ev + np.arange(50) - 25. ### # # tmin=640; tmax=710; twin=2; tlength=20; vmin = 2. vmax = 5. tmin = dist / vmax
#!/usr/bin/env python import symdata import stations datadir = '/lustre/janus_scratch/life9360/ses3d_working_2016_US/OUTPUT' stafile='/lustre/janus_scratch/life9360/ses3d_working_2016_US/INPUT/recfile_1' dbase=symdata.ses3dASDF('/lustre/janus_scratch/life9360/ASDF_data/ses3d_2017_10sec_100sec_US_debug002.h5') # # dbase.zero_padding(2.5) evlo=-100.0 evla=40. try: del dbase.events except: pass dbase.AddEvent(evlo, evla, evdp=1.0) inftan=symdata.InputFtanParam() inftan.ffact=1. inftan.vmin=2.1 inftan.pmf=True inftan.tmax=40. try: del dbase.auxiliary_data.DISPbasic1 except: pass try: del dbase.auxiliary_data.DISPbasic2 except: pass try:
import matplotlib.pyplot as plt from matplotlib.colorbar import ColorbarBase from matplotlib.colors import Normalize import obspy from obspy.core.util import AttribDict from obspy.imaging.cm import obspy_sequential from obspy.signal.invsim import corn_freq_2_paz from obspy.signal.array_analysis import array_processing import symdata import stations import obspy.signal.filter import numpy as np stafile = '/work3/leon/ASDF_data/recfile_1' dset = symdata.ses3dASDF('/work3/leon/ASDF_data/ses3d_2016.h5') SLst = stations.StaLst() SLst.read(stafile) st = obspy.Stream() st.append( dset.get_trace(staid=None, lon=110, lat=34., outdir='.', SLst=SLst, channel='BXZ')) st.append( dset.get_trace(staid=None, lon=110, lat=34.25,
import symdata import stations import obspy import obspy.signal.filter import numpy as np stafile='/work3/leon/ASDF_data/recfile_1' dset = symdata.ses3dASDF('/work3/leon/ASDF_data/ses3d_2016.h5') SLst=stations.StaLst() SLst.read(stafile) dset.write2sac(staid=None, lon=110, lat=34., outdir='.', SLst=SLst, channel='BXE')
import symdata import stations datadir = '/lustre/janus_scratch/life9360/ses3d_working_dir_2016/OUTPUT' stafile='/lustre/janus_scratch/life9360/ses3d_working_dir_2016/INPUT/recfile_1' dset = symdata.ses3dASDF('/lustre/janus_scratch/life9360/ASDF_data/ses3d_2016_10sec_20sec.h5') evlo=129.029 evla=41.306 # del dset.events dset.AddEvent(evlo, evla, evdp=1.0) SLst=stations.StaLst() SLst.read(stafile) inftan=symdata.InputFtanParam() inftan.pmf=True inftan.vmin=2.0 # dset.get_ms(SLst, outdir='./ms_experiment', inftan=inftan, mindist=150., maxdist=3300., inaz=300.5, daz=0.5, channel='BXZ', # plottype='azimuth', prephdir='/lustre/janus_scratch/life9360/PRE_PHP/ses3d_2016_R') # dset.get_ms(SLst, outdir='./ms_experiment', inftan=inftan, mindist=200., maxdist=float('inf'), inaz=235.5, daz=0.5, channel='BXZ', # plottype='azimuth', prephdir='/lustre/janus_scratch/life9360/PRE_PHP/ses3d_2016_R') # dset.get_ms(SLst, outdir='./ms_experiment', inftan=inftan, mindist=150., maxdist=float('inf'), inaz=253.5, daz=0.5, channel='BXZ', # plottype='azimuth', prephdir='/lustre/janus_scratch/life9360/PRE_PHP/ses3d_2016_R') # dset.get_ms(SLst, outdir='./ms_experiment', inftan=inftan, mindist=475., maxdist=525., minaz=120., inaz=None, daz=0.5, channel='BXZ', # plottype='dist', prephdir='/lustre/janus_scratch/life9360/PRE_PHP/ses3d_2016_R', wfactor=1.) # dset.get_ms(SLst, outdir='./ms_experiment', inftan=inftan, mindist=1075., maxdist=1125., minaz=120., inaz=None, daz=0.5, channel='BXZ', # plottype='dist', prephdir='/lustre/janus_scratch/life9360/PRE_PHP/ses3d_2016_R', wfactor=1.) # dset.get_ms(SLst, outdir='./ms_experiment', inftan=inftan, mindist=1675., maxdist=1725., minaz=120., inaz=None, daz=0.5, channel='BXZ', # plottype='dist', prephdir='/lustre/janus_scratch/life9360/PRE_PHP/ses3d_2016_R')
"""Internal Gaussian filter function used for aftan """ om2 = -(omsArr-omega0)*(omsArr-omega0)*alpha/omega0/omega0 b=np.exp(om2) b[np.abs(om2)>=40.]=0. filterred_data=indata*b filterred_data[ns/2:]=0 filterred_data[0]/=2 filterred_data[ns/2-1]=filterred_data[ns/2-1].real+0.j return filterred_data degree_sign= u'\N{DEGREE SIGN}' datadir='/lustre/janus_scratch/life9360/ses3d_working_dir_2016/OUTPUT' stafile='/lustre/janus_scratch/life9360/ses3d_working_dir_2016/INPUT/recfile_1' dbase=symdata.ses3dASDF('/lustre/janus_scratch/life9360/ASDF_data/ses3d_2016_10sec_3comp.h5') SLst=stations.StaLst() SLst.read(stafile) evlo=129.0 evla=41.306 st = dbase.get_stream(staid='SES.98S47', SLst=SLst) dt=st[0].stats.delta # st.filter(type='bandpass', freqmin=0.095, freqmax=0.105) # # ns=max(1<<(st[0].data.size-1).bit_length(), 2**12) # different !!! # sp0=np.fft.fft(st[0].data, ns); sp1 =np.fft.fft(st[1].data, ns); sp2=np.fft.fft(st[2].data, ns) # domega = 2.*np.pi/ns/dt # alpha=10.; T0=10.; omsArr=np.arange(ns)*domega # # filterS0=_aftan_gaussian_filter(alpha=alpha, omega0=2*np.pi/T0, ns=ns, indata=sp0, omsArr=omsArr)
import symdata import stations datadir = '/lustre/janus_scratch/life9360/ses3d_working_dir_2016/OUTPUT' stafile = '/lustre/janus_scratch/life9360/ses3d_working_dir_2016/INPUT/recfile_1' dset = symdata.ses3dASDF( '/lustre/janus_scratch/life9360/ASDF_data/ses3d_2016_10sec_20sec.h5') evlo = 129.029 evla = 41.306 # del dset.events dset.AddEvent(evlo, evla, evdp=1.0) SLst = stations.StaLst() SLst.read(stafile) inftan = symdata.InputFtanParam() inftan.pmf = True inftan.vmin = 2.0 # dset.get_ms(SLst, outdir='./ms_experiment', inftan=inftan, mindist=150., maxdist=3300., inaz=300.5, daz=0.5, channel='BXZ', # plottype='azimuth', prephdir='/lustre/janus_scratch/life9360/PRE_PHP/ses3d_2016_R') # dset.get_ms(SLst, outdir='./ms_experiment', inftan=inftan, mindist=200., maxdist=float('inf'), inaz=235.5, daz=0.5, channel='BXZ', # plottype='azimuth', prephdir='/lustre/janus_scratch/life9360/PRE_PHP/ses3d_2016_R') # dset.get_ms(SLst, outdir='./ms_experiment', inftan=inftan, mindist=150., maxdist=float('inf'), inaz=253.5, daz=0.5, channel='BXZ', # plottype='azimuth', prephdir='/lustre/janus_scratch/life9360/PRE_PHP/ses3d_2016_R') # dset.get_ms(SLst, outdir='./ms_experiment', inftan=inftan, mindist=475., maxdist=525., minaz=120., inaz=None, daz=0.5, channel='BXZ', # plottype='dist', prephdir='/lustre/janus_scratch/life9360/PRE_PHP/ses3d_2016_R', wfactor=1.) # dset.get_ms(SLst, outdir='./ms_experiment', inftan=inftan, mindist=1075., maxdist=1125., minaz=120., inaz=None, daz=0.5, channel='BXZ', # plottype='dist', prephdir='/lustre/janus_scratch/life9360/PRE_PHP/ses3d_2016_R', wfactor=1.) # dset.get_ms(SLst, outdir='./ms_experiment', inftan=inftan, mindist=1675., maxdist=1725., minaz=120., inaz=None, daz=0.5, channel='BXZ', # plottype='dist', prephdir='/lustre/janus_scratch/life9360/PRE_PHP/ses3d_2016_R')
#!/usr/bin/env python import symdata import stations import numpy as np datadir = '/lustre/janus_scratch/life9360/ses3d_working_2016_US/OUTPUT' stafile = '/lustre/janus_scratch/life9360/ses3d_working_2016_US/INPUT/recfile_1' dbase = symdata.ses3dASDF( '/lustre/janus_scratch/life9360/ASDF_data/ses3d_2017_10sec_100sec_US.h5') pers = np.append(np.arange(12) * 2 + 10., np.arange(3) * 4 + 36) dbase.readtxt(datadir=datadir, stafile=stafile, channel='BXZ', verbose=True, VminPadding=2.0, factor=10) # dbase.zero_padding(2.5) evlo = -100.0 evla = 40. try: del dbase.events except: pass dbase.AddEvent(evlo, evla, evdp=1.0) # dbase.pre_php(outdir='/lustre/janus_scratch/life9360/ses3d_2017_US_phv/PRE_PHP') # # # tmin = 4.
import symdata import stations import obspy import obspy.signal.filter import numpy as np import matplotlib.pyplot as plt stafile='/work3/leon/ASDF_data/recfile_1' dset = symdata.ses3dASDF('/work3/leon/ASDF_data/ses3d_2016_10sec_3comp.h5') degree_sign= u'\N{DEGREE SIGN}' evlo=129.029 evla=41.306 st=dset.waveforms['SES.98S46'].ses3d_raw for tr in st: tr.stats.sac={} tr.stats.sac['evlo']=129.029; tr.stats.sac['evla']=41.306 tr.stats.sac['stlo']=110; tr.stats.sac['stla']=34 # st.decimate(10) st3=obspy.Stream() # bazArr=220.+np.arange(50) bazArr=48.+np.arange(50) dt=st[0].stats.delta tmin=640; tmax=710; twin=2; tlength=20; maxbaz=np.zeros(int((tmax-tmin)/twin)); N0=(np.arange(int((tmax-tmin)/twin))*twin+tmin)/dt Nt=(np.arange(int((tmax-tmin)/twin))*twin+tmin+tlength)/dt; Tmed=(Nt+N0)*dt/2 NminArr=np.ones(int((tmax-tmin)/twin))*999999 for baz in bazArr: st2=st.copy() st2.rotate(method='NE->RT', back_azimuth=baz) trT=st2[0]
#!/usr/bin/env python import symdata # dbase=symdata.ses3dASDF('/lustre/janus_scratch/life9360/ASDF_data/ses3d_2016_z_mp.h5') # dbase=symdata.ses3dASDF('/lustre/janus_scratch/life9360/ASDF_data/ses3d_2016_z.h5') dbase = symdata.ses3dASDF( '/lustre/janus_scratch/life9360/ASDF_data/ses3d_2016_test_aftan.h5') # dbase=symdata.ses3dASDF('/lustre/janus_scratch/life9360/ASDF_data/ses3d_2015_z.h5') # # inftan = symdata.InputFtanParam() inftan.ffact = 1. inftan.vmin = 2.1 inftan.pmf = False inftan.tmin = 1.0 inftan.tmax = 100. evlo = 129.0 evla = 41.306 try: del dbase.events except: pass dbase.AddEvent(evlo, evla, evdp=1.0) # try: # del dbase.auxiliary_data.DISPpmf2interp # except: # pass # # # try: # del dbase.auxiliary_data.FieldDISPpmf2interp