hveto.core module

Core of the HierarchichalVeto algorithm

class hveto.core.HvetoRound(round, primary, segments=None, vetoes=None, plots=[], files={}, rank=None)[source]

Bases: object

Attributes
cum_deadtime
cum_efficiency
deadtime
efficiency
files
livetime
n
plots
primary
rank
scans
segments
use_percentage
vetoes
winner
cum_deadtime
cum_efficiency
property deadtime
efficiency
files
property livetime
n
plots
primary
rank
scans
segments
use_percentage
vetoes
winner
class hveto.core.HvetoWinner(name=None, significance=None, snr=None, window=None, segments=None, events=None, ncoinc=0, mu=None)[source]

Bases: object

Attributes
events
mu
name
ncoinc
segments
significance
snr
window

Methods

get_segments

events
get_segments(times)[source]
mu
name
ncoinc
segments
significance
snr
window
hveto.core.coinc_significance(a, b, dt, livetime)[source]

Calculate the significance of coincidences between two time arrays

Parameters

a : numpy.ndarray

first array

b : numpy.ndarray

second array

dt : float

coincidence window

livetime : float

the livetime of the analysis

Returns

coincs : numpy.ndarray

the indices of array a that were coincident with an entry in b

significance : float

the Poisson significance of the number of coincidences found as compared to the number expected by random chance

hveto.core.find_all_coincidences(triggers, channel, snrs, windows)[source]

Find the number of coincs between each auxiliary channel and the primary

Parameters

primary : numpy.ndarray

an array of times for the primary channel

auxiliary : numpy.recarray

an array of triggers for a set of auxiliary channels

snrs : list of float

the SNR thresholds to use

window : list of float

the time windows to use

hveto.core.find_coincidences(a, b, dt=1)[source]

Find the coincidences between values in two numpy arrays

Parameters

a : numpy.ndarray

first array

b : numpy.ndarray

second array

dt : float, optional

coincidence window

Returns

coinc : numpy.ndarray

the indices of all items in a within [-dt/2., +dt/2.) of an item in b

hveto.core.find_max_significance(primary, auxiliary, channel, snrs, windows, livetime)[source]

Find the maximum Hveto significance for this primary-auxiliary pair

Parameters

primary : numpy.recarray

record array of data from the primary channel

auxiliary : numpy.recarray

record array from the auxiliary channel

snrs : list of float

the SNR thresholds to use

window : list of float

the time windows to use

Returns

winner : HvetoWinner

the parameters and segments generated by the (snr, dt) with the highest significance

hveto.core.significance(n, mu)[source]

Calculate the significance of n coincidences, when mu were expected

Parameters

n : int

the number of coincidences found

mu : float

the number of coincidences expected from a Poisson process

hveto.core.veto(table, segmentlist)[source]

Remove events from a table based on a segmentlist

A time t will be vetoed if start <= t <= end for any veto segment in the list.

Parameters

table : numpy.recarray

the table of event triggers to veto

segmentlist : segmentlist

the list of veto segments to use

Returns

keep : numpy.recarray

the reduced table of events that were not coincident with any segments

hveto.core.veto_all(auxiliary, segmentlist)[source]

Remove events from all auxiliary channel tables based on a segmentlist

Parameters

auxiliary : dict of numpy.recarray

a dict of event arrays to veto

segmentlist : segmentlist

the list of veto segments to use

Returns

survivors : dict of numpy.recarray

a dict of the reduced arrays of events for each input channel

See also

core.veto

for details on the veto algorithm itself