Пример #1
0
    start = time.time()
    traceObspy.filter("bandpass",
                      corners=4,
                      freqmin=0.1,
                      freqmax=0.4,
                      zerophase=True)
    tsum = tsum + time.time() - start
avgBPSosFilterObspy = tsum / niter

#print("Obspy average time for detrend %e (s)"%(avgDetrendObspy))
tsum = 0
for i in range(niter):
    traceObspy.data = a + 1
    pct = 5. / 100. / 2.
    start = time.time()
    traceObspy.taper(pct, type='hamming')
    tsum = tsum + time.time() - start
    y = traceObspy.data
avgTaperObspy = tsum / niter

tsum = 0
for i in range(niter):
    start = time.time()
    lfilter(firHamming, 1, a)
    tsum = tsum + time.time() - start
avgFirFilterObspy = tsum / niter

tsum = 0
for i in range(niter):
    start = time.time()
    convolve(a, ramp, 'full')
Пример #2
0
        statsN.delta = sampling_rate_x
        statsN.starttime = starttime
        statsN.npts = len(traceN.data)
        statsN.network = net
        statsN.station = stationname
        statsN.location = ''
        statsN.channel = channelnameN
        traceN.stats = statsN
        traceN.stats.sac = obspy.core.AttribDict()
        traceN.stats.sac.back_azimuth = plottheta  # use this as azimuth of station

        #---applying filters---#
        traceN.filter('bandpass', freqmin=freqmin, freqmax=freqmax)
        tN = traceN.stats.starttime
        traceN.trim(starttime=tN, endtime=tN + trim_end_time)
        traceN.taper(0.05, side='right')

        #----------------------#
        stemp += Stream(traceN)
        # for EW components
        statsE = Stats()
        statsE.sampling_rate = 1.0 / sampling_rate_z
        statsE.delta = sampling_rate_z
        statsE.starttime = starttime
        statsE.npts = len(traceN.data)
        statsE.network = net
        statsE.station = stationname
        statsE.location = ''
        statsE.channel = channelnameE
        traceE.stats = statsE
        traceE.stats.sac = obspy.core.AttribDict()