Skip to content

Commit

Permalink
Adding test case for the SRO format
Browse files Browse the repository at this point in the history
  • Loading branch information
krischer committed Jul 11, 2014
1 parent a14a8b1 commit 38924c6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion obspy/mseed/tests/test_mseed_reading_and_writing.py
Expand Up @@ -1047,11 +1047,23 @@ def test_reading_geoscope_16bit_4bit_exponent_format(self):

self.assertEqual(tr.stats.mseed.encoding, "GEOSCOPE16_4")
self.assertEqual(tr.data.dtype, np.float32)
# Data is from the IRIS ASCII timeseries service.
# Test data is from the IRIS ASCII timeseries service.
np.testing.assert_allclose(
tr.data[:5], np.array([-1.1015625, -1.11328125, -1.109375,
-1.12890625, -1.1171875]))

def test_reading_SRO_format(self):
"""
Tests reading miniseed data with the SRO encoding.
"""
tr = read(os.path.join(self.path, "data",
"SRO_encoding.mseed")).select(component="Z")[0]
self.assertEqual(tr.stats.mseed.encoding, "SRO")
self.assertEqual(tr.data.dtype, np.int32)
# Test data is from the IRIS ASCII timeseries service.
np.testing.assert_allclose(
tr.data[:5], np.array([126, 67, -11, -95, -167]))


def suite():
return unittest.makeSuite(MSEEDReadingAndWritingTestCase, 'test')
Expand Down

0 comments on commit 38924c6

Please sign in to comment.