From 82e6b3b1316a6988cfd01e985ca92d39bd4eb00f Mon Sep 17 00:00:00 2001
From: Kipp Cannon <kipp.cannon@ligo.org>
Date: Wed, 18 Jul 2018 11:07:51 -0700
Subject: [PATCH] inspiral.py:  set effective distances to NaN

---
 gstlal-inspiral/python/inspiral.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/gstlal-inspiral/python/inspiral.py b/gstlal-inspiral/python/inspiral.py
index 8f0bc210b5..f304606ba6 100644
--- a/gstlal-inspiral/python/inspiral.py
+++ b/gstlal-inspiral/python/inspiral.py
@@ -52,6 +52,12 @@
 
 import bisect
 from collections import deque
+try:
+	from fpconst import NaN
+except ImportError:
+	# fpconst is not part of the standard library and might not be
+	# available
+	NaN = float("nan")
 import itertools
 import math
 import numpy
@@ -671,6 +677,17 @@ class Data(object):
 			# triggers, make sure that worked
 			assert all(event.end in buf_seg for event in events)
 
+			# set all effective distances to NaN.
+			# gstlal_inspiral's effective distances are
+			# incorrect, and the PE codes require us to either
+			# provide correct effective distances or
+			# communicate to them that they are incorrect.
+			# they have explained that setting them to NaN is
+			# sufficient for the latter.
+			# FIXME:  fix the effective distances
+			for event in events:
+				event.eff_dist = NaN
+
 			# Find max SNR sngles
 			if events:
 				max_snr_event = max(events, key = lambda t: t.snr)
-- 
GitLab