Skip to content

Commit

Permalink
Merge pull request #564 from eqcorrscan/waveform_id_error
Browse files Browse the repository at this point in the history
Raise useful error when waveform_id is incomplete
  • Loading branch information
calum-chamberlain authored Jun 28, 2024
2 parents d9b3d0b + f4cab41 commit c5daf19
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions eqcorrscan/core/template_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,12 @@ def _download_from_client(client, client_type, catalog, data_pad, process_len,
"Pick not associated with waveforms, will not use:"
" {0}".format(pick))
continue
if pick.waveform_id.channel_code is None:
Logger.error(
f"Missing waveform_id.channel_code for Pick {pick}.")
raise TemplateGenError(
"Ensure that all picks have complete "
"waveform_id attributes")
if all_channels:
channel_code = pick.waveform_id.channel_code[0:2] + "?"
else:
Expand Down

0 comments on commit c5daf19

Please sign in to comment.