Exemple #1
0
 def getMSRecord(self):
     # following from  obspy.mseed.tests.test_libmseed.py -> test_msrParse
     msr = clibmseed.msr_init(C.POINTER(MSRecord)())
     pyobj = frombuffer(self.msrecord, dtype=np.uint8)
     errcode = clibmseed.msr_parse(pyobj.ctypes.data_as(C.POINTER(C.c_char)), len(pyobj), C.pointer(msr), -1, 1, 1)
     if errcode != 0:
         msg = "failed to decode mini-seed record: msr_parse errcode: %s"
         raise SeedLinkException(msg % (errcode))
     # print "DEBUG: msr:", msr
     msrecord_py = msr.contents
     # print "DEBUG: msrecord_py:", msrecord_py
     return msrecord_py
Exemple #2
0
 def getMSRecord(self):
     # following from  obspy.mseed.tests.test_libmseed.py -> test_msrParse
     msr = clibmseed.msr_init(C.POINTER(MSRecord)())
     pyobj = np.array(self.msrecord)
     errcode = \
             clibmseed.msr_parse(pyobj.ctypes.data_as(C.POINTER(C.c_char)),
             len(pyobj), C.pointer(msr), -1, 1, 1)
     if errcode != 0:
         msg = "failed to decode mini-seed record: msr_parse errcode: %s"
         raise SeedLinkException(msg % (errcode))
     #print "DEBUG: msr:", msr
     msrecord_py = msr.contents
     #print "DEBUG: msrecord_py:", msrecord_py
     return msrecord_py