llama.files.coinc_significance module

FileHandler classes for calculating significance of joint events.

Created on Tue Oct 16 14:00:54 2018

NOTE: equations after 8 increment up by 1. equations after 22 increment up by 2.

@author: dvesk, stefco

llama.files.coinc_significance.Aeff(e, theta)
llama.files.coinc_significance.Aeff_skymap(skymap, enu)

Get the energy- and direction-dependent effective areas of the neutrino detector for every direction provided in skymap (Eq. 21, 22)

Parameters:
  • skymap (llama.files.healpix.HEALPixSkyMap) – A HEALPixSkyMap instance with defined right-ascensions and declinations.
  • enu (float) – The reconstructed neutrino energy.
class llama.files.coinc_significance.CoincSignificanceI3Lvc

Bases: llama.filehandler.JSONFile

digraph "llama.files.coinc_significance.CoincSignificanceI3Lvc" { charset="utf-8" splines=ortho bgcolor=none margin=0 rankdir=LR "llama.files.coinc_significance.CoincSignificanceI3Lvc" [label=<{{<B>CoincSignificanceI3Lvc</B>|<I>significance_lvc-i3.json</I>|JSONFile}}>, shape="record", style=filled, target=_top, URL="/llama.files.coinc_significance.html#llama.files.coinc_significance.CoincSignificanceI3Lvc", fillcolor="#cccccc"]; "llama.files.gracedb.LVCGraceDbEventData" [label=<{{<B>LVCGraceDbEventData</B>|<I>lvc_gracedb_event_data.json</I>|JSONFile<BR/>OnlineVetoMixin}}>, shape="record", style=filled, target=_top, URL="/llama.files.gracedb.html#llama.files.gracedb.LVCGraceDbEventData", fillcolor="#cccccc"]; "llama.files.gracedb.PAstro" [label=<{{<B>PAstro</B>|<I>p_astro.json</I>|GraceDBPollingFileHandler<BR/>JSONFile}}>, shape="record", style=filled, target=_top, URL="/llama.files.gracedb.html#llama.files.gracedb.PAstro", fillcolor="#cccccc"]; "llama.files.i3.json.IceCubeNeutrinoList" [label=<{{<B>IceCubeNeutrinoList</B>|<I>icecube_neutrino_list.json</I>|JSONFile<BR/>HEALPixPSF}}>, shape="record", style=filled, target=_top, URL="/llama.files.i3.json.html#llama.files.i3.json.IceCubeNeutrinoList", fillcolor="#cccccc"]; "llama.files.lvc_skymap.LvcDistancesJson" [label=<{{<B>LvcDistancesJson</B>|<I>lvc_skymap_distances.json</I>|JSONFile}}>, shape="record", style=filled, target=_top, URL="/llama.files.lvc_skymap.html#llama.files.lvc_skymap.LvcDistancesJson", fillcolor="#cccccc"]; "llama.files.lvc_skymap.LvcSkymapFits" [label=<{{<B>LvcSkymapFits</B>|<I>lvc_skymap.fits.gz</I>|LvcHEALPixSkyMapFileHandler<BR/>GenerateOnceMixin<BR/>ObservingVetoMixin}}>, shape="record", style=filled, target=_top, URL="/llama.files.lvc_skymap.html#llama.files.lvc_skymap.LvcSkymapFits", fillcolor="#cccccc"]; "llama.files.lvc_skymap.LvcSkymapHdf5" [label=<{{<B>LvcSkymapHdf5</B>|<I>lvc_skymap.hdf5</I>|HEALPixSkyMapFileHandler}}>, shape="record", style=filled, target=_top, URL="/llama.files.lvc_skymap.html#llama.files.lvc_skymap.LvcSkymapHdf5", fillcolor="#cccccc"]; "llama.files.skymap_info.SkymapInfo" [label=<{{<B>SkymapInfo</B>|<I>skymap_info.json</I>|EventTriggeredFileHandler<BR/>JSONFile}}>, shape="record", style=filled, target=_top, URL="/llama.files.skymap_info.html#llama.files.skymap_info.SkymapInfo", fillcolor="#cccccc"]; "llama.files.gracedb.LVCGraceDbEventData" -> "llama.files.coinc_significance.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.gracedb.PAstro" -> "llama.files.coinc_significance.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.i3.json.IceCubeNeutrinoList" -> "llama.files.coinc_significance.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.lvc_skymap.LvcDistancesJson" -> "llama.files.coinc_significance.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.lvc_skymap.LvcSkymapFits" -> "llama.files.lvc_skymap.LvcDistancesJson" [arrowtail="none", color="red", ]; "llama.files.lvc_skymap.LvcSkymapFits" -> "llama.files.lvc_skymap.LvcSkymapHdf5" [arrowtail="none", color="red", ]; "llama.files.lvc_skymap.LvcSkymapHdf5" -> "llama.files.coinc_significance.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.skymap_info.SkymapInfo" -> "llama.files.coinc_significance.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.skymap_info.SkymapInfo" -> "llama.files.gracedb.LVCGraceDbEventData" [arrowtail="none", color="red", ]; "llama.files.skymap_info.SkymapInfo" -> "llama.files.gracedb.PAstro" [arrowtail="none", color="red", ]; "llama.files.skymap_info.SkymapInfo" -> "llama.files.i3.json.IceCubeNeutrinoList" [arrowtail="none", color="red", ]; "llama.files.skymap_info.SkymapInfo" -> "llama.files.lvc_skymap.LvcSkymapFits" [arrowtail="none", color="red", ]; }

Required input files for llama.files.coinc_significance.CoincSignificanceI3Lvc (located on the far right of the graph). For a typical trigger, the leftmost files will be generated as triggers become available. They will be used as input for files to their right, eventually allowing llama.files.coinc_significance.CoincSignificanceI3Lvc to be generated.

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.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.gracedb.PAstro'>, <class 'llama.files.lvc_skymap.LvcSkymapHdf5'>)
UR_DEPENDENCY_TREE = 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.gracedb.PAstro'>: 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.gracedb.LVCGraceDbEventData'>: ImmutableDict({<class 'llama.files.skymap_info.SkymapInfo'>: ImmutableDict({})}), <class 'llama.files.skymap_info.SkymapInfo'>: ImmutableDict({}), <class 'llama.files.i3.json.IceCubeNeutrinoList'>: ImmutableDict({<class 'llama.files.skymap_info.SkymapInfo'>: ImmutableDict({})})})
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.

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

llama.files.coinc_significance.Pempgw(rhogw)

The empirical neutrino background for a given GW SNR rhogw.

class llama.files.coinc_significance.RctSlkLmaCoincSignificanceI3Lvc

Bases: llama.files.slack.SlackReceiptLlama

digraph "llama.files.coinc_significance.RctSlkLmaCoincSignificanceI3Lvc" { charset="utf-8" splines=ortho bgcolor=none margin=0 rankdir=LR "llama.files.coinc_significance.CoincSignificanceI3Lvc" [label=<{{<B>CoincSignificanceI3Lvc</B>|<I>significance_lvc-i3.json</I>|JSONFile}}>, shape="record", style=filled, target=_top, URL="/llama.files.coinc_significance.html#llama.files.coinc_significance.CoincSignificanceI3Lvc", fillcolor="#cccccc"]; "llama.files.coinc_significance.RctSlkLmaCoincSignificanceI3Lvc" [label=<{{<B>RctSlkLmaCoincSignificanceI3Lvc</B>|<I>rct_slk_lma_significance_lvc-i3.json.json</I>|SlackReceiptLlama}}>, shape="record", style=filled, target=_top, URL="/llama.files.coinc_significance.html#llama.files.coinc_significance.RctSlkLmaCoincSignificanceI3Lvc", fillcolor="#cccccc"]; "llama.files.gracedb.LVCGraceDbEventData" [label=<{{<B>LVCGraceDbEventData</B>|<I>lvc_gracedb_event_data.json</I>|JSONFile<BR/>OnlineVetoMixin}}>, shape="record", style=filled, target=_top, URL="/llama.files.gracedb.html#llama.files.gracedb.LVCGraceDbEventData", fillcolor="#cccccc"]; "llama.files.gracedb.PAstro" [label=<{{<B>PAstro</B>|<I>p_astro.json</I>|GraceDBPollingFileHandler<BR/>JSONFile}}>, shape="record", style=filled, target=_top, URL="/llama.files.gracedb.html#llama.files.gracedb.PAstro", fillcolor="#cccccc"]; "llama.files.i3.json.IceCubeNeutrinoList" [label=<{{<B>IceCubeNeutrinoList</B>|<I>icecube_neutrino_list.json</I>|JSONFile<BR/>HEALPixPSF}}>, shape="record", style=filled, target=_top, URL="/llama.files.i3.json.html#llama.files.i3.json.IceCubeNeutrinoList", fillcolor="#cccccc"]; "llama.files.lvc_skymap.LvcDistancesJson" [label=<{{<B>LvcDistancesJson</B>|<I>lvc_skymap_distances.json</I>|JSONFile}}>, shape="record", style=filled, target=_top, URL="/llama.files.lvc_skymap.html#llama.files.lvc_skymap.LvcDistancesJson", fillcolor="#cccccc"]; "llama.files.lvc_skymap.LvcSkymapFits" [label=<{{<B>LvcSkymapFits</B>|<I>lvc_skymap.fits.gz</I>|LvcHEALPixSkyMapFileHandler<BR/>GenerateOnceMixin<BR/>ObservingVetoMixin}}>, shape="record", style=filled, target=_top, URL="/llama.files.lvc_skymap.html#llama.files.lvc_skymap.LvcSkymapFits", fillcolor="#cccccc"]; "llama.files.lvc_skymap.LvcSkymapHdf5" [label=<{{<B>LvcSkymapHdf5</B>|<I>lvc_skymap.hdf5</I>|HEALPixSkyMapFileHandler}}>, shape="record", style=filled, target=_top, URL="/llama.files.lvc_skymap.html#llama.files.lvc_skymap.LvcSkymapHdf5", fillcolor="#cccccc"]; "llama.files.skymap_info.SkymapInfo" [label=<{{<B>SkymapInfo</B>|<I>skymap_info.json</I>|EventTriggeredFileHandler<BR/>JSONFile}}>, shape="record", style=filled, target=_top, URL="/llama.files.skymap_info.html#llama.files.skymap_info.SkymapInfo", fillcolor="#cccccc"]; "llama.files.coinc_significance.CoincSignificanceI3Lvc" -> "llama.files.coinc_significance.RctSlkLmaCoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.gracedb.LVCGraceDbEventData" -> "llama.files.coinc_significance.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.gracedb.PAstro" -> "llama.files.coinc_significance.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.i3.json.IceCubeNeutrinoList" -> "llama.files.coinc_significance.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.lvc_skymap.LvcDistancesJson" -> "llama.files.coinc_significance.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.lvc_skymap.LvcSkymapFits" -> "llama.files.lvc_skymap.LvcDistancesJson" [arrowtail="none", color="red", ]; "llama.files.lvc_skymap.LvcSkymapFits" -> "llama.files.lvc_skymap.LvcSkymapHdf5" [arrowtail="none", color="red", ]; "llama.files.lvc_skymap.LvcSkymapHdf5" -> "llama.files.coinc_significance.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.skymap_info.SkymapInfo" -> "llama.files.coinc_significance.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.skymap_info.SkymapInfo" -> "llama.files.coinc_significance.RctSlkLmaCoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.skymap_info.SkymapInfo" -> "llama.files.gracedb.LVCGraceDbEventData" [arrowtail="none", color="red", ]; "llama.files.skymap_info.SkymapInfo" -> "llama.files.gracedb.PAstro" [arrowtail="none", color="red", ]; "llama.files.skymap_info.SkymapInfo" -> "llama.files.i3.json.IceCubeNeutrinoList" [arrowtail="none", color="red", ]; "llama.files.skymap_info.SkymapInfo" -> "llama.files.lvc_skymap.LvcSkymapFits" [arrowtail="none", color="red", ]; }

Required input files for llama.files.coinc_significance.RctSlkLmaCoincSignificanceI3Lvc (located on the far right of the graph). For a typical trigger, the leftmost files will be generated as triggers become available. They will be used as input for files to their right, eventually allowing llama.files.coinc_significance.RctSlkLmaCoincSignificanceI3Lvc to be generated.

DEPENDENCIES = (<class 'llama.files.coinc_significance.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.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.gracedb.PAstro'>, <class 'llama.files.lvc_skymap.LvcSkymapHdf5'>, <class 'llama.files.coinc_significance.CoincSignificanceI3Lvc'>)
UR_DEPENDENCY_TREE = ImmutableDict({<class 'llama.files.coinc_significance.CoincSignificanceI3Lvc'>: 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.gracedb.PAstro'>: 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.gracedb.LVCGraceDbEventData'>: ImmutableDict({<class 'llama.files.skymap_info.SkymapInfo'>: ImmutableDict({})}), <class 'llama.files.skymap_info.SkymapInfo'>: ImmutableDict({}), <class 'llama.files.i3.json.IceCubeNeutrinoList'>: ImmutableDict({<class 'llama.files.skymap_info.SkymapInfo'>: ImmutableDict({})})})})
class_vetoes = ()
llama.files.coinc_significance.aeff_lookup_table()

Get a dictionary mapping from strings describing neutrino energy bounds to tuples of the form (factor, exponent) where factor is a lookup table of the constant factor multiplying the effective area (with indices representing 10-degree increments in the angle theta) and exponent is the exponent to which the neutrino energy e is raised (since we assume a rough power law for Aeff, again with indices representing 10-degree increments in the angle theta). The final value will be factor*e**exponent.

NOTE that we need to include an item for [180, 190) degrees because int(180./10) will give us 18, indexing into the 19th entry in the lookup table, and we want to include this edge case.

llama.files.coinc_significance.angle_list()
llama.files.coinc_significance.expnu(Enu, r, search_params)
Expected number of neutrinos for a given emission energy and distance,
< n_{

u}(E_{ u}, r) >

Enu : 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.
exp_nu : float
< n_{

u}(E_{ u}, r) >

llama.files.coinc_significance.fA(theta, phi, t)

The antenna pattern at direction theta, phi and time t.

llama.files.coinc_significance.five(tgw, gw_skymap, rhogw, dist, neutrino, search_params, enu)

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.
  • rhogw (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).
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.five2(tgw, gw_skymap, rhogw, dist, neutrino, neutrino_i, search_params, enu, enu_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.
  • rhogw (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.
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.iA(search_params)

Integrated antenna factor for detector network given by detectors.

llama.files.coinc_significance.load_neutrino_background()

Load neutrino background data.

Returns:
  • thetabg (array-like) – Array of background neutrino zenith angles [deg] as reconstructed by IceCube.
  • EGev (array-like) – Array of background neutrino energies [GeV] as reconstructed by IceCube.
llama.files.coinc_significance.odds_ratio(tgw, gw_skymap, rhogw, dist, neutrino, search_params, neutrinolist, count, count2)

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.
  • rhogw (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.
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.

llama.files.coinc_significance.p_value(odds_ratio, population, sensitivity, instruments)

Calculate the p-value for a given odds ratio.

Parameters:
  • odds_ratio (float) – The odds ratio for signal vs. background/null; is here being interpreted as a test statistic to make the analysis robust against constant factors in the priors.
  • population (str) – The name of the source population against which this odds_ratio will be compared, e.g. ‘bns’ for binary neutron stars. NOTE: This just has to be set so that it references an existing group in the NEUTRINO_POPULATIONS HDF5 file; there are currently no explict standards for naming the population. See populations-hdf5-collater and the contents of the directory containing NEUTRINO_POPULATIONS for available options.
  • sensitivity (str) – The detector configuration and sensitivity used, e.g. ‘design’ for HLV at design sensitivity. See the NOTE on population for naming information.
  • instruments (list) – The instruments participating in this search as a list of detector names, e.g. [H1, L1, V1] for all three O3 GW detectors. If a background population is available for this set of instruments, it will be used; otherwise, at attempt will be made to use a population averaging over all sets of participating detectors (for populations where full separate cases could not be feasibly generated).
Returns:

p_value – The p-value or false-alarm probability (FAP) of the given odds_ratio assuming the given source population and detector configuration.

Return type:

float

llama.files.coinc_significance.r0(Egw, search_params)

Maximum GW detection distance for isotropic-equivalent emission energy Egw.

llama.files.coinc_significance.search_parameters(population, instruments)

Return an IceCubeLvcSearchParameters instance with all default values and the given population and instruments.

population : str
The name of the source population against which this odds_ratio will be compared, e.g. ‘bns’ for binary neutron stars. NOTE: This just has to be set so that it references an existing group in the NEUTRINO_POPULATIONS HDF5 file; there are currently no explict standards for naming the population. See populations-hdf5-collater and the contents of the directory containing NEUTRINO_POPULATIONS for available options.
instruments : list
The GW detectors participating in this search as a list of detector names, e.g. [H1, L1, V1] for all three O3 GW detectors. If a background population is available for this set of instruments, it will be used; otherwise, at attempt will be made to use a population averaging over all sets of participating instruments (for populations where full separate cases could not be feasibly generated).
Returns:search_params – Default search parameter values along with the provided population and instruments.
Return type:IceCubeLvcSearchParameters
llama.files.coinc_significance.t_overlap(tgw, tnu, search_params)

Integral of the source-time-dependent part of the likelihood integral (Eq. 5) finding the probability of getting tgw and tnu (the detection times of the gravitational wave trigger and neutrino trigger, respectively) given the specified search_params. Factors out from the rest of Eq. 5.