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¶
- 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
- a
- Returns
- coincs
numpy.ndarray
the indices of array
a
that were coincident with an entry inb
- significance
float
the Poisson significance of the number of coincidences found as compared to the number expected by random chance
- coincs
- 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
offloat
the SNR thresholds to use
- window
list
offloat
the time windows to use
- primary
- 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
- a
- Returns
- coinc
numpy.ndarray
the indices of all items in
a
within [-dt/2., +dt/2.) of an item inb
- coinc
- 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
offloat
the SNR thresholds to use
- window
list
offloat
the time windows to use
- primary
- Returns
- winner
HvetoWinner
the parameters and segments generated by the (snr, dt) with the highest significance
- winner
- hveto.core.significance(n, mu)[source]¶
Calculate the significance of
n
coincidences, whenmu
were expected
- hveto.core.veto(table, segmentlist)[source]¶
Remove events from a table based on a segmentlist
A time
t
will be vetoed ifstart <= 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
- table
- Returns
- keep
numpy.recarray
the reduced table of events that were not coincident with any segments
- keep
- hveto.core.veto_all(auxiliary, segmentlist)[source]¶
Remove events from all auxiliary channel tables based on a segmentlist
- Parameters
- auxiliary
dict
ofnumpy.recarray
a
dict
of event arrays to veto- segmentlist
segmentlist
the list of veto segments to use
- auxiliary
- Returns
- survivors
dict
ofnumpy.recarray
a dict of the reduced arrays of events for each input channel
- survivors
See also
core.veto
for details on the veto algorithm itself