예제 #1
0
 def test_ignore_non_ascii_tag_station_info(self):
     """
     Test faulty Y file containing non ASCII chars in TAG_STATION_INFO.
     """
     testfile = os.path.join(self.path, 'data', 'YAZRSPE.20100119.060433')
     st = _read_y(testfile)
     self.assertEqual(len(st), 1)
     tr = st[0]
     self.assertEqual(len(tr), 16976)
     self.assertEqual(tr.stats.sampling_rate, 50.0)
     self.assertEqual(tr.stats.station, 'AZR')
     self.assertEqual(tr.stats.channel, 'E')
     self.assertEqual(tr.stats.location, 'SP')
     self.assertEqual(tr.stats.network, '')
예제 #2
0
파일: test_core.py 프로젝트: znamy/obspy
 def test_ignore_non_ascii_tag_station_info(self):
     """
     Test faulty Y file containing non ASCII chars in TAG_STATION_INFO.
     """
     testfile = os.path.join(self.path, 'data', 'YAZRSPE.20100119.060433')
     with warnings.catch_warnings(record=True) as w:
         warnings.simplefilter('always')
         st = _read_y(testfile)
     self.assertEqual(len(w), 1)
     self.assertIn('Invalid', str(w[0]))
     self.assertEqual(len(st), 1)
     tr = st[0]
     self.assertEqual(len(tr), 16976)
     self.assertEqual(tr.stats.sampling_rate, 50.0)
     self.assertEqual(tr.stats.station, 'AZR')
     self.assertEqual(tr.stats.channel, 'E')
     self.assertEqual(tr.stats.location, 'SP')
     self.assertEqual(tr.stats.network, '')
예제 #3
0
파일: test_core.py 프로젝트: znamy/obspy
 def test_read_y_file(self):
     """
     Testing reading Y file format.
     """
     testfile = os.path.join(self.path, 'data', 'YAYT_BHZ_20021223.124800')
     st = _read_y(testfile)
     self.assertEqual(len(st), 1)
     tr = st[0]
     self.assertEqual(len(tr), 18000)
     self.assertEqual(tr.stats.sampling_rate, 100.0)
     self.assertEqual(tr.stats.station, 'AYT')
     self.assertEqual(tr.stats.channel, 'BHZ')
     self.assertEqual(tr.stats.location, '')
     self.assertEqual(tr.stats.network, '')
     self.assertEqual(max(tr.data),
                      tr.stats.y.tag_series_info.max_amplitude)
     self.assertEqual(min(tr.data),
                      tr.stats.y.tag_series_info.min_amplitude)
예제 #4
0
 def test_read_y_file(self):
     """
     Testing reading Y file format.
     """
     testfile = os.path.join(self.path, 'data', 'YAYT_BHZ_20021223.124800')
     st = _read_y(testfile)
     self.assertEqual(len(st), 1)
     tr = st[0]
     self.assertEqual(len(tr), 18000)
     self.assertEqual(tr.stats.sampling_rate, 100.0)
     self.assertEqual(tr.stats.station, 'AYT')
     self.assertEqual(tr.stats.channel, 'BHZ')
     self.assertEqual(tr.stats.location, '')
     self.assertEqual(tr.stats.network, '')
     self.assertEqual(max(tr.data),
                      tr.stats.y.tag_series_info.max_amplitude)
     self.assertEqual(min(tr.data),
                      tr.stats.y.tag_series_info.min_amplitude)
예제 #5
0
파일: test_core.py 프로젝트: Brtle/obspy
 def test_ignore_non_ascii_tag_station_info(self):
     """
     Test faulty Y file containing non ASCII chars in TAG_STATION_INFO.
     """
     testfile = os.path.join(self.path, 'data', 'YAZRSPE.20100119.060433')
     with warnings.catch_warnings(record=True) as w:
         warnings.simplefilter('always')
         st = _read_y(testfile)
     self.assertEqual(len(w), 1)
     self.assertIn('Invalid', str(w[0]))
     self.assertEqual(len(st), 1)
     tr = st[0]
     self.assertEqual(len(tr), 16976)
     self.assertEqual(tr.stats.sampling_rate, 50.0)
     self.assertEqual(tr.stats.station, 'AZR')
     self.assertEqual(tr.stats.channel, 'E')
     self.assertEqual(tr.stats.location, 'SP')
     self.assertEqual(tr.stats.network, '')