def test_inaccurate_picks(self): testing_path = os.path.join(self.testing_path, 'bad_picks.sfile') # raises "UserWarning: AIN in header, currently unsupported" with warnings.catch_warnings(): warnings.simplefilter('ignore', UserWarning) cat = read_nordic(testing_path) pick_string = nordpick(cat[0]) for pick in pick_string: self.assertEqual(len(pick), 80)
def test_round_len(self): testing_path = os.path.join(self.testing_path, 'round_len_undef.sfile') # raises "UserWarning: AIN in header, currently unsupported" with warnings.catch_warnings(): warnings.simplefilter('ignore', UserWarning) event = read_nordic(testing_path)[0] pick_string = nordpick(event) for pick in pick_string: self.assertEqual(len(pick), 80)
def test_distance_conversion(self): """ Check that distances are converted properly. """ testing_path = os.path.join(self.testing_path, '01-0411-15L.S201309') cat = read_events(testing_path) event = cat[0] self.assertAlmostEqual( sorted(event.origins[0].arrivals, key=lambda x: x.distance)[0].distance, 0.035972864236749225) pick_strings = nordpick(event) self.assertEqual( int([p for p in pick_strings if p.split()[0] == 'GCSZ' and p.split()[1] == 'SZ'][0].split()[-1]), 304) self.assertEqual( int([p for p in pick_strings if p.split()[0] == 'WZ11' and p.split()[1] == 'HZ'][0].split()[-1]), 30)
def test_distance_conversion(self): """ Check that distances are converted properly. """ testing_path = os.path.join(self.testing_path, '01-0411-15L.S201309') # raises "UserWarning: AIN in header, currently unsupported" with warnings.catch_warnings(): warnings.simplefilter('ignore', UserWarning) cat = read_events(testing_path) event = cat[0] self.assertAlmostEqual( sorted(event.origins[0].arrivals, key=lambda x: x.distance)[0].distance, 0.035972864236749225) pick_strings = nordpick(event) self.assertEqual( int([p for p in pick_strings if p.split()[0] == 'GCSZ' and p.split()[1] == 'SZ'][0].split()[-1]), 304) self.assertEqual( int([p for p in pick_strings if p.split()[0] == 'WZ11' and p.split()[1] == 'HZ'][0].split()[-1]), 30)
def test_distance_conversion(self): """ Check that distances are converted properly. """ testing_path = os.path.join(self.testing_path, '01-0411-15L.S201309') cat = read_events(testing_path) event = cat[0] self.assertAlmostEqual( sorted(event.origins[0].arrivals, key=lambda x: x.distance)[0].distance, 0.035972864236749225) pick_strings = nordpick(event) self.assertEqual( int([ p for p in pick_strings if p.split()[0] == 'GCSZ' and p.split()[1] == 'SZ' ][0].split()[-1]), 304) self.assertEqual( int([ p for p in pick_strings if p.split()[0] == 'WZ11' and p.split()[1] == 'HZ' ][0].split()[-1]), 30)
def test_round_len(self): testing_path = os.path.join(self.testing_path, 'round_len_undef.sfile') event = read_nordic(testing_path)[0] pick_string = nordpick(event) for pick in pick_string: self.assertEqual(len(pick), 80)
def test_inaccurate_picks(self): testing_path = os.path.join(self.testing_path, 'bad_picks.sfile') cat = read_nordic(testing_path) pick_string = nordpick(cat[0]) for pick in pick_string: self.assertEqual(len(pick), 80)