Definition at line 1562 of file snglcoinc.py.
Inherits object.
Public Member Functions | |
| def | __init__ (self, instruments, delta_t, min_instruments=2, abundance_rel_accuracy=1e-4) |
| Model for coincidences among noise events collected from several antennas. More... | |
| def | all_instrument_combos (self) |
| A tuple of all possible instrument combinations (as frozensets). More... | |
| def | coinc_rates (self, **rates) |
| Given the event rates for a collection of instruments, compute the rates at which N-way coincidences occur among them where N >= min_instruments. More... | |
| def | strict_coinc_rates (self, **rates) |
| Given the event rates for a collection of instruments, compute the rates at which strict N-way coincidences occur among them where N >= min_instruments. More... | |
| def | marginalized_strict_coinc_counts (self, seglists, **rates) |
| A dictionary mapping instrument combination (as a frozenset) to the total number of coincidences involving precisely that combination of instruments expected from the background. More... | |
| def | lnP_instruments (self, **rates) |
| Given the event rates for a collection of instruments, compute the natural logarithm of the probability that a coincidence is found to involve exactly a given set of instruments. More... | |
| def | random_instruments (self, **rates) |
| Generator that, given the event rates for a collection of instruments, yields a sequence of two-element tuples each containing a randomly-selected frozen set of instruments and the natural logarithm of the ratio of the rate at which that combination of instruments forms coincidences to the rate at which it is being yielded by this generator. More... | |
| def | plausible_toas (self, instruments) |
| Generator that yields dictionaries of random event time-of-arrival offsets for the given instruments such that the time-of-arrivals are mutually coincident given the maximum allowed inter-instrument \Delta t's. More... | |
Data Fields | |
| instruments | |
| delta_t | |
| min_instruments | |
| tau | |
| rate_factors | |
| def lalburst.snglcoinc.CoincRates.__init__ | ( | self, | |
| instruments, | |||
| delta_t, | |||
min_instruments = 2, |
|||
abundance_rel_accuracy = 1e-4 |
|||
| ) |
Model for coincidences among noise events collected from several antennas.
Independent Poisson processes are assumed. The coincidence window for each pair of instruments is (delta_t + light travel time between that pair). A coincidence is assumed to require full N-way coincidence and require at least min_instruments to participate.
Initial configuration requires some relatively expensive pre-calculation of internal quantities, but once initialized coincidence rates can be computed quickly from observed event rates. Several other related quantities can be computed.
Example:
coincrates = CoincRates(("H1", "L1", "V1"), 0.005, 2)
Definition at line 1582 of file snglcoinc.py.
| def lalburst.snglcoinc.CoincRates.all_instrument_combos | ( | self | ) |
A tuple of all possible instrument combinations (as frozensets).
Example:
coincrates = CoincRates(("H1", "L1", "V1"), 0.005, 1) coincrates.all_instrument_combos (frozenset(['V1']), frozenset(['H1']), frozenset(['L1']), frozenset(['V1', 'H1']), frozenset(['V1', 'L1']), frozenset(['H1', 'L1']), frozenset(['V1', 'H1', 'L1'])) coincrates = CoincRates(("H1", "L1", "V1"), 0.005, 2) coincrates.all_instrument_combos (frozenset(['V1', 'H1']), frozenset(['V1', 'L1']), frozenset(['H1', 'L1']), frozenset(['V1', 'H1', 'L1']))
Definition at line 1755 of file snglcoinc.py.
| def lalburst.snglcoinc.CoincRates.coinc_rates | ( | self, | |
| ** | rates | ||
| ) |
Given the event rates for a collection of instruments, compute the rates at which N-way coincidences occur among them where N >= min_instruments.
The return value is a dictionary whose keys are frozensets of instruments and whose values are the rate of coincidences for that set.
NOTE: the computed rates are the rates at which coincidences among at least those instruments occur, not the rate at which coincidences among exactly those instruments occur. e.g., considering the H1, L1, V1 network, for the pair H1, L1 the return value is the sum of the rate at which those two instruments form double coincidences and also the rate at which they participate in H1, L1, V1 triple coincidences.
See also .strict_coinc_rates().
Example:
coincrates = CoincRates(("H1", "L1", "V1"), 0.005, 2) coincrates.coinc_rates(H1 = 0.001, L1 = 0.002, V1 = 0.003) {frozenset(['V1', 'H1']): 1.9372787960306537e-07, frozenset(['V1', 'H1', 'L1']): 1.0125819710267318e-11, frozenset(['H1', 'L1']): 6.00513846088957e-08, frozenset(['V1', 'L1']): 3.77380092200718e-07} coincrates.coinc_rates(H1 = 0.001, L1 = 0.002, V1 = 0.002) {frozenset(['V1', 'H1']): 1.291519197353769e-07, frozenset(['V1', 'H1', 'L1']): 6.750546473511545e-12, frozenset(['H1', 'L1']): 6.00513846088957e-08, frozenset(['V1', 'L1']): 2.5158672813381197e-07} coincrates.coinc_rates(H1 = 0.001, L1 = 0.002, V1 = 0.001) {frozenset(['V1', 'H1']): 6.457595986768845e-08, frozenset(['V1', 'H1', 'L1']): 3.3752732367557724e-12, frozenset(['H1', 'L1']): 6.00513846088957e-08, frozenset(['V1', 'L1']): 1.2579336406690598e-07}
Definition at line 1788 of file snglcoinc.py.
| def lalburst.snglcoinc.CoincRates.strict_coinc_rates | ( | self, | |
| ** | rates | ||
| ) |
Given the event rates for a collection of instruments, compute the rates at which strict N-way coincidences occur among them where N >= min_instruments.
The return value is a dictionary whose keys are frozensets of instruments and whose values are the rate of coincidences for that set.
NOTE: the computed rates are the rates at which coincidences occur among exactly those instrument combinations, excluding the rate at which each combination participates in higher-order coincs. e.g., considering the H1, L1, V1 network, for the pair H1, L1 the return value is the rate at which H1, L1 doubles occur, not including the rate at which the H1, L1 pair participates in H1, L1, V1 triples.
See also .coinc_rates().
Example:
coincrates = CoincRates(("H1", "L1", "V1"), 0.005, 2) coincrates.strict_coinc_rates(H1 = 0.001, L1 = 0.002, V1 = 0.003) {frozenset(['V1', 'H1']): 1.937177537833551e-07, frozenset(['V1', 'H1', 'L1']): 1.0125819710267318e-11, frozenset(['H1', 'L1']): 6.004125878918543e-08, frozenset(['V1', 'L1']): 3.7736996638100773e-07} coincrates.strict_coinc_rates(H1 = 0.001, L1 = 0.002, V1 = 0.002) {frozenset(['V1', 'H1']): 1.2914516918890337e-07, frozenset(['V1', 'H1', 'L1']): 6.750546473511545e-12, frozenset(['H1', 'L1']): 6.004463406242219e-08, frozenset(['V1', 'L1']): 2.5157997758733847e-07} coincrates.strict_coinc_rates(H1 = 0.001, L1 = 0.002, V1 = 0.001) {frozenset(['V1', 'H1']): 6.457258459445168e-08, frozenset(['V1', 'H1', 'L1']): 3.3752732367557724e-12, frozenset(['H1', 'L1']): 6.004800933565894e-08, frozenset(['V1', 'L1']): 1.2578998879366924e-07}
Definition at line 1842 of file snglcoinc.py.
| def lalburst.snglcoinc.CoincRates.marginalized_strict_coinc_counts | ( | self, | |
| seglists, | |||
| ** | rates | ||
| ) |
A dictionary mapping instrument combination (as a frozenset) to the total number of coincidences involving precisely that combination of instruments expected from the background.
Definition at line 1868 of file snglcoinc.py.
| def lalburst.snglcoinc.CoincRates.lnP_instruments | ( | self, | |
| ** | rates | ||
| ) |
Given the event rates for a collection of instruments, compute the natural logarithm of the probability that a coincidence is found to involve exactly a given set of instruments.
This is equivalent to the ratios of the values in the dictionary returned by .strict_coinc_rates() to their sum.
Raises ZeroDivisionError if all coincidence rates are 0.
See also .strict_coinc_rates().
Example:
coincrates = CoincRates(("H1", "L1", "V1"), 0.005, 2) coincrates.lnP_instruments(H1 = 0.001, L1 = 0.002, V1 = 0.003) {frozenset(['V1', 'H1']): -1.181124067253893, frozenset(['V1', 'H1', 'L1']): -11.040192999777876, frozenset(['H1', 'L1']): -2.352494317162074, frozenset(['V1', 'L1']): -0.5143002401188091}
Definition at line 1901 of file snglcoinc.py.
| def lalburst.snglcoinc.CoincRates.random_instruments | ( | self, | |
| ** | rates | ||
| ) |
Generator that, given the event rates for a collection of instruments, yields a sequence of two-element tuples each containing a randomly-selected frozen set of instruments and the natural logarithm of the ratio of the rate at which that combination of instruments forms coincidences to the rate at which it is being yielded by this generator.
See also .lnP_instruments().
Example:
coincrates = CoincRates(("H1", "L1", "V1"), 0.005, 2) x = iter(coincrates.random_instruments(H1 = 0.001, L1 = 0.002, V1 = 0.003)) x.next() # doctest: +SKIP (frozenset(['H1', 'L1']), -3.738788683913535)
NOTE: the generator yields instrument combinations drawn uniformly from the set of allowed instrument combinations, but this is not considered part of the definition of the behaviour of this generator and this implementation detail should not be relied upon by calling code. It is stated here simply for clarity in case it helps improve optimization choices elsewhere.
Definition at line 1938 of file snglcoinc.py.
| def lalburst.snglcoinc.CoincRates.plausible_toas | ( | self, | |
| instruments | |||
| ) |
Generator that yields dictionaries of random event time-of-arrival offsets for the given instruments such that the time-of-arrivals are mutually coincident given the maximum allowed inter-instrument \Delta t's.
The values returned are offsets, and would need to be added to some common time to yield absolute arrival times.
Example:
coincrates = CoincRates(("H1", "L1", "V1"), 0.005, 2) x = iter(coincrates.plausible_toas(("H1", "L1"))) x.next() # doctest: +SKIP {'H1': 0.0, 'L1': -0.010229226372297711}
Definition at line 1963 of file snglcoinc.py.
| lalburst.snglcoinc.CoincRates.instruments |
Definition at line 1583 of file snglcoinc.py.
| lalburst.snglcoinc.CoincRates.delta_t |
Definition at line 1584 of file snglcoinc.py.
| lalburst.snglcoinc.CoincRates.min_instruments |
Definition at line 1585 of file snglcoinc.py.
| lalburst.snglcoinc.CoincRates.tau |
Definition at line 1596 of file snglcoinc.py.
| lalburst.snglcoinc.CoincRates.rate_factors |
Definition at line 1608 of file snglcoinc.py.