예제 #1
0
 def getStart(self):
     """
     Return starttime
     """
     self.read(-1, 0, 1, 0)
     dtime = clibmseed.msr_starttime(self.msr)
     return UTCDateTime(dtime / HPTMODULUS)
예제 #2
0
파일: msstruct.py 프로젝트: gthompson/obspy
 def getStart(self):
     """
     Return starttime
     """
     self.read(-1, 0, 1, 0)
     dtime = clibmseed.msr_starttime(self.msr)
     return UTCDateTime(dtime / HPTMODULUS)
    def test_readSingleRecordToMSR(self):
        """
        Tests readSingleRecordtoMSR against start and endtimes.

        Reference start and endtimes are obtained from the tracegroup.
        Both cases, with and without ms_p argument are tested.
        """
        filename = os.path.join(self.path, 'data',
                                'BW.BGLD.__.EHE.D.2008.001.first_10_records')
        start, end = [1199145599915000L, 1199145620510000L]
        # start and endtime
        ms = _MSStruct(filename, init_msrmsf=False)
        ms.read(-1, 0, 1, 0)
        self.assertEqual(start, clibmseed.msr_starttime(ms.msr))
        ms.offset = ms.filePosFromRecNum(-1)
        ms.read(-1, 0, 1, 0)
        self.assertEqual(end, clibmseed.msr_endtime(ms.msr))
        del ms  # for valgrind