llama.files.coinc_significance.opa module¶
FileHandler
class for calculating significance of joint events with
high-confidence gravitational wave triggers from Open Public Alerts (OPAs).
NOTE: equations after 8 increment up by 1. equations after 22 increment up by 2.
@author: dvesk, stefco
-
class
llama.files.coinc_significance.opa.
CoincSignificanceI3Lvc
¶ Bases:
llama.filehandler.JSONFile
Calculates the significance (Bayes Factor) of a joint GW+HEN event.
-
DEPENDENCIES
= (<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_lvc-i3.json'¶
-
MANIFEST_TYPES
= (<class 'llama.files.coinc_significance.opa.CoincSignificanceI3Lvc'>,)¶
-
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.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.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.
-
odds
()¶ Return a list of the odds ratios calculated. Ordering corresponds to the ordering of neutrinos in the
IceCubeNeutrinoList
file used to calculate the odds ratios.
-
property
p_values
¶ Return a list of the p-values calculated. Ordering corresponds to the ordering of neutrinos in the
IceCubeNeutrinoList
file used to calculate the odds ratios.
-
-
llama.files.coinc_significance.opa.
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.opa.
PEnu
(Enu, search_params)¶ Probability of isotropic-equivalent neutrino emission energy Enu given the signal hypothesis, P(E_{nu}).
- Parameters
Enu (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.opa.
RctSlkLmaCoincSignificanceI3Lvc
¶ Bases:
llama.files.slack.SlackReceiptLlama
-
DEPENDENCIES
= (<class 'llama.files.coinc_significance.opa.CoincSignificanceI3Lvc'>, <class 'llama.files.skymap_info.SkymapInfo'>)¶
-
FILENAME
= 'rct_slk_lma_significance_lvc-i3.json.json'¶
-
FILENAME_FMT
= 'rct_slk_lma_{}.json'¶
-
MANIFEST_TYPES
= (<class 'llama.files.coinc_significance.opa.RctSlkLmaCoincSignificanceI3Lvc'>,)¶
-
UPLOAD
¶ alias of
CoincSignificanceI3Lvc
-
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.lvc_skymap.LvcDistancesJson'>, <class 'llama.files.lvc_skymap.LvcSkymapHdf5'>, <class 'llama.files.gracedb.PAstro'>, <class 'llama.files.coinc_significance.opa.CoincSignificanceI3Lvc'>)¶
-
UR_DEPENDENCY_TREE
= frozenset({<class 'llama.files.coinc_significance.opa.CoincSignificanceI3Lvc'>})¶
-
class_vetoes
= ()¶
-
-
llama.files.coinc_significance.opa.
expnu
(Enu, r, search_params)¶ - Expected number of neutrinos for a given emission energy and distance,
< n_{
u}(E_{ u}, r) >
- Enufloat
Neutrino emission energy [kg Mpc**2 / sec**2].
- rfloat
Distance to the hypothesized neutrino source. [Mpc]
- search_paramsIceCubeLvcSearchParameters
A collection of constant parameters used for this search.
- exp_nufloat
< n_{
u}(E_{ u}, r) >
-
llama.files.coinc_significance.opa.
fA
(theta, phi, t)¶ The antenna pattern at direction theta, phi and time t.
-
llama.files.coinc_significance.opa.
five
(tgw, gw_skymap, ρgw, dist, neutrino, search_params, enu, 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.
enu (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 | theta, H_s)*P(theta | H_s))
- Return type
float
-
llama.files.coinc_significance.opa.
five2
(tgw, gw_skymap, ρgw, dist, neutrino, neutrino_i, search_params, enu, enu_i, cwb_Boolean)¶ 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.
enu (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).
enu_i (float) – Same as enu, but for the ith neutrino.
cwb_Boolean (bool) – Whether this is a CWB event or not.
- Returns
P_H_S2 –
The signal hypothesis likelihood for a double-neutrino detection:
AllskyIntegral(P(x_gw, x_nu, x_nu_i | theta, H_s)*P(theta | H_s))
- Return type
float
-
llama.files.coinc_significance.opa.
iA
(search_params)¶ Integrated antenna factor for detector network given by
detectors
.
-
llama.files.coinc_significance.opa.
odds_ratio
(tgw, gw_skymap, ρgw, dist, neutrino, search_params, neutrinolist, count, count2, 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.
- 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.
neutrinolist (list) – A list of
llama.files.i3.Neutrino
instances describing the other neutrinos in this search (used for the 2-neutrino search,five2
).count (np.array) – An array tracking whether two neutrinos have been compared. If an entry is 1, then they are considered to have been compared (the diagonal entries should be set to 1 at the start).
count2 (int) – The index of the current primary neutrino in
neutrinolist
.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_h_s1 (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_h_s2 (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_h_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_h_c (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.