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
anumpy.ndarray

first array

bnumpy.ndarray

second array

dtfloat

coincidence window

livetimefloat

the livetime of the analysis

Returns
coincsnumpy.ndarray

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

significancefloat

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
primarynumpy.ndarray

an array of times for the primary channel

auxiliarynumpy.recarray

an array of triggers for a set of auxiliary channels

snrslist of float

the SNR thresholds to use

windowlist 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
anumpy.ndarray

first array

bnumpy.ndarray

second array

dtfloat, optional

coincidence window

Returns
coincnumpy.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
primarynumpy.recarray

record array of data from the primary channel

auxiliarynumpy.recarray

record array from the auxiliary channel

snrslist of float

the SNR thresholds to use

windowlist of float

the time windows to use

Returns
winnerHvetoWinner

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
nint

the number of coincidences found

mufloat

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
tablenumpy.recarray

the table of event triggers to veto

segmentlistsegmentlist

the list of veto segments to use

Returns
keepnumpy.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
auxiliarydict of numpy.recarray

a dict of event arrays to veto

segmentlistsegmentlist

the list of veto segments to use

Returns
survivorsdict 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