Example #1
0
 def test_unpackSteim2(self):
     """
     Test decompression of Steim2 strings. Remove 128 Bytes of header
     by hand, see SEEDManual_V2.4.pdf page 100.
     """
     steim2_file = os.path.join(self.path, 'data', 'steim2.mseed')
     # 128 Bytes header.
     data_string = open(steim2_file, 'rb').read()[128:]
     data = util._unpackSteim2(data_string, 5980, swapflag=self.swap,
                                verbose=0)
     data_record = readMSEED(steim2_file)[0].data
     np.testing.assert_array_equal(data, data_record)
 def test_brokenLastRecord(self):
     """
     Test if Libmseed is able to read files with broken last record. Use
     both methods, readMSTracesViaRecords and readMSTraces
     """
     file = os.path.join(self.path, "data", "brokenlastrecord.mseed")
     # independent reading of the data
     data_string = open(file, 'rb').read()[128:]  # 128 Bytes header
     data = util._unpackSteim2(data_string, 5980, swapflag=self.swap,
                               verbose=0)
     # test readMSTraces
     data_record = readMSEED(file)[0].data
     np.testing.assert_array_equal(data, data_record)
Example #3
0
 def test_unpackSteim2(self):
     """
     Test decompression of Steim2 strings. Remove 128 Bytes of header
     by hand, see SEEDManual_V2.4.pdf page 100.
     """
     steim2_file = os.path.join(self.path, 'data', 'steim2.mseed')
     # 128 Bytes header.
     data_string = open(steim2_file, 'rb').read()[128:]
     data = util._unpackSteim2(data_string,
                               5980,
                               swapflag=self.swap,
                               verbose=0)
     data_record = readMSEED(steim2_file)[0].data
     np.testing.assert_array_equal(data, data_record)
Example #4
0
 def test_brokenLastRecord(self):
     """
     Test if Libmseed is able to read files with broken last record. Use
     both methods, readMSTracesViaRecords and readMSTraces
     """
     file = os.path.join(self.path, "data", "brokenlastrecord.mseed")
     # independent reading of the data
     data_string = open(file, 'rb').read()[128:]  # 128 Bytes header
     data = util._unpackSteim2(data_string,
                               5980,
                               swapflag=self.swap,
                               verbose=0)
     # test readMSTraces
     data_record = readMSEED(file)[0].data
     np.testing.assert_array_equal(data, data_record)