Skip to content

Commit

Permalink
Only add if there are detections
Browse files Browse the repository at this point in the history
  • Loading branch information
calum-chamberlain committed Dec 14, 2023
1 parent 0475237 commit 538ec99
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rt_eqcorrscan/reactor/backfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def backfill(
# st_chunk = read(st_filename, starttime=_starttime, endtime=_endtime).merge()
Logger.info(f"Read in {st_chunk}")
try:
new_party += new_tribe.detect(
_party = new_tribe.detect(
stream=st_chunk, plot=False, threshold=threshold,
threshold_type=threshold_type, trig_int=trig_int,
xcorr_func="numpy",
Expand All @@ -125,7 +125,9 @@ def backfill(
ignore_bad_data=True,
overlap=None,
**kwargs)
Logger.info(f"Backfiller made {len(new_party)} detections between {_starttime} and {_endtime}")
Logger.info(f"Backfiller made {len(_party)} detections between {_starttime} and {_endtime}")
if len(_party):
new_party += _party
except Exception as e:
Logger.critical(f"Uncaught error: {e}")
Logger.error(traceback.format_exc())
Expand Down

0 comments on commit 538ec99

Please sign in to comment.