llama.files.coinc_significance.subthreshold module¶
FileHandler
class for calculating significance of joint events with
subthreshold gravitational wave triggers.
NOTE: equations after 8 increment up by 1. equations after 22 increment up by 2.
@author: dvesk, stefco
-
class
llama.files.coinc_significance.subthreshold.
CoincSignificanceSubthresholdI3Lvc
¶ Bases:
llama.filehandler.JSONFile
Calculates the significance (Bayes Factor) of a joint GW+HEN event.
-
DEPENDENCIES
= (<class 'llama.files.lvalert_json.LVAlertJSON'>, <class 'llama.files.skymap_info.SkymapInfo'>, <class 'llama.files.i3.json.IceCubeNeutrinoList'>, <class 'llama.files.lvc_skymap.LvcSkymapHdf5'>, <class 'llama.files.gracedb.LVCGraceDbEventData'>, <class 'llama.files.lvc_skymap.LvcDistancesJson'>, <class 'llama.files.gracedb.PAstro'>)¶
-
DETECTORS
= (Detector(name='IceCube', abbrev='i3', fullname='IceCube', url='http://wiki.icecube.wisc.edu', summary='IceCube', description='', citations=ImmutableDict({})), Detector(name='LVC', abbrev='lvc', fullname='LVC', url='http://wiki.ligo.org', summary='LVC', description='', citations=ImmutableDict({})))¶
-
FILENAME
= 'significance_subthresh_lvc-i3.json'¶
-
MANIFEST_TYPES
= (<class 'llama.files.coinc_significance.subthreshold.CoincSignificanceSubthresholdI3Lvc'>,)¶
-
TIMEOUT
= 600¶
-
UR_DEPENDENCIES
= (<class 'llama.files.skymap_info.SkymapInfo'>, <class 'llama.files.lvc_skymap.LvcSkymapFits'>, <class 'llama.files.i3.json.IceCubeNeutrinoList'>, <class 'llama.files.gracedb.LVCGraceDbEventData'>, <class 'llama.files.lvalert_json.LVAlertJSON'>, <class 'llama.files.lvc_skymap.LvcDistancesJson'>, <class 'llama.files.lvc_skymap.LvcSkymapHdf5'>, <class 'llama.files.gracedb.PAstro'>)¶
-
UR_DEPENDENCY_TREE
= ImmutableDict({<class 'llama.files.gracedb.PAstro'>: ImmutableDict({<class 'llama.files.skymap_info.SkymapInfo'>: ImmutableDict({})}), <class 'llama.files.lvc_skymap.LvcSkymapHdf5'>: ImmutableDict({<class 'llama.files.lvc_skymap.LvcSkymapFits'>: ImmutableDict({<class 'llama.files.skymap_info.SkymapInfo'>: ImmutableDict({})})}), <class 'llama.files.lvc_skymap.LvcDistancesJson'>: ImmutableDict({<class 'llama.files.lvc_skymap.LvcSkymapFits'>: ImmutableDict({<class 'llama.files.skymap_info.SkymapInfo'>: ImmutableDict({})})}), <class 'llama.files.skymap_info.SkymapInfo'>: ImmutableDict({}), <class 'llama.files.lvalert_json.LVAlertJSON'>: ImmutableDict({}), <class 'llama.files.gracedb.LVCGraceDbEventData'>: ImmutableDict({<class 'llama.files.skymap_info.SkymapInfo'>: ImmutableDict({})}), <class 'llama.files.i3.json.IceCubeNeutrinoList'>: ImmutableDict({<class 'llama.files.skymap_info.SkymapInfo'>: ImmutableDict({})})})¶
-
property
combined_p_value
¶ Return the combined p-value for the whole event.
-
-
llama.files.coinc_significance.subthreshold.
PEgw
(Egw, search_params)¶ Probability of isotropic-equivalent GW emission energy Egw given the signal hypothesis, P(E_{GW}).
- Parameters
Egw (float) – The assumed isotropic GW emission energy. We will marginalize over this value to get Rdet and the signal likelihoods.
search_params (IceCubeLvcSearchParameters) – A collection of constant parameters used for this search.
- Returns
p_e_gw – P(E_{GW}).
- Return type
float
-
llama.files.coinc_significance.subthreshold.
PEn
(En, search_params)¶ Probability of isotropic-equivalent neutrino emission energy Eₙ given the signal hypothesis, P(E_{nu}).
- Parameters
Eₙ (float) – The assumed isotropic neutrino emission energy. We will marginalize over this value to get Rdet and the signal likelihoods.
search_params (IceCubeLvcSearchParameters) – A collection of constant parameters used for this search.
- Returns
p_e_nu – P(E_{nu}).
- Return type
float
-
class
llama.files.coinc_significance.subthreshold.
RctSlkLmaCoincSignificanceSubthresholdI3Lvc
¶ Bases:
llama.files.slack.SlackReceiptLlama
-
DEPENDENCIES
= (<class 'llama.files.coinc_significance.subthreshold.CoincSignificanceSubthresholdI3Lvc'>, <class 'llama.files.skymap_info.SkymapInfo'>)¶
-
FILENAME
= 'rct_slk_lma_significance_subthresh_lvc-i3.json.json'¶
-
FILENAME_FMT
= 'rct_slk_lma_{}.json'¶
-
MANIFEST_TYPES
= (<class 'llama.files.coinc_significance.subthreshold.RctSlkLmaCoincSignificanceSubthresholdI3Lvc'>,)¶
-
UPLOAD
¶ alias of
CoincSignificanceSubthresholdI3Lvc
-
UR_DEPENDENCIES
= (<class 'llama.files.skymap_info.SkymapInfo'>, <class 'llama.files.lvc_skymap.LvcSkymapFits'>, <class 'llama.files.i3.json.IceCubeNeutrinoList'>, <class 'llama.files.gracedb.LVCGraceDbEventData'>, <class 'llama.files.lvalert_json.LVAlertJSON'>, <class 'llama.files.lvc_skymap.LvcDistancesJson'>, <class 'llama.files.lvc_skymap.LvcSkymapHdf5'>, <class 'llama.files.gracedb.PAstro'>, <class 'llama.files.coinc_significance.subthreshold.CoincSignificanceSubthresholdI3Lvc'>)¶
-
UR_DEPENDENCY_TREE
= frozenset({<class 'llama.files.coinc_significance.subthreshold.CoincSignificanceSubthresholdI3Lvc'>})¶
-
class_vetoes
= ()¶
-
-
llama.files.coinc_significance.subthreshold.
emptyskymap
(val, skymap)¶ A
HEALPixSkyMap
initialized with a uniform value.- Parameters
val (float or int) – The value to assign each pixel.
skymap (HEALPixSkyMap) – A skymap whose shape should be used as the template.
- Returns
skymap – A skymap shaped like
skymap
but with all pixel values set toval
.- Return type
-
llama.files.coinc_significance.subthreshold.
expnu
(En, r, search_params)¶ Expected number of neutrinos for a given emission energy and distance, <n_ν(E_ν, r)>
- Parameters
Eₙ (float) – Neutrino emission energy [kg Mpc**2 / sec**2].
r (float) – Distance to the hypothesized neutrino source. [Mpc]
search_params (IceCubeLvcSearchParameters) – A collection of constant parameters used for this search.
- Returns
exp_nu – <n_ν(E_ν, r)>
- Return type
float
-
llama.files.coinc_significance.subthreshold.
fA
(θ, phi, t)¶ The antenna pattern at direction θ, phi and time t.
-
llama.files.coinc_significance.subthreshold.
five
(tgw, gw_skymap, ρgw, dist, neutrinolist, search_params, En, pempnu, cwb_Boolean)¶ Calculate the signal likelihood (Eq. 5).
- Parameters
tgw (float) – GPS time of the GW trigger
gw_skymap (llama.files.healpix.skymap.HEALPixSkyMap) – A HEALPix skymap for the GW specifying pixel values and locations.
ρgw (float) – The signal-to-noise ratio (SNR) of the GW
dist (float) – The probability-weighted average reconstructed distance of the GW event
neutrino (llama.files.i3.Neutrino) – The neutrino candidate that is being compared to the GW skymap
search_params (IceCubeLvcSearchParameters) – A collection of constant parameters used for this search.
Eₙ (float) – The neutrino energy. This should be capped at the maximum energy of a nearby background neutrino. This way the signal likelihood does not drop (as it does for increasing energy) while the background stays the same (since the background calculation always assumes at least one neutrino).
cwb_Boolean (bool) – Whether this is a CWB event or not.
- Returns
P_H_S1 –
The signal hypothesis likelihood for a single neutrino:
AllskyIntegral(P(x_gw, x_nu | θ, H_s)*P(θ | H_s))
- Return type
float
-
llama.files.coinc_significance.subthreshold.
five2
(tgw, gw_skymap, ρgw, dist, neutrino, neutrino_i, search_params, En, En_i)¶ Calculate the signal likelihood for 2 coincident neutrinos (modified Eq. 5)
- Parameters
tgw (float) – GPS time of the GW trigger
gw_skymap (llama.files.healpix.skymap.HEALPixSkyMap) – A HEALPix skymap for the GW specifying pixel values and locations.
ρgw (float) – The signal-to-noise ratio (SNR) of the GW
dist (float) – The probability-weighted average reconstructed distance of the GW event
neutrino (llama.files.i3.Neutrino) – The neutrino candidate that is being compared to the GW skymap as well as
neutrino_i
.neutrino_i (llama.files.i3.Neutrino) – The ith neutrino candidate that is being compared to the GW skymap as well as
neutrino
.search_params (IceCubeLvcSearchParameters) – A collection of constant parameters used for this search.
Eₙ (float) – The neutrino energy. This should be capped at the maximum energy of a nearby background neutrino. This way the signal likelihood does not drop (as it does for increasing energy) while the background stays the same (since the background calculation always assumes at least one neutrino).
Eₙ_i (float) – Same as Eₙ, but for the ith neutrino.
- Returns
P_H_S2 –
The signal hypothesis likelihood for a double-neutrino detection:
AllskyIntegral(P(x_gw, x_nu, x_nu_i | θ, H_s)*P(θ | H_s))
- Return type
float
-
llama.files.coinc_significance.subthreshold.
five2wogw
(neutrino, neutrino_i, search_params, En, En_i)¶ NOT USED Calculate the coincidence likelihood for 2 coincident neutrinos (modified Eq. 58)
- Parameters
neutrino (llama.files.i3.Neutrino) – The neutrino candidate that is being compared to the GW skymap as well as
neutrino_i
.neutrino_i (llama.files.i3.Neutrino) – The ith neutrino candidate that is being compared to the GW skymap as well as
neutrino
.search_params (IceCubeLvcSearchParameters) – A collection of constant parameters used for this search.
Eₙ (float) – The neutrino energy. This should be capped at the maximum energy of a nearby background neutrino. This way the signal likelihood does not drop (as it does for increasing energy) while the background stays the same (since the background calculation always assumes at least one neutrino).
Eₙ_i (float) – Same as Eₙ, but for the ith neutrino.
- Returns
P_H_c2 –
The coincidence hypothesis likelihood for a double-neutrino detection:
AllskyIntegral(P(x_nu, x_nu_i | θ, H_c)*P(θ | H_c))
- Return type
float
-
llama.files.coinc_significance.subthreshold.
fivewogw
(gw_skymap, neutrinolist, search_params, En, pempnu)¶ Calculate the coincidence likelihood (Eq. 58).
- Parameters
neutrino (llama.files.i3.Neutrino) – The neutrino candidate that is being compared to the GW skymap
search_params (IceCubeLvcSearchParameters) – A collection of constant parameters used for this search.
Eₙ (float) – The neutrino energy. This should be capped at the maximum energy of a nearby background neutrino. This way the signal likelihood does not drop (as it does for increasing energy) while the background stays the same (since the background calculation always assumes at least one neutrino).
- Returns
P_H_c1 –
The coincidence hypothesis likelihood for a single neutrino:
AllskyIntegral(P(x_nu | θ, H_c)*P(θ | H_c))
- Return type
float
-
llama.files.coinc_significance.subthreshold.
iA
(search_params)¶ Integrated antenna factor for detector network given by
detectors
.
-
llama.files.coinc_significance.subthreshold.
odds_ratio
(tgw, gw_skymap, ρgw, dist, search_params, neutrinolist, p_ter, cwb_Boolean)¶ Calculate the odds ratio for the signal vs. the null+chance coincidence hypothesis. This is the main measure of significance for the pipeline. Also returns the factors that went into calculating the odds ratio. Calculates the odds ratio for an entire ensemble of neutrino candidates in contrast with the OPA version (which calculates p-value on a per-neutrino basis).
- Parameters
tgw (float) – GPS time of the GW trigger
gw_skymap (llama.files.healpix.skymap.HEALPixSkyMap) – A HEALPix skymap for the GW specifying pixel values and locations.
ρgw (float) – The signal-to-noise ratio (SNR) of the GW
dist (float) – The probability-weighted average reconstructed distance of the GW event
search_params (IceCubeLvcSearchParameters) – A collection of constant parameters used for this search.
neutrinolist (list) – A list of
llama.files.i3.Neutrino
instances describing the other neutrinos in this search (used for the 2-neutrino search,five2
).cwb_Boolean (bool) – Whether this is a CWB event or not.
- Returns
odds (float) –
- The odds ratio:
P(H_s|x_gw, x_nu)
P(H_0|x_gw, x_nu) + P(H_c|x_gw, x_nu)
pₕˢ1 (float) – The signal probability (times the marginal likelihood, cancels everywhere) for the single-neutrino detection case:
P(H_s_1|x_gw, x_nu) * P(x_gw, x_nu)
pₕˢ2 (float) – The signal probability (times the marginal likelihood, cancels everywhere) for the double-neutrino detection case:
P(H_s_2|x_gw, x_nu1, x_nu2) * P(x_gw, x_nu1, x_nu2)
pₕ0 (float) – The null hypothesis probability (times the marginal likelihood, cancels everywhere):
P(H_0|x_gw, x_nu) * P(x_gw, x_nu)
pₕᶜ (float) – The chance coincidence hypothesis probability (times the marginal likelihood, cancels everywhere):
P(H_0|x_gw, x_nu) * P(x_gw, x_nu)
p_value (float) – The p-value or false-alarm probability (FAP) of the given
odds_ratio
assuming the given source population and detector configuration.dump (dict) – Local variables with scalar values from the function (for debugging). The contents of this object are not guaranteed to equal anything in particular and should not be used for anything science-related.