icecube_tools.point_source_likelihood.energy_likelihood module
- class icecube_tools.point_source_likelihood.energy_likelihood.DataDrivenBackgroundEnergyLikelihood(period, bins: Sequence[float] | None = None)
Bases:
MarginalisedEnergyLikelihoodEnergy likelihood for background obtained by making a distribution from the reconstructed energies. Data is mostly background. No spectral index is assumed.
- make_hist()
Create pdf-histograms
- sample(dec, seed=42)
Sample from pdfs :param dec: np.ndarray of declinations of events :return: Samples drawn from the pdfs of corresponding declination bin
- class icecube_tools.point_source_likelihood.energy_likelihood.MarginalisedEnergyLikelihood
Bases:
ABCAbstract base class for the marginalised energy likelihood.
L = int d Etrue P(Ereco | Etrue) P(Etrue | index) = P(Ereco | index).
- class icecube_tools.point_source_likelihood.energy_likelihood.MarginalisedEnergyLikelihood2021(index_list, path, fname, src_dec, ftype='h5', min_index=1.5, max_index=4.0, min_E=100.0, max_E=1000000000.0, min_sind=-0.1, max_sind=1.0, Ebins=50)
Bases:
MarginalisedEnergyLikelihoodCompute the marginalised energy likelihood by reading in the provided IRF data of 2021. Creates instances of MarginalisedEnergyLikelihoodFromSimFixedIndex (slightly copied from MarginalisedEnergyLikelihoodFromSim but with different interpolating) for each given index.
- calc_loglike(energies, index)
Function intended for testing only.
- class icecube_tools.point_source_likelihood.energy_likelihood.MarginalisedEnergyLikelihoodBraun2008(energy_list, pdf_list, index_list)
Bases:
MarginalisedEnergyLikelihoodCompute the marginalised enegry likelihood using Figure 4 in Braun+2008.
- class icecube_tools.point_source_likelihood.energy_likelihood.MarginalisedEnergyLikelihoodFixed(energy, min_index=1.5, max_index=4.0, min_E=100.0, max_E=1000000000.0, min_sind=-0.1, max_sind=1.0, Ebins=50)
Bases:
MarginalisedEnergyLikelihoodCompute the marginalised energy likelihood for a fixed case based on a simulation. Eg. P(E | atmos + diffuse astro).
- class icecube_tools.point_source_likelihood.energy_likelihood.MarginalisedEnergyLikelihoodFromSim(energy, dec, sim_index=1.5, min_index=1.5, max_index=4.0, min_E=100.0, max_E=1000000000.0, min_sind=-0.1, max_sind=1.0, Ebins=50)
Bases:
MarginalisedEnergyLikelihoodCompute the marginalised energy likelihood by using a simulation of a large number of reconstructed muon neutrino tracks.
- set_src_dec(src_dec)
Set the source declination in private variable Precompute likelihood distributions
- class icecube_tools.point_source_likelihood.energy_likelihood.MarginalisedEnergyLikelihoodFromSimFixedIndex(energy, dec, sim_index, src_dec=0.0, min_E=100.0, max_E=1000000000.0, min_sind=-0.1, max_sind=1.0, Ebins=50)
Bases:
MarginalisedEnergyLikelihoodCopied from MarginalisedEnergyLikelihoodFromSim but without the interpolating
- property src_dec
- class icecube_tools.point_source_likelihood.energy_likelihood.MarginalisedIntegratedEnergyLikelihood(period: str, reco_bins: ndarray, min_index: float = 1.5, max_index: float = 4.0)
Bases:
MarginalisedEnergyLikelihoodCalculates energy likelihood by integration rather than simulation.
- static integrated_power_law(loge_low, loge_high, index)
Integrates power law :param loge_low: float or np.ndarray of upper integration bound(s) :param loge_high: float or np.ndarray of lower integration bound(s) :param index: spectral index :return: Integrated power law, float or np.ndarray
- p_det_above_threshold(Etrue, dec)
Calculate probability of an event with Etrue being reconstructed above and below given thresholds, which are provided by the data and are declination dependent.
- static power_law_loge(loge, index)
Evaluated power law :param loge: Logarithmic energy, base 10 :param index: Spectral index :return: Evaluated power law
- icecube_tools.point_source_likelihood.energy_likelihood.read_input_from_file(filename)
Helper function to read in data digitized from plots.
- icecube_tools.point_source_likelihood.energy_likelihood.reweight_spectrum(energies, sim_index, new_index, bins=1000)
Use energies from a simulation with a harder spectral index for efficiency.
The spectrum is then resampled from the weighted histogram
- Parameters:
energies – Energies to be reiweghted.
- Sim_index:
Spectral index of the simulation.
- New_index:
Spectral index to reweight to.