Detector model interface

In addition to the neutrino data itself, the IceCube collaboration provides some information about the detector that can be useful to construct simple simulations and fits. For example, the effective area is needed to connect between incident neutrino fluxes and expected number of events in the detector.

icecube_tools also provides an quick interface to loading and working with such information. This is a work in progress and only certain datasets are currently implemented, such as the ones demonstrated below.

[1]:
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.colors import LogNorm

from icecube_tools.utils.data import IceCubeData
from icecube_tools.detector.detector import IceCube, TimeDependentIceCube

The IceCubeData class can be used for a quick check of the available datasets on the IceCube website.

[2]:
my_data = IceCubeData()
my_data.datasets
[2]:
['2021_03-all_data_releases.zip',
 '20080911_AMANDA_7_Year_Data.zip',
 '20090521_IceCube-22_Solar_WIMP_Data.zip',
 '20110905_IceCube-40_String_Data.zip',
 '20131121_Search_for_contained_neutrino_events_at_energies_above_30_TeV_in_2_years_of_data.zip',
 '20150127_IceCube_Oscillations%20_3_years_muon_neutrino_disappearance_data.zip',
 '20150219_Search_for_contained_neutrino_events_at_energies_greater_than_1_TeV_in_2_years_of_data.zip',
 '20150619_IceCube-59%20_Search_for_point_sources_using_muon_events.zip',
 '20150820_Astrophysical_muon_neutrino_flux_in_the_northern_sky_with_2_years_of_IceCube_data.zip',
 '20151021_Observation_of_Astrophysical_Neutrinos_in_Four_Years_of_IceCube_Data.zip',
 '20160105_The_79-string_IceCube_search_for_dark_matter.zip',
 '20160624_Search_for_sterile_neutrinos_with_one_year_of_IceCube_data.zip',
 '20161101_Search_for_point_sources_with_first_year_of_IC86_data.zip',
 '20161115_A_combined_maximum-likelihood_analysis_of_the_astrophysical_neutrino_flux.zip',
 '20180213_Measurement_of_atmospheric_neutrino_oscillations_with_three_years_of_data_from_the_full_sky.zip',
 '20180712_IceCube_catalog_of_alert_events_up_through_IceCube-170922A.zip',
 '20180712_IceCube_data_from_2008_to_2017_related_to_analysis_of_TXS_0506+056.zip',
 '20181018_All-sky_point-source_IceCube_data%20_years_2010-2012.zip',
 '20190515_Three-year_high-statistics_neutrino_oscillation_samples.zip',
 '20190904_Bayesian_posterior_for_IceCube_7-year_point-source_search_with_neutrino-count_statistics.zip',
 '20200227_All-sky_point-source_IceCube_data%20_years_2012-2015.zip',
 '20200421_IceCube_Upgrade_Neutrino_Monte_Carlo_Simulation.zip',
 '20200514_South_Pole_ice_temperature.zip',
 '20210126_PS-IC40-IC86_VII.zip',
 '20210310_IceCube_data_for_the_first_Glashow_resonance_candidate.zip',
 '20211217_HESE-7-5-year-data.zip',
 '20220201_Density_of_GeV_muons_in_air_showers_measured_with_IceTop.zip',
 '20220902_Evidence_for_neutrino_emission_from_the_nearby_active_galaxy_NGC_1068_data.zip',
 '20220913_Evidence_for_neutrino_emission_from_the_nearby_active_galaxy_NGC_1068_data.zip',
 '20221028_Observation_of_High-Energy_Neutrinos_from_the_Galactic_Plane.zip',
 '20221208_Observation_of_High-Energy_Neutrinos_from_the_Galactic_Plane.zip',
 '20230424_Observation_of_High-Energy_Neutrinos_from_the_Galactic_Plane.zip',
 'ic22-solar-wimp-histograms.zip']

Effective area, angular resolution and energy resolution of 10 year data

We can now use the date string to identify certain datasets. Let’s say we want to use the effective area and angular resolution from the 20210126 dataset. If you don’t already have the dataset downloaded, icecube_tools will do this for you automatically. This 10 year data release provides more detailed IRF data.

We restrict our examples to the Northern hemisphere.

The simpler, earlier versions are explained afterwards.

The format of the effective area has not changed, though.

For this latest data set, we have different detector configurations available, as they changed through time (the detector was expanded). We can invoke a chosen configuration throught the second argument in EffectiveArea.from_dataset() for this particular data set only.

[3]:
from icecube_tools.detector.r2021 import R2021IRF
from icecube_tools.detector.effective_area import EffectiveArea
[4]:
my_aeff = EffectiveArea.from_dataset("20210126", "IC86_II")
20210126_PS-IC40-IC86_VII.zip: 0%| | 0/39848048 [00:00<?, ?it/s]

</pre>

20210126_PS-IC40-IC86_VII.zip: 0%| | 0/39848048 [00:00<?, ?it/s]

end{sphinxVerbatim}

20210126_PS-IC40-IC86_VII.zip: 0%| | 0/39848048 [00:00<?, ?it/s]

20210126_PS-IC40-IC86_VII.zip: 3%|▎ | 1048576/39848048 [00:00&lt;00:35, 1098727.14it/s]

</pre>

20210126_PS-IC40-IC86_VII.zip: 3%|▎ | 1048576/39848048 [00:00<00:35, 1098727.14it/s]

end{sphinxVerbatim}

20210126_PS-IC40-IC86_VII.zip: 3%|▎ | 1048576/39848048 [00:00<00:35, 1098727.14it/s]

20210126_PS-IC40-IC86_VII.zip: 5%|▌ | 2097152/39848048 [00:01&lt;00:18, 1992448.96it/s]

</pre>

20210126_PS-IC40-IC86_VII.zip: 5%|▌ | 2097152/39848048 [00:01<00:18, 1992448.96it/s]

end{sphinxVerbatim}

20210126_PS-IC40-IC86_VII.zip: 5%|▌ | 2097152/39848048 [00:01<00:18, 1992448.96it/s]

20210126_PS-IC40-IC86_VII.zip: 8%|▊ | 3145728/39848048 [00:01&lt;00:12, 2972324.29it/s]

</pre>

20210126_PS-IC40-IC86_VII.zip: 8%|▊ | 3145728/39848048 [00:01<00:12, 2972324.29it/s]

end{sphinxVerbatim}

20210126_PS-IC40-IC86_VII.zip: 8%|▊ | 3145728/39848048 [00:01<00:12, 2972324.29it/s]

20210126_PS-IC40-IC86_VII.zip: 11%|█ | 4194304/39848048 [00:01&lt;00:08, 4026210.00it/s]

</pre>

20210126_PS-IC40-IC86_VII.zip: 11%|█ | 4194304/39848048 [00:01<00:08, 4026210.00it/s]

end{sphinxVerbatim}

20210126_PS-IC40-IC86_VII.zip: 11%|█ | 4194304/39848048 [00:01<00:08, 4026210.00it/s]

20210126_PS-IC40-IC86_VII.zip: 16%|█▌ | 6291456/39848048 [00:01&lt;00:05, 6651607.34it/s]

</pre>

20210126_PS-IC40-IC86_VII.zip: 16%|█▌ | 6291456/39848048 [00:01<00:05, 6651607.34it/s]

end{sphinxVerbatim}

20210126_PS-IC40-IC86_VII.zip: 16%|█▌ | 6291456/39848048 [00:01<00:05, 6651607.34it/s]

20210126_PS-IC40-IC86_VII.zip: 21%|██ | 8388608/39848048 [00:01&lt;00:03, 9077886.07it/s]

</pre>

20210126_PS-IC40-IC86_VII.zip: 21%|██ | 8388608/39848048 [00:01<00:03, 9077886.07it/s]

end{sphinxVerbatim}

20210126_PS-IC40-IC86_VII.zip: 21%|██ | 8388608/39848048 [00:01<00:03, 9077886.07it/s]

20210126_PS-IC40-IC86_VII.zip: 29%|██▉ | 11534336/39848048 [00:01&lt;00:02, 13068057.70it/s]

</pre>

20210126_PS-IC40-IC86_VII.zip: 29%|██▉ | 11534336/39848048 [00:01<00:02, 13068057.70it/s]

end{sphinxVerbatim}

20210126_PS-IC40-IC86_VII.zip: 29%|██▉ | 11534336/39848048 [00:01<00:02, 13068057.70it/s]

20210126_PS-IC40-IC86_VII.zip: 37%|███▋ | 14680064/39848048 [00:01&lt;00:01, 16689198.78it/s]

</pre>

20210126_PS-IC40-IC86_VII.zip: 37%|███▋ | 14680064/39848048 [00:01<00:01, 16689198.78it/s]

end{sphinxVerbatim}

20210126_PS-IC40-IC86_VII.zip: 37%|███▋ | 14680064/39848048 [00:01<00:01, 16689198.78it/s]

20210126_PS-IC40-IC86_VII.zip: 50%|████▉ | 19922944/39848048 [00:02&lt;00:00, 22773136.24it/s]

</pre>

20210126_PS-IC40-IC86_VII.zip: 50%|████▉ | 19922944/39848048 [00:02<00:00, 22773136.24it/s]

end{sphinxVerbatim}

20210126_PS-IC40-IC86_VII.zip: 50%|████▉ | 19922944/39848048 [00:02<00:00, 22773136.24it/s]

20210126_PS-IC40-IC86_VII.zip: 58%|█████▊ | 23068672/39848048 [00:02&lt;00:00, 21927518.74it/s]

</pre>

20210126_PS-IC40-IC86_VII.zip: 58%|█████▊ | 23068672/39848048 [00:02<00:00, 21927518.74it/s]

end{sphinxVerbatim}

20210126_PS-IC40-IC86_VII.zip: 58%|█████▊ | 23068672/39848048 [00:02<00:00, 21927518.74it/s]

20210126_PS-IC40-IC86_VII.zip: 68%|██████▊ | 27262976/39848048 [00:02&lt;00:00, 25648950.38it/s]

</pre>

20210126_PS-IC40-IC86_VII.zip: 68%|██████▊ | 27262976/39848048 [00:02<00:00, 25648950.38it/s]

end{sphinxVerbatim}

20210126_PS-IC40-IC86_VII.zip: 68%|██████▊ | 27262976/39848048 [00:02<00:00, 25648950.38it/s]

20210126_PS-IC40-IC86_VII.zip: 76%|███████▋ | 30408704/39848048 [00:02&lt;00:00, 25622823.46it/s]

</pre>

20210126_PS-IC40-IC86_VII.zip: 76%|███████▋ | 30408704/39848048 [00:02<00:00, 25622823.46it/s]

end{sphinxVerbatim}

20210126_PS-IC40-IC86_VII.zip: 76%|███████▋ | 30408704/39848048 [00:02<00:00, 25622823.46it/s]

20210126_PS-IC40-IC86_VII.zip: 87%|████████▋ | 34603008/39848048 [00:02&lt;00:00, 27921399.13it/s]

</pre>

20210126_PS-IC40-IC86_VII.zip: 87%|████████▋ | 34603008/39848048 [00:02<00:00, 27921399.13it/s]

end{sphinxVerbatim}

20210126_PS-IC40-IC86_VII.zip: 87%|████████▋ | 34603008/39848048 [00:02<00:00, 27921399.13it/s]

20210126_PS-IC40-IC86_VII.zip: 95%|█████████▍| 37748736/39848048 [00:02&lt;00:00, 27215067.02it/s]

</pre>

20210126_PS-IC40-IC86_VII.zip: 95%|█████████▍| 37748736/39848048 [00:02<00:00, 27215067.02it/s]

end{sphinxVerbatim}

20210126_PS-IC40-IC86_VII.zip: 95%|█████████▍| 37748736/39848048 [00:02<00:00, 27215067.02it/s]

20210126_PS-IC40-IC86_VII.zip: 100%|██████████| 39848048/39848048 [00:02&lt;00:00, 14235579.40it/s]

</pre>

20210126_PS-IC40-IC86_VII.zip: 100%|██████████| 39848048/39848048 [00:02<00:00, 14235579.40it/s]

end{sphinxVerbatim}

20210126_PS-IC40-IC86_VII.zip: 100%|██████████| 39848048/39848048 [00:02<00:00, 14235579.40it/s]


[5]:
fig, ax = plt.subplots()
h = ax.pcolor(
    my_aeff.true_energy_bins, my_aeff.cos_zenith_bins, my_aeff.values.T, norm=LogNorm()
)
cbar = fig.colorbar(h)
ax.set_xscale("log")
ax.set_xlim(1e2, 1e9)
ax.set_xlabel("True energy [GeV]")
ax.set_ylabel("cos(zenith)")
cbar.set_label("Aeff [m$^2$]")
../_images/notebooks_detector_model_7_0.png

Energy resolution

Angular resolution depends on the energy resolution. The paper accompaying the data release explains the dependency: For each bin of true energy and declination a certain amount of events is simulated. These are sorted first into bins of reconstructed energy. These are then reconstructed in terms of PSF(the kinematic angle between the incoming neutrino and the outgoing muon after a collision) and actual angular error. Data is given as fractional counts in the bin \((E_\mathrm{reco}, \mathrm{PSF}, \mathrm{ang\_err})\) of all counts in bin (E_:nbsphinx-math:mathrm{true}, \delta). This is nothing but a histogram, corresponding to a probability of finding an event with given true energy and true declination: \(p(E_\mathrm{reco}, \mathrm{PSF}, \mathrm{ang\_err} \vert E_\mathrm{true}, \delta)\).

We find the energy resolution, i.e. \(p(E_\mathrm{reco} \vert E_\mathrm{true}, \delta)\), by summing over (marginalising over) all entries of \(\mathrm{PSF}, \mathrm{ang\_err}\) for the reconstructed energy we are interested in.

The R2021IRF()class is able to do so:

[6]:
irf = R2021IRF.from_period("IC86_II")
[7]:
fig, ax = plt.subplots()
idx = [0, 3, 6, 9, 12]
# plotting Ereco for different true energy bins, the declination bin here is always from +10 to +90 degrees.
for i in idx:

    x = np.linspace(*irf.reco_energy[i, 2].support(), num=1000)
    ax.plot(x, irf.reco_energy[i, 2].pdf(x), label=irf.true_energy_bins[i])
ax.legend()
[7]:
<matplotlib.legend.Legend at 0x7ff929f1d6d0>
../_images/notebooks_detector_model_10_1.png

This should look like the Fig.4, left panel, of the mentioned paper, the y-axis is only scaled by a constant factor, corresponding to a properly normalised distribution. On this topic, it should be mentioned that the quantities distributed according to these histograms are the logarithms of reconstructed energy, PSF and angular uncertainty! Accordingly, logarithmic quantities are drawn as samples and only exponentiated for calculations and final data products.

Etrue vs. Ereco

Below, a colormap of the conditional probability \(P(E_\mathrm{reco} \vert E_\mathrm{true})\) is shown. It is normalised for each Etrue bin.

[8]:
etrue = irf.true_energy_bins
ereco = np.linspace(1, 8, num=100)
[9]:
vals = np.zeros((etrue.size - 1, ereco.size - 1))
for c, et in enumerate(etrue[:-1]):
    vals[c, :] = irf.reco_energy[c, 2].pdf(ereco[:-1])
[10]:
fig, ax = plt.subplots()
h = ax.pcolor(np.power(10, etrue), np.power(10, ereco), vals.T, norm=LogNorm())
cbar = fig.colorbar(h)
ax.set_xlim(1e2, 1e9)
ax.set_ylim(1e1, 1e8)
ax.set_xscale("log")
ax.set_yscale("log")
ax.set_xlabel("True energy [GeV]")
ax.set_ylabel("Reconstructed energy [GeV]")
cbar.set_label("P(Ereco|Etrue)")
../_images/notebooks_detector_model_15_0.png

Angular resolution

Now that we have the reconstructed energy for an event with some \(E_\mathrm{true}, \delta\), we can proceed in finding the angular resolution.

First, from the given “history” of the event, we sample the matching distribution/histogram of \(\mathrm{PSF}\), again by marginalising over the uninteresting quantities, in this case only \(\mathrm{ang\_err}\). We thus sample a value of \(\mathrm{PSF}\), to whom a distribution of \(\mathrm{ang\_err}\) belongs, which we subsequently sample. This is now to be understood as a cone of a given angular radius, within which the true arrival direction lies with a probability of 50%.

For both steps, the histograms are created by R2021IRF() when instructed to do so: we pass a tuple of vectors (ra, dec) in radians and a vector of \(\log_{10}(E_\mathrm{true})\) to the method sample(). Returned are sampled ra, dec (both in radians), angular error (68%, in degrees) and reconstructed energy in GeV.

[11]:
irf.sample((np.full(4, np.pi), np.full(4, np.pi / 4)), np.full(4, 2))
[11]:
(array([3.15403423, 3.13035278, 3.14113431, 3.10152851]),
 array([0.80411628, 0.80839959, 0.77166036, 0.78062339]),
 array([0.81314284, 1.18484801, 0.8403489 , 1.56147217]),
 array([ 638.4537496 , 1580.39481862,  985.08856794,  837.29002682]))

If you are interested in the actual distributions, they are accessible through the attributes R2021IRF().reco_energy (2d numpy array storing scipy.stats.rv_histogram instances) and R2021IRF().maginal_pdf_psf (a modified ditionary class instance, indexed by a chain of keys):

[12]:
etrue_bin = 0
dec_bin = 2
ereco_bin = 10
print(irf.marginal_pdf_psf(etrue_bin, dec_bin, ereco_bin, "bins"))
print(irf.marginal_pdf_psf(etrue_bin, dec_bin, ereco_bin, "pdf"))
[-3.13065092 -2.86582289 -2.60084567 -2.33592241 -2.07109231 -1.80631897
 -1.54136215 -1.27646224 -1.01153023 -0.74666199 -0.48174935 -0.21688286
  0.04805317  0.31281183  0.57772152  0.84267163  1.10754913  1.37235958
  1.63728955  1.90222053  2.1670218 ]
<scipy.stats._continuous_distns.rv_histogram object at 0x7ff9299d10a0>

The same works for marginal_pdf_angerr. The entries are only created once the sample() method needs to. See the class defintion of ddict in icecube_tools.utils.data for more details.

Mean angular uncertainty

We can find the mean angular uncertainty by sampling a large amount of events for different true energies, assuming that the average is sensibly defined as the average of logarithmic quantities.

[13]:
num = 10000
loge = irf.true_energy_bins
mean_uncertainty = np.zeros(loge.shape)
for c, e in enumerate(loge[:-1]):
    _, _, samples, _ = irf.sample(
        (np.full(num, np.pi), np.full(num, np.pi / 4)), np.full(num, e)
    )
    mean_uncertainty[c] = np.power(10, np.average(np.log10(samples)))
mean_uncertainty[-1] = mean_uncertainty[-2]
plt.step(loge, mean_uncertainty, where="post")
plt.xlabel("$\log E_\mathrm{true} / \mathrm{GeV}$")
plt.ylabel("mean angular uncertainty [degrees]")
[13]:
Text(0, 0.5, 'mean angular uncertainty [degrees]')
../_images/notebooks_detector_model_22_1.png

Constructing a detector

A detector used for e.g. simulations can be constructed from angular/energy uncertainties and an effective area:

[14]:
detector = IceCube(my_aeff, irf, irf, "IC86_II")

irf = R2021IRF() is used both as spatial and energy resolution, because it encompasses both types of information and inherits from both classes.

Time dependent detector

We can construct a “meta-detector” spanning multiple data periods through the class TimeDependentIceCube from strings defining the data periods. Alternatively, a

[15]:
tic = TimeDependentIceCube.from_periods("IC86_I", "IC86_II")
tic.detectors
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/icecube_tools/detector/r2021.py:89: RuntimeWarning: divide by zero encountered in log10
  self.dataset[:, 6:-1] = np.log10(self.dataset[:, 6:-1])
Empty true energy bins at: [(0, 0), (1, 0)]
[15]:
{'IC86_I': <icecube_tools.detector.detector.IceCube at 0x7ff929ed2cd0>,
 'IC86_II': <icecube_tools.detector.detector.IceCube at 0x7ff929ef07c0>}

Available periods are

[16]:
TimeDependentIceCube._available_periods
[16]:
['IC40', 'IC59', 'IC79', 'IC86_I', 'IC86_II']

Effective area, angular resolution and energy resolution of earlier releases

Repeating the prodecure for the 20181018 dataset.

[17]:
from icecube_tools.detector.effective_area import EffectiveArea
from icecube_tools.detector.energy_resolution import EnergyResolution
from icecube_tools.detector.angular_resolution import AngularResolution
[18]:
my_aeff = EffectiveArea.from_dataset("20181018")
my_angres = AngularResolution.from_dataset("20181018")
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/icecube_tools/detector/effective_area.py:379: FutureWarning: The 'delim_whitespace' keyword in pd.read_csv is deprecated and will be removed in a future version. Use ``sep='\s+'`` instead
  output = pd.read_csv(
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/icecube_tools/detector/angular_resolution.py:111: FutureWarning: The 'delim_whitespace' keyword in pd.read_csv is deprecated and will be removed in a future version. Use ``sep='\s+'`` instead
  output = pd.read_csv(
[19]:
fig, ax = plt.subplots()
h = ax.pcolor(
    my_aeff.true_energy_bins, my_aeff.cos_zenith_bins, my_aeff.values.T, norm=LogNorm()
)
cbar = fig.colorbar(h)
ax.set_xscale("log")
ax.set_xlabel("True energy [GeV]")
ax.set_ylabel("cos(zenith)")
cbar.set_label("Aeff [m$^2$]")
../_images/notebooks_detector_model_33_0.png
[20]:
fig, ax = plt.subplots()
ax.plot(my_angres.true_energy_values, my_angres.values)
ax.set_xscale("log")
ax.set_xlabel("True energy [GeV]")
ax.set_ylabel("Mean angular error [deg]")
[20]:
Text(0, 0.5, 'Mean angular error [deg]')
../_images/notebooks_detector_model_34_1.png

We can also easily check what datasets are supported by the different detector information classes:

[21]:
EffectiveArea.supported_datasets
[21]:
['20131121', '20150820', '20181018', '20210126']
[22]:
AngularResolution.supported_datasets
[22]:
['20181018']
[23]:
EnergyResolution.supported_datasets
[23]:
['20150820']

If you would like to see some other datasets supported, please feel free to open an issue or contribute your own!

For the 20150820 dataset, for which we also have the energy resolution available…

[24]:
my_aeff = EffectiveArea.from_dataset("20150820")
my_eres = EnergyResolution.from_dataset("20150820")
20150820_Astrophysical_muon_neutrino_flu…: 0%| | 0/43711022 [00:00&lt;?, ?it/s]

</pre>

20150820_Astrophysical_muon_neutrino_flu{ldots}: 0%| | 0/43711022 [00:00<?, ?it/s]

end{sphinxVerbatim}

20150820_Astrophysical_muon_neutrino_flu…: 0%| | 0/43711022 [00:00<?, ?it/s]

20150820_Astrophysical_muon_neutrino_flu…: 2%|▏ | 1048576/43711022 [00:00&lt;00:34, 1227736.42it/s]

</pre>

20150820_Astrophysical_muon_neutrino_flu{ldots}: 2%|▏ | 1048576/43711022 [00:00<00:34, 1227736.42it/s]

end{sphinxVerbatim}

20150820_Astrophysical_muon_neutrino_flu…: 2%|▏ | 1048576/43711022 [00:00<00:34, 1227736.42it/s]

20150820_Astrophysical_muon_neutrino_flu…: 5%|▍ | 2097152/43711022 [00:01&lt;00:18, 2201262.07it/s]

</pre>

20150820_Astrophysical_muon_neutrino_flu{ldots}: 5%|▍ | 2097152/43711022 [00:01<00:18, 2201262.07it/s]

end{sphinxVerbatim}

20150820_Astrophysical_muon_neutrino_flu…: 5%|▍ | 2097152/43711022 [00:01<00:18, 2201262.07it/s]

20150820_Astrophysical_muon_neutrino_flu…: 7%|▋ | 3145728/43711022 [00:01&lt;00:13, 3088516.40it/s]

</pre>

20150820_Astrophysical_muon_neutrino_flu{ldots}: 7%|▋ | 3145728/43711022 [00:01<00:13, 3088516.40it/s]

end{sphinxVerbatim}

20150820_Astrophysical_muon_neutrino_flu…: 7%|▋ | 3145728/43711022 [00:01<00:13, 3088516.40it/s]

20150820_Astrophysical_muon_neutrino_flu…: 10%|▉ | 4194304/43711022 [00:01&lt;00:09, 4207028.52it/s]

</pre>

20150820_Astrophysical_muon_neutrino_flu{ldots}: 10%|▉ | 4194304/43711022 [00:01<00:09, 4207028.52it/s]

end{sphinxVerbatim}

20150820_Astrophysical_muon_neutrino_flu…: 10%|▉ | 4194304/43711022 [00:01<00:09, 4207028.52it/s]

20150820_Astrophysical_muon_neutrino_flu…: 14%|█▍ | 6291456/43711022 [00:01&lt;00:05, 6654563.18it/s]

</pre>

20150820_Astrophysical_muon_neutrino_flu{ldots}: 14%|█▍ | 6291456/43711022 [00:01<00:05, 6654563.18it/s]

end{sphinxVerbatim}

20150820_Astrophysical_muon_neutrino_flu…: 14%|█▍ | 6291456/43711022 [00:01<00:05, 6654563.18it/s]

20150820_Astrophysical_muon_neutrino_flu…: 19%|█▉ | 8388608/43711022 [00:01&lt;00:03, 8972665.38it/s]

</pre>

20150820_Astrophysical_muon_neutrino_flu{ldots}: 19%|█▉ | 8388608/43711022 [00:01<00:03, 8972665.38it/s]

end{sphinxVerbatim}

20150820_Astrophysical_muon_neutrino_flu…: 19%|█▉ | 8388608/43711022 [00:01<00:03, 8972665.38it/s]

20150820_Astrophysical_muon_neutrino_flu…: 26%|██▋ | 11534336/43711022 [00:01&lt;00:02, 12969338.16it/s]

</pre>

20150820_Astrophysical_muon_neutrino_flu{ldots}: 26%|██▋ | 11534336/43711022 [00:01<00:02, 12969338.16it/s]

end{sphinxVerbatim}

20150820_Astrophysical_muon_neutrino_flu…: 26%|██▋ | 11534336/43711022 [00:01<00:02, 12969338.16it/s]

20150820_Astrophysical_muon_neutrino_flu…: 34%|███▎ | 14680064/43711022 [00:01&lt;00:01, 16943208.95it/s]

</pre>

20150820_Astrophysical_muon_neutrino_flu{ldots}: 34%|███▎ | 14680064/43711022 [00:01<00:01, 16943208.95it/s]

end{sphinxVerbatim}

20150820_Astrophysical_muon_neutrino_flu…: 34%|███▎ | 14680064/43711022 [00:01<00:01, 16943208.95it/s]

20150820_Astrophysical_muon_neutrino_flu…: 43%|████▎ | 18874368/43711022 [00:01&lt;00:01, 22344580.39it/s]

</pre>

20150820_Astrophysical_muon_neutrino_flu{ldots}: 43%|████▎ | 18874368/43711022 [00:01<00:01, 22344580.39it/s]

end{sphinxVerbatim}

20150820_Astrophysical_muon_neutrino_flu…: 43%|████▎ | 18874368/43711022 [00:01<00:01, 22344580.39it/s]

20150820_Astrophysical_muon_neutrino_flu…: 53%|█████▎ | 23068672/43711022 [00:02&lt;00:00, 26830405.65it/s]

</pre>

20150820_Astrophysical_muon_neutrino_flu{ldots}: 53%|█████▎ | 23068672/43711022 [00:02<00:00, 26830405.65it/s]

end{sphinxVerbatim}

20150820_Astrophysical_muon_neutrino_flu…: 53%|█████▎ | 23068672/43711022 [00:02<00:00, 26830405.65it/s]

20150820_Astrophysical_muon_neutrino_flu…: 62%|██████▏ | 27262976/43711022 [00:02&lt;00:00, 29028170.79it/s]

</pre>

20150820_Astrophysical_muon_neutrino_flu{ldots}: 62%|██████▏ | 27262976/43711022 [00:02<00:00, 29028170.79it/s]

end{sphinxVerbatim}

20150820_Astrophysical_muon_neutrino_flu…: 62%|██████▏ | 27262976/43711022 [00:02<00:00, 29028170.79it/s]

20150820_Astrophysical_muon_neutrino_flu…: 74%|███████▍ | 32505856/43711022 [00:02&lt;00:00, 34983511.06it/s]

</pre>

20150820_Astrophysical_muon_neutrino_flu{ldots}: 74%|███████▍ | 32505856/43711022 [00:02<00:00, 34983511.06it/s]

end{sphinxVerbatim}

20150820_Astrophysical_muon_neutrino_flu…: 74%|███████▍ | 32505856/43711022 [00:02<00:00, 34983511.06it/s]

20150820_Astrophysical_muon_neutrino_flu…: 84%|████████▍ | 36700160/43711022 [00:02&lt;00:00, 34115280.67it/s]

</pre>

20150820_Astrophysical_muon_neutrino_flu{ldots}: 84%|████████▍ | 36700160/43711022 [00:02<00:00, 34115280.67it/s]

end{sphinxVerbatim}

20150820_Astrophysical_muon_neutrino_flu…: 84%|████████▍ | 36700160/43711022 [00:02<00:00, 34115280.67it/s]

20150820_Astrophysical_muon_neutrino_flu…: 94%|█████████▎| 40894464/43711022 [00:02&lt;00:00, 35163456.24it/s]

</pre>

20150820_Astrophysical_muon_neutrino_flu{ldots}: 94%|█████████▎| 40894464/43711022 [00:02<00:00, 35163456.24it/s]

end{sphinxVerbatim}

20150820_Astrophysical_muon_neutrino_flu…: 94%|█████████▎| 40894464/43711022 [00:02<00:00, 35163456.24it/s]

20150820_Astrophysical_muon_neutrino_flu…: 100%|██████████| 43711022/43711022 [00:02&lt;00:00, 16648789.08it/s]

</pre>

20150820_Astrophysical_muon_neutrino_flu{ldots}: 100%|██████████| 43711022/43711022 [00:02<00:00, 16648789.08it/s]

end{sphinxVerbatim}

20150820_Astrophysical_muon_neutrino_flu…: 100%|██████████| 43711022/43711022 [00:02<00:00, 16648789.08it/s]


[25]:
fig, ax = plt.subplots()
h = ax.pcolor(
    my_aeff.true_energy_bins, my_aeff.cos_zenith_bins, my_aeff.values.T, norm=LogNorm()
)
cbar = fig.colorbar(h)
ax.set_xscale("log")
ax.set_xlabel("True energy [GeV]")
ax.set_ylabel("cos(zenith)")
cbar.set_label("Aeff [m$^2$]")
../_images/notebooks_detector_model_41_0.png
[26]:
fig, ax = plt.subplots()
h = ax.pcolor(
    my_eres.true_energy_bins, my_eres.reco_energy_bins, my_eres.values.T, norm=LogNorm()
)
cbar = fig.colorbar(h)
ax.set_xscale("log")
ax.set_yscale("log")
ax.set_xlabel("True energy [GeV]")
ax.set_ylabel("Reconstructed energy [GeV]")
cbar.set_label("P(Ereco|Etrue)")
../_images/notebooks_detector_model_42_0.png

Detector model

We can bring together these properties to make a detector model that can be used for simulations.

[27]:
from icecube_tools.detector.detector import IceCube
[28]:
my_detector = IceCube(my_aeff, my_eres, my_angres)
[ ]: