Example #1
0
 def test_readAndWriteMultiChannelASCFile(self):
     """
     Read and write ASC file via obspy.sh.core.readASC.
     """
     origfile = os.path.join(self.path, 'data', 'QFILE-TEST-ASC.ASC')
     # read original
     stream1 = readASC(origfile)
     stream1.verify()
     self._compareStream(stream1)
     # write
     tempfile = NamedTemporaryFile().name
     writeASC(stream1, tempfile, STANDARD_ASC_HEADERS + ['COMMENT'])
     # read both files and compare the content
     text1 = open(origfile, 'rb').read()
     text2 = open(tempfile, 'rb').read()
     self.assertEquals(text1, text2)
     # read again
     stream2 = readASC(tempfile)
     stream2.verify()
     self._compareStream(stream2)
     os.remove(tempfile)
Example #2
0
 def test_readAndWriteMultiChannelASCFile(self):
     """
     Read and write ASC file via obspy.sh.core.readASC.
     """
     origfile = os.path.join(self.path, 'data', 'QFILE-TEST-ASC.ASC')
     # read original
     stream1 = readASC(origfile)
     stream1.verify()
     self._compareStream(stream1)
     # write
     tempfile = NamedTemporaryFile().name
     writeASC(stream1, tempfile, STANDARD_ASC_HEADERS + ['COMMENT'])
     # read both files and compare the content
     text1 = open(origfile, 'rb').read()
     text2 = open(tempfile, 'rb').read()
     self.assertEquals(text1, text2)
     # read again
     stream2 = readASC(tempfile)
     stream2.verify()
     self._compareStream(stream2)
     os.remove(tempfile)