Skip to content

Commit a24cbcb

Browse files
committed
Error message if a catalog has less than 2 events
1 parent 15c7371 commit a24cbcb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

requake/scan/scan_catalog.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ def scan_catalog():
113113
logger.error(msg)
114114
rq_exit(1)
115115
nevents = len(catalog)
116+
if nevents < 2:
117+
logger.error(
118+
'Not enough events in catalog. '
119+
'You need at least 2 events to run the scan 😉')
120+
rq_exit(1)
116121
logger.info(f'{nevents} events read from catalog file')
117122
logger.info('Building event pairs...')
118123
logger.info('Computing waveform cross-correlation...')

0 commit comments

Comments
 (0)