Skip to content

Commit

Permalink
Set pick phase hint based on event picks phase hints
Browse files Browse the repository at this point in the history
  • Loading branch information
calum-chamberlain committed Nov 12, 2024
1 parent 571e54f commit 0f68779
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions eqcorrscan/core/lag_calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,16 @@ def xcorr_pick_family(family, stream, shift_len=0.2, min_cc=0.4,
# Get a set of picked trace ids, then iterate through that - take
# earliest pick - matches earliest trace used by
# detection.extract_stream
picked_sids = {p.waveform_id.get_seed_string()}
picked_sids = {p.waveform_id.get_seed_string()
for p in family.template.event.picks}
for sid in picked_sids:
_sid_picks = [p for p in family.template.event.picks
if p.waveform_id.get_seed_string() == sid]
_sid_picks.sort(key=lambda p: p.time)
if len(_sid_picks) > 1:
Logger.warning(f"Multiple phase hints found for {sid} - "
f"using earliest ({_sid_picks[0].phase_hint} "
f"at {_sid_picks[0].time}")
f"at {_sid_picks[0].time})")
phase_hints.update({sid: _sid_picks[0].phase_hint})

for i, detection_id in enumerate(detection_ids):
Expand Down

0 comments on commit 0f68779

Please sign in to comment.