def test_linked_amplitudes_picks(self, event_linked_amplitudes): """ Make sure any amplitudes (rejected or otherwise) that are linked to a rejected pick get tossed """ out = strip_events(event_linked_amplitudes) assert len(out.amplitudes) == 0
def test_no_magnitudes(self, event_magnitudes): """ Make sure there are no magnitudes attached to the event and that the preferred magnitude doesn't refer to anything """ out = strip_events(event_magnitudes) assert len(out.magnitudes) == 0 assert out.preferred_magnitude() is None
def test_no_focal_mechanisms(self, event_focal_mech): """ Make sure there are no focal mechanisms attached to the event and that the preferred focal mechanism doesn't refer to anything """ out = strip_events(event_focal_mech) assert len(out.focal_mechanisms) == 0 assert out.preferred_focal_mechanism() is None
def test_no_origins(self, event_origins): """ Make sure there are no origins attached to the event and that the preferred origin doesn't refer to anything """ out = strip_events(event_origins) assert len(out.origins) == 0 assert out.preferred_origin() is None
def test_acceptable_eval_statuses(self, cat_picks): """ Make sure only picks with acceptable evaluation statuses get through (not rejected or preliminary) """ out = strip_events(cat_picks) assert len(out[0].picks) == 1 assert len(out[1].picks) == 3
def test_custom_acceptable_eval_statuses(self, cat_picks): """ Make sure the user can specify the evaluation status of stuff to reject """ out = strip_events( cat_picks, reject_evaluation_status=["preliminary", "confirmed", "rejected"]) assert len(out[0].picks) == 1 assert len(out[1].picks) == 1
def test_no_station_magnitudes(self, event_station_mags): """ Make sure there are no station magnitudes attached to the event """ out = strip_events(event_station_mags) assert len(out.station_magnitudes) == 0
def test_only_first_event_description(self, event_description): """Make sure only the first event description survives""" text = event_description.event_descriptions[0].text out = strip_events(event_description) assert len(out.event_descriptions) == 1 assert out.event_descriptions[0].text == text
def test_only_reviewed_amplitudes(self, event_amplitudes): """Make sure only non-rejected amplitudes make it through""" out = strip_events(event_amplitudes) assert len(out.amplitudes) == 1
def test_copy_made(self): """Prune events should make a copy, not modify the original.""" cat = obspy.read_events() assert strip_events(cat) is not cat
def test_empty_events(self, cat_w_two_events): """Make sure empty events can pass through""" out = strip_events(cat_w_two_events) assert len(out) == 2
def test_empty(self, empty_cat): """Make sure an empty catalog can pass through""" strip_events(empty_cat)