Skip to content
Snippets Groups Projects
Commit 80187545 authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB
Browse files

Kludge for handling nan SNRs

parent ef7c28ac
No related branches found
No related tags found
No related merge requests found
from math import isnan
import numbers
import os import os
from .models import EventLog from .models import EventLog
...@@ -97,7 +98,15 @@ def handle_uploaded_data(event, datafilename, ...@@ -97,7 +98,15 @@ def handle_uploaded_data(event, datafilename,
mchirp = coinc_table.mchirp mchirp = coinc_table.mchirp
mass = coinc_table.mass mass = coinc_table.mass
end_time = (coinc_table.end_time, coinc_table.end_time_ns) end_time = (coinc_table.end_time, coinc_table.end_time_ns)
snr = coinc_table.snr
# Awful kludge for handling nan for snr
snr = coinc_table.snr
try:
if (isinstance(snr, numbers.Number) and isnan(snr)):
snr = None
except Exception as e:
pass
ifos = coinc_table.ifos ifos = coinc_table.ifos
far = coinc_table.combined_far far = coinc_table.combined_far
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment