added logging for multiple matches instead of crashing
This commit is contained in:
parent
0f86d58b20
commit
707cc6bd08
|
@ -126,6 +126,7 @@ for detection in detections.itertuples():
|
|||
)
|
||||
matches = injections.query(qstring)
|
||||
if len(matches) > 0:
|
||||
try:
|
||||
logger.debug(f"Detection: DM {detection.dm} and PW {detection.pulseWidth}")
|
||||
logger.debug(matches)
|
||||
if len(matches) == 1:
|
||||
|
@ -134,6 +135,8 @@ for detection in detections.itertuples():
|
|||
logger.debug("======")
|
||||
elif len(matches) > 1:
|
||||
raise ValueError("MULTIPLE MATCHES OHNO")
|
||||
except ValueError:
|
||||
logger.warn(f"Multiple matches found in file {detection.file}")
|
||||
else: #no matching injection...
|
||||
falsePositiveMask[detection.Index] = True
|
||||
logger.debug(f"NO MATCH FOR: DM {detection.dm} and PW {detection.pulseWidth}")
|
||||
|
|
Loading…
Reference in a new issue