Exemple #1
0
 def merge_catalogs_delete_pick(self, qml_to_merge_basic):
     """ Delete a pick and amplitude from the new cat, merge with old."""
     cat1, cat2 = extract_merge_catalogs(qml_to_merge_basic)
     cat2[0].picks.pop(0)
     cat2[0].amplitudes.pop(0)
     merge_events(cat1[0], cat2[0])
     return cat1, cat2
 def merge_catalogs_add_bad_amplitude(self, qml_to_merge_basic):
     """ add an amplitude that has no pick reference. It should not get
      merged into the events """
     cat1, cat2 = extract_merge_catalogs(qml_to_merge_basic)
     # add new amplitude
     amp = obspy.core.event.Amplitude()
     cat2[0].amplitudes.append(amp)
     merge_events(cat1[0], cat2[0])
     return cat1, cat2
 def merge_catalogs_add_pick(self, qml_to_merge_basic):
     """ add a pick and amplitude to the new cat_name, merge with old """
     cat1, cat2 = extract_merge_catalogs(qml_to_merge_basic)
     # add new pick
     pick1 = cat2[0].picks[0]
     time = obspy.UTCDateTime.now()
     new_pick = obspy.core.event.Pick(time,
                                      waveform_id=pick1.waveform_id,
                                      phase_hint="S")
     cat2[0].picks.append(new_pick)
     # add new amplitude
     amp = obspy.core.event.Amplitude(pick_id=new_pick.resource_id)
     cat2[0].amplitudes.append(amp)
     merge_events(cat1[0], cat2[0])
     return cat1, cat2
Exemple #4
0
 def merge_catalogs_delete_pick(self, qml_to_merge_basic):
     """ Delete a pick and amplitude from the new cat, merge with old."""
     cat1, cat2 = extract_merge_catalogs(qml_to_merge_basic)
     # Get rid of the first arrival and its associated pick
     arrivals = cat2[0].preferred_origin().arrivals
     pick_id = arrivals[0].pick_id
     assert not pick_id.get_referred_object(
     ).evaluation_status == "rejected"
     cat2[0].picks = [
         x for x in cat2[0].picks if not x.resource_id == pick_id
     ]
     arrivals.pop(0)
     # Get rid of the first amplitude
     cat2[0].amplitudes.pop(0)
     validate_catalog(cat1)
     validate_catalog(cat2)
     merge_events(cat1[0], cat2[0])
     return cat1, cat2
 def merged_catalogs(self, two_catalogs):
     cat1, cat2 = two_catalogs
     merge_events(cat1[0], cat2[0])
     return cat1, cat2
Exemple #6
0
 def merged_catalogs(self, two_catalogs):
     """Merge two catalogs together."""
     cat1, cat2 = two_catalogs
     merge_events(cat1[0], cat2[0])
     return cat1, cat2