Пример #1
0
def find_exact_coinc_matches(coincs, sim, comparefunc, seglists, offsetvector):
	"""
	Return a set of the coinc_event_ids of the burst<-->burst coincs in
	which all burst events match sim and to which all instruments on at
	the time of the sim contributed events.
	"""
	# note:  this doesn't check that the coinc and the sim share
	# compatible offset vectors, it is assumed this condition was
	# applied in the .coincs_near_peaktime() method that was used to
	# assemble the list of candidate coincs

	# comparefunc() returns False --> event matches sim
	# any() --> at least one compare returns True == not all events match
	# not any() --> all events match sim
	on_instruments = SimBurstUtils.on_instruments(sim, seglists, offsetvector)
	return set(coinc_event_id for coinc_event_id, events in coincs if on_instruments.issubset(set(event.ifo for event in events)) and not any(comparefunc(sim, event, offsetvector) for event in events))
Пример #2
0
def find_exact_coinc_matches(coincs, sim, comparefunc, seglists, offsetvector):
    """
	Return a set of the coinc_event_ids of the burst<-->burst coincs in
	which all burst events match sim and to which all instruments on at
	the time of the sim contributed events.
	"""
    # note:  this doesn't check that the coinc and the sim share
    # compatible offset vectors, it is assumed this condition was
    # applied in the .coincs_near_peaktime() method that was used to
    # assemble the list of candidate coincs

    # comparefunc() returns False --> event matches sim
    # any() --> at least one compare returns True == not all events match
    # not any() --> all events match sim
    on_instruments = SimBurstUtils.on_instruments(sim, seglists, offsetvector)
    return set(
        coinc_event_id for coinc_event_id, events in coincs
        if on_instruments.issubset(set(event.ifo for event in events))
        and not any(comparefunc(sim, event, offsetvector) for event in events))