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

digraph "llama.files.coinc_significance.opa.CoincSignificanceI3Lvc" { charset="utf-8" splines=ortho bgcolor=none margin=0 rankdir=LR "llama.files.coinc_significance.opa.CoincSignificanceI3Lvc" [label=<{{<B>CoincSignificanceI3Lvc</B>|<I>significance_lvc-i3.json</I>|JSONFile}}>, shape="record", style=filled, target=_top, URL="/llama.files.coinc_significance.opa.html#llama.files.coinc_significance.opa.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.opa.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.gracedb.PAstro" -> "llama.files.coinc_significance.opa.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.i3.json.IceCubeNeutrinoList" -> "llama.files.coinc_significance.opa.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.lvc_skymap.LvcDistancesJson" -> "llama.files.coinc_significance.opa.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.opa.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.skymap_info.SkymapInfo" -> "llama.files.coinc_significance.opa.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.opa.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.opa.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.opa.CoincSignificanceI3Lvc'>,)
TIMEOUT = 600
UR_DEPENDENCIES = (<class 'llama.files.skymap_info.SkymapInfo'>, <class 'llama.files.lvc_skymap.LvcSkymapFits'>, <class 'llama.files.gracedb.LVCGraceDbEventData'>, <class 'llama.files.lvc_skymap.LvcDistancesJson'>, <class 'llama.files.gracedb.PAstro'>, <class 'llama.files.i3.json.IceCubeNeutrinoList'>, <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.skymap_info.SkymapInfo'>: ImmutableDict({}), <class 'llama.files.i3.json.IceCubeNeutrinoList'>: 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({})})})
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

digraph "llama.files.coinc_significance.opa.RctSlkLmaCoincSignificanceI3Lvc" { charset="utf-8" splines=ortho bgcolor=none margin=0 rankdir=LR "llama.files.coinc_significance.opa.CoincSignificanceI3Lvc" [label=<{{<B>CoincSignificanceI3Lvc</B>|<I>significance_lvc-i3.json</I>|JSONFile}}>, shape="record", style=filled, target=_top, URL="/llama.files.coinc_significance.opa.html#llama.files.coinc_significance.opa.CoincSignificanceI3Lvc", fillcolor="#cccccc"]; "llama.files.coinc_significance.opa.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.opa.html#llama.files.coinc_significance.opa.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.opa.CoincSignificanceI3Lvc" -> "llama.files.coinc_significance.opa.RctSlkLmaCoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.gracedb.LVCGraceDbEventData" -> "llama.files.coinc_significance.opa.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.gracedb.PAstro" -> "llama.files.coinc_significance.opa.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.i3.json.IceCubeNeutrinoList" -> "llama.files.coinc_significance.opa.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.lvc_skymap.LvcDistancesJson" -> "llama.files.coinc_significance.opa.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.opa.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.skymap_info.SkymapInfo" -> "llama.files.coinc_significance.opa.CoincSignificanceI3Lvc" [arrowtail="none", color="red", ]; "llama.files.skymap_info.SkymapInfo" -> "llama.files.coinc_significance.opa.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.opa.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.opa.RctSlkLmaCoincSignificanceI3Lvc to be generated.

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.gracedb.LVCGraceDbEventData'>, <class 'llama.files.lvc_skymap.LvcDistancesJson'>, <class 'llama.files.gracedb.PAstro'>, <class 'llama.files.i3.json.IceCubeNeutrinoList'>, <class 'llama.files.lvc_skymap.LvcSkymapHdf5'>, <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)

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

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)

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.

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)

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.

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.