def CWBSnglCompare(sim, burst, offsetvector, delta_t = 10.0): """ Return False (injection matches event) if the time of the sim and the peak time of the burst event differ by less than or equal to delta_t seconds. """ return abs(float(SimBurstUtils.time_at_instrument(sim, burst.ifo, offsetvector) - burst.get_peak())) > delta_t
def ExcessPowerNearCoincCompare(sim, burst, offsetvector): """ Return False (injection matches coinc) if the peak time of the sim is "near" the burst event. """ tinj = SimBurstUtils.time_at_instrument(sim, burst.ifo, offsetvector) window = SimBurstUtils.burst_is_near_injection_window return segments.segment(tinj - window, tinj + window).disjoint(burst.get_period())
def StringCuspNearCoincCompare(sim, burst, offsetvector): """ Return False (injection matches coinc) if the peak time of the sim is "near" the burst event. """ tinj = SimBurstUtils.time_at_instrument(sim, burst.ifo, offsetvector) window = SimBurstUtils.stringcusp_autocorrelation_width / 2 + SimBurstUtils.burst_is_near_injection_window return segments.segment(tinj - window, tinj + window).disjoint(burst.period)
def StringCuspSnglCompare(sim, burst, offsetvector): """ Return False (injection matches event) if an autocorrelation-width window centred on the injection is continuous with the time interval of the burst. """ tinj = SimBurstUtils.time_at_instrument(sim, burst.ifo, offsetvector) window = SimBurstUtils.stringcusp_autocorrelation_width / 2 # uncomment last part of expression to impose an amplitude cut return segments.segment(tinj - window, tinj + window).disjoint(burst.get_period()) #or abs(sim.amplitude / SimBurstUtils.string_amplitude_in_instrument(sim, burst.ifo, offsetvector)) > 3
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))
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))
def ExcessPowerSnglCompare(sim, burst, offsetvector): """ Return False (injection matches event) if the peak time and centre frequency of sim lie within the time-frequency tile of burst. """ return (SimBurstUtils.time_at_instrument(sim, burst.ifo, offsetvector) not in burst.get_period()) or (sim.frequency not in burst.get_band())