Exemplo n.º 1
0
def StaLta(self, slta):

    #get values for sta and lta
    tas = slta.split(' ')
    sta = eval(tas[0])
    lta = eval(tas[1])

    #first copy data stream. copy.data will be cft
    self_cft=self.copy()

    # for each trace of self_cft stream apply Sta/Lta
    # add sta lta values into the header
    for i in range(len(self_cft)):
        cft = recSTALTA(self_cft[i].data, \
              int(sta * self_cft[i].stats.sampling_rate), \
              int(lta * self_cft[i].stats.sampling_rate))

        # substitution data-->cft
        self_cft[i].data=cft

        # add sta lta values into the header
        self_cft[i].stats['Sta'] = sta
        self_cft[i].stats['Lta'] = lta


    return self_cft
Exemplo n.º 2
0
 def test_recSTALTAC(self):
     """
     Test case for ctypes version of recSTALTA
     """
     nsta, nlta = 5, 10
     c1 = recSTALTA(self.data, nsta, nlta)
     self.assertAlmostEqual(c1[99], 0.80810165)
     self.assertAlmostEqual(c1[100], 0.75939449)
     self.assertAlmostEqual(c1[101], 0.91763978)
     self.assertAlmostEqual(c1[102], 0.97465004)
Exemplo n.º 3
0
 def test_recSTALTAC(self):
     """
     Test case for ctypes version of recSTALTA
     """
     nsta, nlta = 5, 10
     c1 = recSTALTA(self.data, nsta, nlta)
     self.assertAlmostEqual(c1[99], 0.80810165)
     self.assertAlmostEqual(c1[100], 0.75939449)
     self.assertAlmostEqual(c1[101], 0.91763978)
     self.assertAlmostEqual(c1[102], 0.97465004)