Commit 292c401c authored by Kipp Cannon's avatar Kipp Cannon

Merge branch 'snglcoincwork' into 'master'

Snglcoincwork

See merge request lscsoft/lalsuite!508
parents 39f98438 c0b81521
Pipeline #35029 passed with stages
in 27 minutes and 10 seconds
......@@ -47,7 +47,11 @@ import random
import scipy.optimize
from scipy import spatial
import sys
import UserDict
try:
from UserDict import DictMixin as UserDict
except ImportError:
# python 3
from collections import UserDict
import warnings
......@@ -230,7 +234,7 @@ class singlesqueue(object):
return tuple(events), tuple(itertools.takewhile(lambda event: self.event_time(event) < t, self.queue))
class multidict(object, UserDict.DictMixin):
class multidict(object, UserDict):
"""
Read-only dictionary view into a collection of dictionaries.
......@@ -500,6 +504,9 @@ class TimeSlideGraphNode(object):
# time_slide_id non-None only in head nodes
self.time_slide_id = time_slide_id
self.offset_vector = offset_vector
# not used here, but helpful to calling codes to avoid
# repeating this test inside loops
self.is_zero_lag = not any(offset_vector.values())
# keep_partial is part of the logic that ensures we only
# return coincs that meet the min_instruments criterion
self.keep_partial = len(offset_vector) > min_instruments
......@@ -807,7 +814,7 @@ class TimeSlideGraph(object):
node.push(instrument, events, t_complete)
def pull(self, threshold_data, newly_used = None, flushed = None, flush = False, verbose = False):
def pull(self, threshold_data, newly_used = None, flushed = None, flushed_unused = None, flush = False, verbose = False):
# FIXME: note that we call each time slide's head node
# with a different t, which means we cannot compare the
# reported unused flushed events from one with another.
......@@ -840,22 +847,24 @@ class TimeSlideGraph(object):
yield node, tuple(index[event_id] for event_id in coinc)
newly_used_ids -= self.used
self.used |= newly_used_ids
flushed_unused_ids = flushed_ids - self.used
self.used -= flushed_ids
# if we've been flushed then there can't be any events left
# in the queues
assert not flush or not self.used
# use the index to populate newly_used and flushed with event objects
# use the index to populate newly_used, flushed, and
# flushed_unused with event objects
if newly_used is not None:
newly_used[:] = (index[event_id] for event_id in newly_used_ids)
# FIXME: this is broken unless only one time slide is
# being considered. See above. this is OK for the
# inspiral online search and also for any offline
# application (which do not make use of this information),
# but will have to be fixed if an online analysis wishes to
# consider more than one offset vector.
# FIXME: these next two are broken unless only one time
# slide is being considered. See above. this is OK for
# the inspiral online search which only does a zero-lag
# analysis, but will have to be fixed for offline analyses
if flushed is not None:
flushed[:] = (index[event_id] for event_id in flushed_ids)
if flushed_unused is not None:
flushed_unused[:] = (index[event_id] for event_id in flushed_unused_ids)
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment