Simulation

We can bring together the detector and source modelling to calculate the expected number of neutrino events and run simulations.

[1]:
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.patches import Circle
from matplotlib.collections import PatchCollection
import h5py

Defining a source and detector model

[2]:
from icecube_tools.detector.effective_area import EffectiveArea
from icecube_tools.detector.energy_resolution import EnergyResolution
from icecube_tools.detector.angular_resolution import AngularResolution
from icecube_tools.detector.detector import IceCube
from icecube_tools.source.flux_model import PowerLawFlux
from icecube_tools.source.source_model import DiffuseSource, PointSource
from icecube_tools.detector.r2021 import R2021IRF
from icecube_tools.utils.data import SimEvents
[3]:
# Define detector (see detector model notebook for more info)
aeff = EffectiveArea.from_dataset("20210126", "IC86_II")
irf = R2021IRF.from_period("IC86_II")
# IceCube expects an instance of EffectiveAerea, AngularResolution and
# EnergyResolution, optionally the period (here IC86_I)
# R2021IRF inherits from AngularResolution and EnergyResolution
# just to be able to be used as both
detector = IceCube(aeff, irf, irf, "IC86_II")
[4]:
# Define simple sources (see source model notebook for more info)
diff_flux_norm = 3e-21  # Flux normalisation in units of GeV^-1 cm^-2 s^-1 sr^-1
point_flux_norm = 5e-19  # Flux normalisation in units of GeV^-1 cm^-2 s^-1
norm_energy = 1e5  # Energy of normalisation in units of GeV
min_energy = 1e2  # GeV
max_energy = 1e8  # GeV

diff_power_law = PowerLawFlux(diff_flux_norm, norm_energy, 3.7, min_energy, max_energy)
diff_source = DiffuseSource(diff_power_law, z=0.0)

point_power_law = PowerLawFlux(
    point_flux_norm, norm_energy, 2.5, min_energy, max_energy
)
point_source = PointSource(point_power_law, z=0.0, coord=(np.pi, np.deg2rad(30)))
sources = [diff_source, point_source]

Expected number of neutrino events

Sometimes we just want to predict the number of events from sources in a detector without specifying all detector properties or running a simulation. We can do this with the NeutrinoCalculator. For this, we just need a source list and an effective area.

[5]:
from icecube_tools.neutrino_calculator import NeutrinoCalculator, PhiSolver
[6]:
nu_calc = NeutrinoCalculator(sources, aeff)
nu_calc(
    time=1,  # years
    min_energy=min_energy,
    max_energy=max_energy,  # energy range
    min_cosz=-1,
    max_cosz=1,
)  # cos(zenith) range
[6]:
[185.18577999563075, 24.514085562926446]

The calculator returns a list of expected neutrino event numbers, one for each source.

We may also want to do the inverse, and find the PointSource flux normalisation corresponding to an expected number of events. For this there is the PhiSolver class.

[7]:
phi_solver = PhiSolver(
    aeff, norm_energy, min_energy, max_energy, time=1, min_cosz=-1, max_cosz=1
)
phi_norm = phi_solver(Nnu=15, dec=-30, index=2.0)  # degrees  # spectral index
phi_norm  # GeV^-1 cm^-2 s^-1
[7]:
1.1263915034742591e-17

Set up and run simulation

[8]:
from icecube_tools.simulator import Simulator, TimeDependentSimulator
[9]:
# Set up simulation
simulator = Simulator(sources, detector, "IC86_II")
simulator.time = 1  # year

# Run simulation
simulator.run(show_progress=True, seed=42)
Resetting rng
Sampling: 100%|██████████| 204/204 [00:02<00:00, 74.21it/s]

This way, the simulator calculates the expected number of neutrinos from these sources given the observation period, effective area and relevant source properties. We note that we could also run a simulation for a fixed number of neutrinos if we want, simply by passing the optional argument N to simulator.run().

[10]:
simulator.write_to_h5("h5_test.hdf5", sources)
[11]:
simulator.arrival_energy
[11]:
{'IC86_II': array([7.14210028e+02, 3.23388666e+02, 1.80111166e+03, 1.98115885e+02,
        2.30965248e+02, 1.72795141e+02, 5.17489092e+03, 4.40330898e+02,
        1.55148412e+03, 2.65048351e+02, 1.58823383e+02, 1.15940566e+03,
        1.51603933e+02, 1.75155020e+02, 1.03268577e+02, 4.28410295e+02,
        8.98147427e+02, 7.58773870e+02, 6.71234648e+02, 2.58801769e+03,
        3.14632116e+02, 5.38505911e+02, 3.97374350e+02, 1.62723177e+03,
        2.67854713e+02, 2.70530741e+02, 7.70529405e+02, 3.11075540e+03,
        1.81460670e+02, 5.40258039e+02, 1.64259728e+03, 5.75003650e+02,
        1.26075824e+02, 4.85847409e+02, 2.82589224e+02, 7.96531291e+02,
        1.82201472e+02, 2.92805711e+02, 3.46598724e+03, 1.65938649e+03,
        3.55002367e+02, 6.77278871e+02, 6.13118787e+02, 6.89669017e+02,
        1.89599680e+02, 3.29083688e+02, 7.65201578e+02, 5.92951977e+02,
        1.23201044e+02, 1.89469848e+02, 1.13214053e+03, 3.01162303e+02,
        3.64580129e+02, 8.15601770e+02, 4.70529693e+02, 2.02309186e+03,
        2.05857939e+02, 4.91791232e+02, 2.87311325e+03, 8.21048861e+02,
        3.91184938e+02, 4.30137055e+02, 5.29922706e+02, 1.00996620e+03,
        2.38449683e+02, 1.02752455e+02, 4.23989510e+02, 1.05066750e+03,
        1.95056355e+02, 1.07369025e+03, 2.70848742e+02, 3.18249906e+02,
        1.71764214e+03, 1.59613947e+02, 1.37478269e+02, 1.94141437e+02,
        4.18211025e+02, 1.27672800e+02, 1.08949260e+02, 1.63544282e+02,
        6.85499242e+02, 1.84326964e+02, 2.05133385e+02, 1.17666210e+03,
        7.05352860e+02, 2.21446363e+03, 2.01502670e+03, 8.79407962e+02,
        4.40316998e+03, 2.53375474e+03, 1.54376790e+03, 1.08136805e+03,
        3.68466551e+02, 2.64817571e+03, 1.59717932e+03, 1.22745212e+03,
        7.65861056e+02, 5.37127551e+02, 1.41923310e+03, 1.59390963e+02,
        2.77473906e+03, 2.19652298e+02, 3.42252044e+02, 6.70479213e+02,
        1.10436384e+02, 2.77288345e+02, 4.70209566e+03, 1.17712691e+03,
        4.32041866e+02, 2.42537709e+02, 1.01314289e+03, 9.05912018e+03,
        7.39467551e+02, 3.41565543e+02, 5.17477369e+03, 3.71347583e+03,
        3.23357371e+02, 4.51528603e+02, 1.04352750e+03, 6.39632012e+03,
        6.40531654e+02, 4.60792627e+02, 6.08783284e+02, 1.15210766e+03,
        2.51840914e+02, 5.27568582e+02, 3.65572310e+02, 2.77826546e+02,
        4.29059200e+03, 5.26348947e+02, 1.05541561e+03, 2.21413634e+02,
        2.19357897e+02, 6.41860702e+02, 5.82442097e+02, 6.53618668e+02,
        3.00471612e+02, 2.28235261e+02, 2.73136020e+02, 1.70293876e+02,
        4.18007659e+02, 5.09273733e+02, 1.00042466e+03, 4.01359599e+02,
        1.60565717e+03, 7.59810670e+02, 1.13569750e+03, 3.56077995e+02,
        1.49788565e+02, 3.51375264e+02, 1.45843944e+02, 1.35379004e+03,
        3.38255530e+02, 4.32458488e+02, 5.92388998e+02, 4.91396382e+02,
        6.04551411e+02, 9.05194302e+02, 2.16493903e+02, 4.37172069e+02,
        4.77975439e+02, 1.47892788e+03, 4.53852893e+02, 9.04913521e+02,
        1.14871441e+03, 5.66528707e+02, 1.05478475e+03, 4.52292923e+02,
        1.71851377e+02, 5.77266445e+03, 2.58710470e+03, 1.11650640e+02,
        4.70778073e+02, 2.75845792e+02, 2.10638110e+02, 1.40116908e+03,
        2.89858082e+02, 6.72511978e+02, 8.90762649e+03, 1.53453338e+03,
        1.59749785e+05, 2.09796322e+03, 2.98033901e+03, 8.80871324e+03,
        3.35833694e+02, 9.29094004e+04, 2.94160476e+02, 1.09173386e+04,
        9.42745008e+03, 2.02827753e+03, 7.91925136e+03, 1.00908484e+04,
        2.33238637e+03, 5.29891770e+04, 1.67900626e+03, 1.74840132e+03,
        3.41649982e+02, 4.10342640e+02, 8.15988127e+03, 7.41030425e+02,
        1.23042915e+03, 1.83331443e+04, 7.60556927e+03, 3.16304367e+03])}
[12]:
events = SimEvents.load_from_h5("h5_test.hdf5")
Resetting rng
[13]:
events.period("IC86_II").keys()
[13]:
dict_keys(['true_energy', 'reco_energy', 'arrival_energy', 'ang_err', 'ra', 'dec', 'source_label'])
[14]:
len(events)
[14]:
1
[15]:
"""
for i in [1.5, 2.0, 2.5, 3.0, 3.5, 3.7]:
    norm_energy = 1e5 # Energy of normalisation in units of GeV
    min_energy = 1e2 # GeV
    max_energy = 1e8 # GeV
    phi_solver = PhiSolver(aeff, norm_energy, min_energy, max_energy,
                           time=1, min_cosz=-1, max_cosz=1)
    phi_norm = phi_solver(Nnu=2000,
                          dec=30, # degrees
                          index=i) # spectral index
    phi_norm # GeV^-1 cm^-2 s^-1
    point_power_law = PowerLawFlux(phi_norm, norm_energy, i,
                                   min_energy, max_energy)
    point_source = PointSource(point_power_law, z=0., coord=(np.pi, np.deg2rad(30)))
    sources = [point_source]
    simulator = Simulator(sources, detector)
    simulator.time = 1 # year

    # Run simulation
    simulator.run(show_progress=True, seed=42)
    simulator.save(f"data/sim_output_{i:.1f}.h5")
"""
[15]:
'\nfor i in [1.5, 2.0, 2.5, 3.0, 3.5, 3.7]:\n    norm_energy = 1e5 # Energy of normalisation in units of GeV\n    min_energy = 1e2 # GeV\n    max_energy = 1e8 # GeV\n    phi_solver = PhiSolver(aeff, norm_energy, min_energy, max_energy, \n                           time=1, min_cosz=-1, max_cosz=1)\n    phi_norm = phi_solver(Nnu=2000, \n                          dec=30, # degrees\n                          index=i) # spectral index\n    phi_norm # GeV^-1 cm^-2 s^-1\n    point_power_law = PowerLawFlux(phi_norm, norm_energy, i, \n                                   min_energy, max_energy)\n    point_source = PointSource(point_power_law, z=0., coord=(np.pi, np.deg2rad(30)))\n    sources = [point_source]\n    simulator = Simulator(sources, detector)\n    simulator.time = 1 # year\n\n    # Run simulation\n    simulator.run(show_progress=True, seed=42)\n    simulator.save(f"data/sim_output_{i:.1f}.h5")\n'
[16]:
# Plot energies
bins = np.geomspace(1e2, max_energy)
fig, ax = plt.subplots()
ax.hist(events.true_energy["IC86_II"], bins=bins, alpha=0.7, label="E_true")
ax.hist(events.reco_energy["IC86_II"], bins=bins, alpha=0.7, label="E_reco")
ax.set_xscale("log")
ax.set_yscale("log")
ax.set_xlabel("E [GeV]")
ax.legend()
[16]:
<matplotlib.legend.Legend at 0x7f1dd3359490>
../_images/notebooks_simulation_21_1.png
[17]:
# Plot directions
ps_sel = events.source_label["IC86_II"] == 1

fig, ax = plt.subplots(subplot_kw={"projection": "aitoff"})
fig.set_size_inches((12, 7))

circles = []
for r, d, a in zip(
    events.ra["IC86_II"][~ps_sel],
    events.dec["IC86_II"][~ps_sel],
    events.ang_err["IC86_II"][~ps_sel],
):
    circle = Circle((r - np.pi, d), radius=np.deg2rad(a))
    circles.append(circle)
df_nu = PatchCollection(circles)

circles = []
for r, d, a in zip(
    events.ra["IC86_II"][ps_sel],
    events.dec["IC86_II"][ps_sel],
    events.ang_err["IC86_II"][ps_sel],
):
    circle = Circle((r - np.pi, d), radius=np.deg2rad(a))
    circles.append(circle)
ps_nu = PatchCollection(circles, color="r")

ax.add_collection(df_nu)
ax.add_collection(ps_nu)

ax.grid()
fig.savefig("example_simulation.png", dpi=150)
../_images/notebooks_simulation_22_0.png

Time dependent simulation

We can simulate an observation campaign spanning multiple data periods of IceCube through a “meta class” TimeDependentSimulator:

[18]:
tsim = TimeDependentSimulator(["IC86_I", "IC86_II"], sources)
Resetting rng
/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/icecube_tools/detector/r2021.py:82: 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)]
Resetting rng
Resetting rng
Need to set simulation times, defaults to 1 year each.

We need to set simulation times for all periods. Since for past periods the simulation time shouldn’t be larger than the actual observation time (that is time span - down time of the detector) we need to take care, or rather, we let the class Uptime take care:

[19]:
from icecube_tools.utils.data import Uptime

It lets us calculate the actual observation time through, e.g. IC86_II, vs the time covered:

[20]:
uptime = Uptime()
uptime.time_obs("IC86_II"), uptime.time_span("IC86_II")
[20]:
({'IC86_II': 0.9089039325939252}, {'IC86_II': 1.0157235341273203})

We can further define a start and end time of an observation and let it calculate the observation time in each period. Viable possible options are - start and end time in MJD - start time in MJD and duration in years - end time in MJD and duration in years

If the start time is before the earliest period (IC_40), the start time will be set to the earliest possible date.

If the end time is past the last period (IC86_II), then we get an according message and simulate into the future.

We can of course bypass this time setting and operate directly on the instances of Simulator, for example if we’d want to build up large statistics for subsequent likelihood analysis.

[21]:
times = uptime.find_obs_time(start=55569, duration=3)
times
[21]:
{'IC86_I': 1.2241905309188956, 'IC86_II': 1.5943562119196362}

The returned dictionary can be used to set the simulation times for an instance of TimeDependentSimulator:

[22]:
tsim.time = times

The simulation is started by calling run(), results can be saved by save(file_prefix), with the filename being {file_prefix}_{p}.h5 with period p.

[23]:
tsim.run(show_progress=True)
Sampling: 100%|██████████| 249/249 [00:04<00:00, 56.76it/s]
Sampling: 100%|██████████| 316/316 [00:03<00:00, 98.49it/s]
[24]:
tsim._true_energy
[24]:
{'IC86_I': array([1.31136354e+03, 4.27063531e+02, 2.30184376e+02, 1.06374367e+03,
        9.65196547e+02, 6.03473714e+02, 3.18216255e+02, 1.11522099e+02,
        1.10364467e+03, 3.98678374e+02, 3.25677732e+02, 2.64671131e+03,
        1.82239810e+02, 6.81451624e+02, 1.03196805e+02, 7.52423746e+02,
        6.91520129e+02, 3.43067451e+02, 1.32118104e+02, 5.03712664e+02,
        1.65186094e+03, 2.22002832e+02, 4.05366906e+02, 1.19678467e+02,
        2.15730519e+02, 3.03886656e+02, 1.09936544e+02, 1.60661190e+03,
        2.55587051e+02, 1.89660972e+03, 3.36077369e+02, 8.94069020e+02,
        6.95015316e+02, 1.64593963e+03, 4.77121640e+02, 2.97344866e+02,
        1.04660493e+02, 3.84705606e+02, 1.17600587e+03, 6.17634418e+03,
        3.71575557e+02, 1.88668614e+02, 3.26333895e+02, 3.28943364e+02,
        9.14343772e+02, 1.61466056e+02, 2.81243362e+03, 1.00848477e+02,
        4.71939113e+02, 2.59603872e+03, 1.15309446e+02, 7.95225683e+02,
        1.96062714e+02, 6.89950356e+02, 3.14670130e+02, 1.62633405e+02,
        2.56200449e+02, 4.34035676e+02, 2.00867160e+02, 2.52191398e+02,
        7.44179973e+02, 6.79013026e+02, 1.38371178e+03, 2.61397527e+03,
        4.55500288e+02, 4.40925778e+02, 6.02752350e+02, 3.01582267e+03,
        1.27403042e+03, 6.98460586e+02, 3.27351230e+03, 1.02597142e+03,
        4.22028261e+02, 9.21762382e+02, 8.65082757e+03, 4.97189647e+02,
        6.67306896e+02, 1.77618163e+03, 4.87773883e+03, 3.43506584e+02,
        2.16892914e+02, 4.39681806e+02, 3.64438999e+02, 2.83509111e+02,
        7.89518630e+02, 5.98721867e+02, 1.03448768e+04, 1.71691251e+02,
        8.60054826e+02, 8.67413296e+02, 1.07570854e+02, 3.05797689e+02,
        2.41383308e+03, 1.04160275e+02, 3.68018893e+02, 4.94501917e+02,
        2.04899927e+02, 6.37716590e+02, 2.79675306e+02, 4.78385125e+02,
        4.85607169e+02, 3.27908624e+02, 1.47187045e+02, 1.65595047e+03,
        2.74799475e+02, 1.00336502e+02, 3.89901431e+02, 9.20401865e+02,
        3.50262569e+03, 1.08104945e+03, 5.39903226e+02, 2.93425123e+02,
        3.03122414e+02, 6.87827202e+02, 1.35309920e+02, 1.06404398e+03,
        2.18044984e+02, 1.09135233e+03, 1.14775033e+03, 5.35045771e+02,
        1.69625181e+02, 1.22148038e+02, 6.57436699e+02, 1.88433529e+02,
        4.49923211e+02, 1.09789994e+02, 5.86089797e+02, 1.73188280e+02,
        1.56434551e+02, 1.08612781e+03, 5.05130666e+02, 3.19035391e+02,
        4.14744644e+02, 2.92599180e+02, 1.49527817e+02, 1.47356073e+03,
        1.62260871e+02, 7.20682832e+02, 4.21613742e+02, 2.56497041e+02,
        3.64581285e+02, 3.10690887e+03, 1.27308238e+03, 2.00538171e+02,
        2.57553628e+02, 4.31147649e+02, 6.55627515e+02, 3.86226818e+02,
        6.14336084e+02, 3.35752350e+02, 5.86685847e+02, 2.67865948e+02,
        1.97596114e+03, 2.56662069e+02, 1.73755000e+02, 4.01264792e+03,
        4.10705983e+02, 5.47121261e+02, 2.67677531e+02, 2.91733044e+02,
        1.39527126e+02, 6.07660575e+02, 1.44834814e+03, 1.40411247e+03,
        5.64963499e+02, 1.31849372e+03, 3.52296123e+02, 1.01882969e+03,
        2.20452151e+02, 3.45611444e+02, 5.34832674e+02, 4.06020957e+02,
        1.68690190e+02, 1.32079954e+02, 4.04100023e+03, 1.00829682e+03,
        1.32947097e+03, 7.63215097e+02, 4.46416889e+02, 5.49817949e+02,
        2.51620230e+02, 1.07554975e+03, 2.97155843e+02, 4.06115294e+02,
        2.73333851e+02, 4.44643730e+02, 2.83168259e+02, 1.37657150e+03,
        4.68202977e+02, 1.62762010e+03, 1.94327723e+03, 4.49487711e+03,
        4.15400038e+02, 4.94292322e+02, 1.78968186e+03, 2.97821088e+02,
        1.45483083e+02, 1.40432099e+02, 5.52046974e+02, 4.14960589e+02,
        5.77580909e+02, 9.18825008e+02, 7.24685475e+02, 1.14802878e+03,
        1.30681333e+03, 4.35621652e+02, 3.44689882e+02, 2.61255964e+02,
        3.10322536e+02, 7.04633570e+02, 1.18707019e+02, 1.28694916e+02,
        4.71867442e+02, 2.14811254e+04, 4.47999666e+04, 8.48517378e+02,
        3.60603910e+02, 4.39647640e+03, 2.14495503e+03, 5.52002343e+03,
        1.10678300e+03, 1.11787563e+04, 2.12074202e+03, 4.41627692e+02,
        1.58360071e+05, 7.12644388e+02, 4.59849238e+04, 1.86987749e+04,
        7.95265458e+03, 4.23869706e+03, 4.66794955e+04, 6.18118246e+03,
        3.98549555e+03, 7.80835409e+04, 1.22952939e+04, 2.52622559e+03,
        1.01831238e+04, 6.30308516e+04, 1.71450854e+03, 1.27139255e+03,
        2.20319102e+04, 2.43868826e+03, 4.09233699e+02, 1.35198787e+03,
        7.58557236e+03, 1.20792431e+03, 5.88424225e+04, 3.87072127e+03,
        3.02568463e+02]),
 'IC86_II': array([6.65178000e+02, 1.69202240e+02, 2.70476857e+03, 2.22532330e+02,
        7.19423381e+02, 1.13766385e+02, 1.30603424e+03, 5.58388205e+02,
        3.68746173e+03, 2.15584938e+02, 2.80958796e+02, 1.33308733e+02,
        3.01898389e+02, 1.39813514e+03, 7.67652790e+02, 1.18644139e+02,
        1.60418667e+02, 1.18927673e+02, 1.94152348e+02, 1.20647657e+02,
        1.84892419e+03, 1.23866437e+02, 1.85021692e+02, 3.27927993e+02,
        1.03784105e+03, 2.66121847e+02, 1.59777184e+02, 4.30933676e+02,
        5.18373462e+02, 7.50982951e+02, 1.66269575e+02, 6.58233916e+02,
        1.51190325e+03, 1.04923778e+03, 2.64524340e+02, 4.41578550e+02,
        4.07240880e+02, 9.32726469e+02, 2.17336905e+02, 3.32431860e+02,
        1.23573757e+02, 1.03679164e+02, 6.94710624e+02, 6.68487094e+02,
        8.40306955e+02, 2.21645235e+02, 1.29245283e+02, 6.85027143e+02,
        8.13918448e+02, 1.65426683e+02, 2.39219345e+03, 3.06016722e+02,
        2.61718003e+02, 3.05764700e+02, 2.69910452e+02, 1.83544528e+02,
        4.44547025e+02, 2.86730873e+02, 1.10389935e+03, 1.25325297e+02,
        4.22101626e+03, 6.15945017e+03, 2.55803767e+02, 1.79332883e+02,
        2.06041240e+03, 1.61003224e+03, 1.37078069e+03, 1.07311171e+03,
        1.20971758e+02, 2.02501494e+02, 1.07416230e+03, 7.07679778e+02,
        1.67336806e+02, 3.04802866e+02, 4.56771151e+03, 8.05686417e+02,
        3.14500483e+02, 4.82319658e+03, 2.60614850e+02, 7.04458465e+02,
        1.12632500e+02, 3.74473349e+02, 4.36163409e+02, 8.67413296e+02,
        2.06326990e+02, 1.76019722e+02, 2.41155015e+02, 1.13811219e+02,
        9.43623635e+02, 3.29860664e+02, 1.79882873e+02, 3.34318148e+02,
        1.31992586e+03, 1.22387036e+02, 1.43191147e+02, 3.79654559e+02,
        3.36964460e+02, 3.11454875e+02, 2.19690931e+02, 2.95527443e+02,
        3.10010525e+02, 1.29184104e+02, 1.10580317e+03, 1.16162187e+03,
        3.11336792e+02, 7.92791991e+02, 1.59235278e+03, 1.09109480e+03,
        3.72625488e+02, 6.33205453e+02, 4.14826408e+02, 2.46094264e+02,
        3.03025149e+02, 1.40991119e+03, 5.77999371e+02, 1.18096043e+03,
        1.63153742e+02, 7.16313845e+02, 4.50795084e+02, 3.29990283e+03,
        1.43576711e+02, 4.22842253e+03, 5.24726757e+02, 1.90804542e+02,
        3.55086622e+02, 6.27756534e+02, 2.17547649e+02, 2.80924909e+02,
        2.79659122e+03, 7.09348154e+02, 8.28622010e+02, 6.41114406e+02,
        1.00204918e+03, 3.05562157e+02, 2.90201108e+02, 5.30753736e+02,
        1.16784633e+03, 3.40143344e+02, 3.05782600e+02, 3.47336744e+02,
        6.67377164e+02, 5.37899181e+02, 6.44498454e+02, 1.53199925e+03,
        4.19584638e+02, 3.56988825e+02, 6.28530741e+03, 3.56260211e+02,
        7.12537477e+02, 8.33404942e+02, 2.34376557e+03, 2.65030333e+02,
        1.20994627e+02, 2.78243043e+02, 2.98643778e+04, 1.11067402e+02,
        1.79421774e+02, 1.07237060e+03, 4.81262508e+02, 9.19826281e+02,
        1.42244149e+02, 4.97342678e+02, 4.18378362e+02, 2.00665845e+02,
        2.34744288e+02, 2.16779097e+02, 9.20077893e+03, 1.22747649e+03,
        1.20804514e+03, 2.50517919e+02, 4.02159228e+02, 2.24396126e+02,
        5.54308513e+02, 2.88177352e+02, 3.68421049e+02, 8.76690657e+02,
        5.10745881e+02, 1.25673248e+02, 1.76143720e+02, 3.96563266e+02,
        1.03902719e+03, 9.91346700e+02, 1.38249539e+02, 1.88610588e+02,
        1.42677589e+03, 1.16043776e+02, 2.34677986e+02, 2.81986011e+02,
        1.22762033e+03, 1.04722061e+03, 2.34810333e+02, 2.95624720e+02,
        3.27291700e+02, 1.19924757e+03, 1.94255656e+02, 2.43644485e+02,
        4.93441800e+02, 1.73991933e+03, 1.08504026e+03, 3.07011748e+02,
        1.87423935e+02, 1.35792754e+02, 5.39206242e+02, 4.06313620e+02,
        2.09736205e+02, 1.53822175e+03, 2.31752024e+02, 4.50352595e+02,
        4.24977180e+02, 1.30686690e+03, 1.04931223e+03, 3.02663294e+02,
        1.44774795e+03, 1.91793551e+02, 2.23987098e+02, 6.37797383e+02,
        1.68250239e+03, 1.69300530e+02, 3.35040745e+02, 1.60601584e+02,
        2.61755687e+04, 2.99807512e+02, 1.53710895e+02, 1.62621282e+02,
        3.23475882e+02, 1.19419458e+03, 1.45075052e+03, 4.53485543e+02,
        1.92821797e+02, 4.46152356e+02, 4.42277574e+02, 2.59487930e+02,
        1.31734226e+03, 1.86236803e+02, 6.83896153e+03, 3.20889036e+02,
        1.58513658e+02, 3.59066579e+03, 1.78098079e+02, 2.64473078e+02,
        5.04245957e+02, 1.59362864e+02, 1.16260243e+03, 1.20359205e+02,
        4.20308199e+02, 7.02833351e+02, 2.91019535e+02, 4.41396227e+02,
        1.20839659e+02, 1.21208230e+02, 1.34644773e+03, 2.58815431e+02,
        3.98574188e+02, 9.58397078e+02, 1.36230488e+03, 1.78108096e+02,
        3.51515588e+02, 1.66876380e+03, 9.39780610e+02, 2.20089046e+02,
        8.42975894e+02, 4.51536732e+02, 1.81306886e+02, 1.05227613e+02,
        2.70520643e+02, 2.71864562e+02, 2.28594277e+02, 2.81118532e+02,
        6.78860066e+02, 2.57263459e+02, 3.73466646e+02, 2.87401921e+02,
        1.60369465e+02, 1.59788960e+02, 2.13223356e+02, 3.02589229e+02,
        2.03208274e+02, 5.04716500e+02, 1.60789914e+05, 1.24800129e+03,
        2.19685165e+03, 1.22424610e+03, 8.41563717e+04, 2.76888249e+04,
        9.27385988e+03, 5.51087867e+02, 1.42872470e+04, 1.15181175e+04,
        4.06659577e+02, 1.12136867e+03, 1.21498462e+04, 5.18129790e+03,
        4.61284945e+02, 4.75776903e+02, 1.02976886e+04, 3.99582598e+02,
        4.09717088e+03, 3.17295644e+04, 6.25315281e+03, 2.10418469e+04,
        7.15418376e+02, 2.78997991e+03, 4.97138102e+02, 8.62516403e+03,
        1.31516329e+04, 2.77956411e+04, 4.80118425e+04, 2.48169009e+04,
        2.23447961e+03, 2.39212831e+04, 5.51330759e+03, 1.62995400e+03,
        2.60956972e+04, 6.38836650e+03, 3.01223239e+03, 4.29326872e+02])}
[25]:
tsim.write_to_h5("multi_test.hdf5", sources)
[26]:
tsim.arrival_energy
[26]:
{'IC86_I': array([1.31136354e+03, 4.27063531e+02, 2.30184376e+02, 1.06374367e+03,
        9.65196547e+02, 6.03473714e+02, 3.18216255e+02, 1.11522099e+02,
        1.10364467e+03, 3.98678374e+02, 3.25677732e+02, 2.64671131e+03,
        1.82239810e+02, 6.81451624e+02, 1.03196805e+02, 7.52423746e+02,
        6.91520129e+02, 3.43067451e+02, 1.32118104e+02, 5.03712664e+02,
        1.65186094e+03, 2.22002832e+02, 4.05366906e+02, 1.19678467e+02,
        2.15730519e+02, 3.03886656e+02, 1.09936544e+02, 1.60661190e+03,
        2.55587051e+02, 1.89660972e+03, 3.36077369e+02, 8.94069020e+02,
        6.95015316e+02, 1.64593963e+03, 4.77121640e+02, 2.97344866e+02,
        1.04660493e+02, 3.84705606e+02, 1.17600587e+03, 6.17634418e+03,
        3.71575557e+02, 1.88668614e+02, 3.26333895e+02, 3.28943364e+02,
        9.14343772e+02, 1.61466056e+02, 2.81243362e+03, 1.00848477e+02,
        4.71939113e+02, 2.59603872e+03, 1.15309446e+02, 7.95225683e+02,
        1.96062714e+02, 6.89950356e+02, 3.14670130e+02, 1.62633405e+02,
        2.56200449e+02, 4.34035676e+02, 2.00867160e+02, 2.52191398e+02,
        7.44179973e+02, 6.79013026e+02, 1.38371178e+03, 2.61397527e+03,
        4.55500288e+02, 4.40925778e+02, 6.02752350e+02, 3.01582267e+03,
        1.27403042e+03, 6.98460586e+02, 3.27351230e+03, 1.02597142e+03,
        4.22028261e+02, 9.21762382e+02, 8.65082757e+03, 4.97189647e+02,
        6.67306896e+02, 1.77618163e+03, 4.87773883e+03, 3.43506584e+02,
        2.16892914e+02, 4.39681806e+02, 3.64438999e+02, 2.83509111e+02,
        7.89518630e+02, 5.98721867e+02, 1.03448768e+04, 1.71691251e+02,
        8.60054826e+02, 8.67413296e+02, 1.07570854e+02, 3.05797689e+02,
        2.41383308e+03, 1.04160275e+02, 3.68018893e+02, 4.94501917e+02,
        2.04899927e+02, 6.37716590e+02, 2.79675306e+02, 4.78385125e+02,
        4.85607169e+02, 3.27908624e+02, 1.47187045e+02, 1.65595047e+03,
        2.74799475e+02, 1.00336502e+02, 3.89901431e+02, 9.20401865e+02,
        3.50262569e+03, 1.08104945e+03, 5.39903226e+02, 2.93425123e+02,
        3.03122414e+02, 6.87827202e+02, 1.35309920e+02, 1.06404398e+03,
        2.18044984e+02, 1.09135233e+03, 1.14775033e+03, 5.35045771e+02,
        1.69625181e+02, 1.22148038e+02, 6.57436699e+02, 1.88433529e+02,
        4.49923211e+02, 1.09789994e+02, 5.86089797e+02, 1.73188280e+02,
        1.56434551e+02, 1.08612781e+03, 5.05130666e+02, 3.19035391e+02,
        4.14744644e+02, 2.92599180e+02, 1.49527817e+02, 1.47356073e+03,
        1.62260871e+02, 7.20682832e+02, 4.21613742e+02, 2.56497041e+02,
        3.64581285e+02, 3.10690887e+03, 1.27308238e+03, 2.00538171e+02,
        2.57553628e+02, 4.31147649e+02, 6.55627515e+02, 3.86226818e+02,
        6.14336084e+02, 3.35752350e+02, 5.86685847e+02, 2.67865948e+02,
        1.97596114e+03, 2.56662069e+02, 1.73755000e+02, 4.01264792e+03,
        4.10705983e+02, 5.47121261e+02, 2.67677531e+02, 2.91733044e+02,
        1.39527126e+02, 6.07660575e+02, 1.44834814e+03, 1.40411247e+03,
        5.64963499e+02, 1.31849372e+03, 3.52296123e+02, 1.01882969e+03,
        2.20452151e+02, 3.45611444e+02, 5.34832674e+02, 4.06020957e+02,
        1.68690190e+02, 1.32079954e+02, 4.04100023e+03, 1.00829682e+03,
        1.32947097e+03, 7.63215097e+02, 4.46416889e+02, 5.49817949e+02,
        2.51620230e+02, 1.07554975e+03, 2.97155843e+02, 4.06115294e+02,
        2.73333851e+02, 4.44643730e+02, 2.83168259e+02, 1.37657150e+03,
        4.68202977e+02, 1.62762010e+03, 1.94327723e+03, 4.49487711e+03,
        4.15400038e+02, 4.94292322e+02, 1.78968186e+03, 2.97821088e+02,
        1.45483083e+02, 1.40432099e+02, 5.52046974e+02, 4.14960589e+02,
        5.77580909e+02, 9.18825008e+02, 7.24685475e+02, 1.14802878e+03,
        1.30681333e+03, 4.35621652e+02, 3.44689882e+02, 2.61255964e+02,
        3.10322536e+02, 7.04633570e+02, 1.18707019e+02, 1.28694916e+02,
        4.71867442e+02, 2.14811254e+04, 4.47999666e+04, 8.48517378e+02,
        3.60603910e+02, 4.39647640e+03, 2.14495503e+03, 5.52002343e+03,
        1.10678300e+03, 1.11787563e+04, 2.12074202e+03, 4.41627692e+02,
        1.58360071e+05, 7.12644388e+02, 4.59849238e+04, 1.86987749e+04,
        7.95265458e+03, 4.23869706e+03, 4.66794955e+04, 6.18118246e+03,
        3.98549555e+03, 7.80835409e+04, 1.22952939e+04, 2.52622559e+03,
        1.01831238e+04, 6.30308516e+04, 1.71450854e+03, 1.27139255e+03,
        2.20319102e+04, 2.43868826e+03, 4.09233699e+02, 1.35198787e+03,
        7.58557236e+03, 1.20792431e+03, 5.88424225e+04, 3.87072127e+03,
        3.02568463e+02]),
 'IC86_II': array([6.65178000e+02, 1.69202240e+02, 2.70476857e+03, 2.22532330e+02,
        7.19423381e+02, 1.13766385e+02, 1.30603424e+03, 5.58388205e+02,
        3.68746173e+03, 2.15584938e+02, 2.80958796e+02, 1.33308733e+02,
        3.01898389e+02, 1.39813514e+03, 7.67652790e+02, 1.18644139e+02,
        1.60418667e+02, 1.18927673e+02, 1.94152348e+02, 1.20647657e+02,
        1.84892419e+03, 1.23866437e+02, 1.85021692e+02, 3.27927993e+02,
        1.03784105e+03, 2.66121847e+02, 1.59777184e+02, 4.30933676e+02,
        5.18373462e+02, 7.50982951e+02, 1.66269575e+02, 6.58233916e+02,
        1.51190325e+03, 1.04923778e+03, 2.64524340e+02, 4.41578550e+02,
        4.07240880e+02, 9.32726469e+02, 2.17336905e+02, 3.32431860e+02,
        1.23573757e+02, 1.03679164e+02, 6.94710624e+02, 6.68487094e+02,
        8.40306955e+02, 2.21645235e+02, 1.29245283e+02, 6.85027143e+02,
        8.13918448e+02, 1.65426683e+02, 2.39219345e+03, 3.06016722e+02,
        2.61718003e+02, 3.05764700e+02, 2.69910452e+02, 1.83544528e+02,
        4.44547025e+02, 2.86730873e+02, 1.10389935e+03, 1.25325297e+02,
        4.22101626e+03, 6.15945017e+03, 2.55803767e+02, 1.79332883e+02,
        2.06041240e+03, 1.61003224e+03, 1.37078069e+03, 1.07311171e+03,
        1.20971758e+02, 2.02501494e+02, 1.07416230e+03, 7.07679778e+02,
        1.67336806e+02, 3.04802866e+02, 4.56771151e+03, 8.05686417e+02,
        3.14500483e+02, 4.82319658e+03, 2.60614850e+02, 7.04458465e+02,
        1.12632500e+02, 3.74473349e+02, 4.36163409e+02, 8.67413296e+02,
        2.06326990e+02, 1.76019722e+02, 2.41155015e+02, 1.13811219e+02,
        9.43623635e+02, 3.29860664e+02, 1.79882873e+02, 3.34318148e+02,
        1.31992586e+03, 1.22387036e+02, 1.43191147e+02, 3.79654559e+02,
        3.36964460e+02, 3.11454875e+02, 2.19690931e+02, 2.95527443e+02,
        3.10010525e+02, 1.29184104e+02, 1.10580317e+03, 1.16162187e+03,
        3.11336792e+02, 7.92791991e+02, 1.59235278e+03, 1.09109480e+03,
        3.72625488e+02, 6.33205453e+02, 4.14826408e+02, 2.46094264e+02,
        3.03025149e+02, 1.40991119e+03, 5.77999371e+02, 1.18096043e+03,
        1.63153742e+02, 7.16313845e+02, 4.50795084e+02, 3.29990283e+03,
        1.43576711e+02, 4.22842253e+03, 5.24726757e+02, 1.90804542e+02,
        3.55086622e+02, 6.27756534e+02, 2.17547649e+02, 2.80924909e+02,
        2.79659122e+03, 7.09348154e+02, 8.28622010e+02, 6.41114406e+02,
        1.00204918e+03, 3.05562157e+02, 2.90201108e+02, 5.30753736e+02,
        1.16784633e+03, 3.40143344e+02, 3.05782600e+02, 3.47336744e+02,
        6.67377164e+02, 5.37899181e+02, 6.44498454e+02, 1.53199925e+03,
        4.19584638e+02, 3.56988825e+02, 6.28530741e+03, 3.56260211e+02,
        7.12537477e+02, 8.33404942e+02, 2.34376557e+03, 2.65030333e+02,
        1.20994627e+02, 2.78243043e+02, 2.98643778e+04, 1.11067402e+02,
        1.79421774e+02, 1.07237060e+03, 4.81262508e+02, 9.19826281e+02,
        1.42244149e+02, 4.97342678e+02, 4.18378362e+02, 2.00665845e+02,
        2.34744288e+02, 2.16779097e+02, 9.20077893e+03, 1.22747649e+03,
        1.20804514e+03, 2.50517919e+02, 4.02159228e+02, 2.24396126e+02,
        5.54308513e+02, 2.88177352e+02, 3.68421049e+02, 8.76690657e+02,
        5.10745881e+02, 1.25673248e+02, 1.76143720e+02, 3.96563266e+02,
        1.03902719e+03, 9.91346700e+02, 1.38249539e+02, 1.88610588e+02,
        1.42677589e+03, 1.16043776e+02, 2.34677986e+02, 2.81986011e+02,
        1.22762033e+03, 1.04722061e+03, 2.34810333e+02, 2.95624720e+02,
        3.27291700e+02, 1.19924757e+03, 1.94255656e+02, 2.43644485e+02,
        4.93441800e+02, 1.73991933e+03, 1.08504026e+03, 3.07011748e+02,
        1.87423935e+02, 1.35792754e+02, 5.39206242e+02, 4.06313620e+02,
        2.09736205e+02, 1.53822175e+03, 2.31752024e+02, 4.50352595e+02,
        4.24977180e+02, 1.30686690e+03, 1.04931223e+03, 3.02663294e+02,
        1.44774795e+03, 1.91793551e+02, 2.23987098e+02, 6.37797383e+02,
        1.68250239e+03, 1.69300530e+02, 3.35040745e+02, 1.60601584e+02,
        2.61755687e+04, 2.99807512e+02, 1.53710895e+02, 1.62621282e+02,
        3.23475882e+02, 1.19419458e+03, 1.45075052e+03, 4.53485543e+02,
        1.92821797e+02, 4.46152356e+02, 4.42277574e+02, 2.59487930e+02,
        1.31734226e+03, 1.86236803e+02, 6.83896153e+03, 3.20889036e+02,
        1.58513658e+02, 3.59066579e+03, 1.78098079e+02, 2.64473078e+02,
        5.04245957e+02, 1.59362864e+02, 1.16260243e+03, 1.20359205e+02,
        4.20308199e+02, 7.02833351e+02, 2.91019535e+02, 4.41396227e+02,
        1.20839659e+02, 1.21208230e+02, 1.34644773e+03, 2.58815431e+02,
        3.98574188e+02, 9.58397078e+02, 1.36230488e+03, 1.78108096e+02,
        3.51515588e+02, 1.66876380e+03, 9.39780610e+02, 2.20089046e+02,
        8.42975894e+02, 4.51536732e+02, 1.81306886e+02, 1.05227613e+02,
        2.70520643e+02, 2.71864562e+02, 2.28594277e+02, 2.81118532e+02,
        6.78860066e+02, 2.57263459e+02, 3.73466646e+02, 2.87401921e+02,
        1.60369465e+02, 1.59788960e+02, 2.13223356e+02, 3.02589229e+02,
        2.03208274e+02, 5.04716500e+02, 1.60789914e+05, 1.24800129e+03,
        2.19685165e+03, 1.22424610e+03, 8.41563717e+04, 2.76888249e+04,
        9.27385988e+03, 5.51087867e+02, 1.42872470e+04, 1.15181175e+04,
        4.06659577e+02, 1.12136867e+03, 1.21498462e+04, 5.18129790e+03,
        4.61284945e+02, 4.75776903e+02, 1.02976886e+04, 3.99582598e+02,
        4.09717088e+03, 3.17295644e+04, 6.25315281e+03, 2.10418469e+04,
        7.15418376e+02, 2.78997991e+03, 4.97138102e+02, 8.62516403e+03,
        1.31516329e+04, 2.77956411e+04, 4.80118425e+04, 2.48169009e+04,
        2.23447961e+03, 2.39212831e+04, 5.51330759e+03, 1.62995400e+03,
        2.60956972e+04, 6.38836650e+03, 3.01223239e+03, 4.29326872e+02])}
[27]:
events = SimEvents.load_from_h5("multi_test.hdf5")
Resetting rng
[28]:
events.arrival_energy
[28]:
{'IC86_I': array([1.31136354e+03, 4.27063531e+02, 2.30184376e+02, 1.06374367e+03,
        9.65196547e+02, 6.03473714e+02, 3.18216255e+02, 1.11522099e+02,
        1.10364467e+03, 3.98678374e+02, 3.25677732e+02, 2.64671131e+03,
        1.82239810e+02, 6.81451624e+02, 1.03196805e+02, 7.52423746e+02,
        6.91520129e+02, 3.43067451e+02, 1.32118104e+02, 5.03712664e+02,
        1.65186094e+03, 2.22002832e+02, 4.05366906e+02, 1.19678467e+02,
        2.15730519e+02, 3.03886656e+02, 1.09936544e+02, 1.60661190e+03,
        2.55587051e+02, 1.89660972e+03, 3.36077369e+02, 8.94069020e+02,
        6.95015316e+02, 1.64593963e+03, 4.77121640e+02, 2.97344866e+02,
        1.04660493e+02, 3.84705606e+02, 1.17600587e+03, 6.17634418e+03,
        3.71575557e+02, 1.88668614e+02, 3.26333895e+02, 3.28943364e+02,
        9.14343772e+02, 1.61466056e+02, 2.81243362e+03, 1.00848477e+02,
        4.71939113e+02, 2.59603872e+03, 1.15309446e+02, 7.95225683e+02,
        1.96062714e+02, 6.89950356e+02, 3.14670130e+02, 1.62633405e+02,
        2.56200449e+02, 4.34035676e+02, 2.00867160e+02, 2.52191398e+02,
        7.44179973e+02, 6.79013026e+02, 1.38371178e+03, 2.61397527e+03,
        4.55500288e+02, 4.40925778e+02, 6.02752350e+02, 3.01582267e+03,
        1.27403042e+03, 6.98460586e+02, 3.27351230e+03, 1.02597142e+03,
        4.22028261e+02, 9.21762382e+02, 8.65082757e+03, 4.97189647e+02,
        6.67306896e+02, 1.77618163e+03, 4.87773883e+03, 3.43506584e+02,
        2.16892914e+02, 4.39681806e+02, 3.64438999e+02, 2.83509111e+02,
        7.89518630e+02, 5.98721867e+02, 1.03448768e+04, 1.71691251e+02,
        8.60054826e+02, 8.67413296e+02, 1.07570854e+02, 3.05797689e+02,
        2.41383308e+03, 1.04160275e+02, 3.68018893e+02, 4.94501917e+02,
        2.04899927e+02, 6.37716590e+02, 2.79675306e+02, 4.78385125e+02,
        4.85607169e+02, 3.27908624e+02, 1.47187045e+02, 1.65595047e+03,
        2.74799475e+02, 1.00336502e+02, 3.89901431e+02, 9.20401865e+02,
        3.50262569e+03, 1.08104945e+03, 5.39903226e+02, 2.93425123e+02,
        3.03122414e+02, 6.87827202e+02, 1.35309920e+02, 1.06404398e+03,
        2.18044984e+02, 1.09135233e+03, 1.14775033e+03, 5.35045771e+02,
        1.69625181e+02, 1.22148038e+02, 6.57436699e+02, 1.88433529e+02,
        4.49923211e+02, 1.09789994e+02, 5.86089797e+02, 1.73188280e+02,
        1.56434551e+02, 1.08612781e+03, 5.05130666e+02, 3.19035391e+02,
        4.14744644e+02, 2.92599180e+02, 1.49527817e+02, 1.47356073e+03,
        1.62260871e+02, 7.20682832e+02, 4.21613742e+02, 2.56497041e+02,
        3.64581285e+02, 3.10690887e+03, 1.27308238e+03, 2.00538171e+02,
        2.57553628e+02, 4.31147649e+02, 6.55627515e+02, 3.86226818e+02,
        6.14336084e+02, 3.35752350e+02, 5.86685847e+02, 2.67865948e+02,
        1.97596114e+03, 2.56662069e+02, 1.73755000e+02, 4.01264792e+03,
        4.10705983e+02, 5.47121261e+02, 2.67677531e+02, 2.91733044e+02,
        1.39527126e+02, 6.07660575e+02, 1.44834814e+03, 1.40411247e+03,
        5.64963499e+02, 1.31849372e+03, 3.52296123e+02, 1.01882969e+03,
        2.20452151e+02, 3.45611444e+02, 5.34832674e+02, 4.06020957e+02,
        1.68690190e+02, 1.32079954e+02, 4.04100023e+03, 1.00829682e+03,
        1.32947097e+03, 7.63215097e+02, 4.46416889e+02, 5.49817949e+02,
        2.51620230e+02, 1.07554975e+03, 2.97155843e+02, 4.06115294e+02,
        2.73333851e+02, 4.44643730e+02, 2.83168259e+02, 1.37657150e+03,
        4.68202977e+02, 1.62762010e+03, 1.94327723e+03, 4.49487711e+03,
        4.15400038e+02, 4.94292322e+02, 1.78968186e+03, 2.97821088e+02,
        1.45483083e+02, 1.40432099e+02, 5.52046974e+02, 4.14960589e+02,
        5.77580909e+02, 9.18825008e+02, 7.24685475e+02, 1.14802878e+03,
        1.30681333e+03, 4.35621652e+02, 3.44689882e+02, 2.61255964e+02,
        3.10322536e+02, 7.04633570e+02, 1.18707019e+02, 1.28694916e+02,
        4.71867442e+02, 2.14811254e+04, 4.47999666e+04, 8.48517378e+02,
        3.60603910e+02, 4.39647640e+03, 2.14495503e+03, 5.52002343e+03,
        1.10678300e+03, 1.11787563e+04, 2.12074202e+03, 4.41627692e+02,
        1.58360071e+05, 7.12644388e+02, 4.59849238e+04, 1.86987749e+04,
        7.95265458e+03, 4.23869706e+03, 4.66794955e+04, 6.18118246e+03,
        3.98549555e+03, 7.80835409e+04, 1.22952939e+04, 2.52622559e+03,
        1.01831238e+04, 6.30308516e+04, 1.71450854e+03, 1.27139255e+03,
        2.20319102e+04, 2.43868826e+03, 4.09233699e+02, 1.35198787e+03,
        7.58557236e+03, 1.20792431e+03, 5.88424225e+04, 3.87072127e+03,
        3.02568463e+02]),
 'IC86_II': array([6.65178000e+02, 1.69202240e+02, 2.70476857e+03, 2.22532330e+02,
        7.19423381e+02, 1.13766385e+02, 1.30603424e+03, 5.58388205e+02,
        3.68746173e+03, 2.15584938e+02, 2.80958796e+02, 1.33308733e+02,
        3.01898389e+02, 1.39813514e+03, 7.67652790e+02, 1.18644139e+02,
        1.60418667e+02, 1.18927673e+02, 1.94152348e+02, 1.20647657e+02,
        1.84892419e+03, 1.23866437e+02, 1.85021692e+02, 3.27927993e+02,
        1.03784105e+03, 2.66121847e+02, 1.59777184e+02, 4.30933676e+02,
        5.18373462e+02, 7.50982951e+02, 1.66269575e+02, 6.58233916e+02,
        1.51190325e+03, 1.04923778e+03, 2.64524340e+02, 4.41578550e+02,
        4.07240880e+02, 9.32726469e+02, 2.17336905e+02, 3.32431860e+02,
        1.23573757e+02, 1.03679164e+02, 6.94710624e+02, 6.68487094e+02,
        8.40306955e+02, 2.21645235e+02, 1.29245283e+02, 6.85027143e+02,
        8.13918448e+02, 1.65426683e+02, 2.39219345e+03, 3.06016722e+02,
        2.61718003e+02, 3.05764700e+02, 2.69910452e+02, 1.83544528e+02,
        4.44547025e+02, 2.86730873e+02, 1.10389935e+03, 1.25325297e+02,
        4.22101626e+03, 6.15945017e+03, 2.55803767e+02, 1.79332883e+02,
        2.06041240e+03, 1.61003224e+03, 1.37078069e+03, 1.07311171e+03,
        1.20971758e+02, 2.02501494e+02, 1.07416230e+03, 7.07679778e+02,
        1.67336806e+02, 3.04802866e+02, 4.56771151e+03, 8.05686417e+02,
        3.14500483e+02, 4.82319658e+03, 2.60614850e+02, 7.04458465e+02,
        1.12632500e+02, 3.74473349e+02, 4.36163409e+02, 8.67413296e+02,
        2.06326990e+02, 1.76019722e+02, 2.41155015e+02, 1.13811219e+02,
        9.43623635e+02, 3.29860664e+02, 1.79882873e+02, 3.34318148e+02,
        1.31992586e+03, 1.22387036e+02, 1.43191147e+02, 3.79654559e+02,
        3.36964460e+02, 3.11454875e+02, 2.19690931e+02, 2.95527443e+02,
        3.10010525e+02, 1.29184104e+02, 1.10580317e+03, 1.16162187e+03,
        3.11336792e+02, 7.92791991e+02, 1.59235278e+03, 1.09109480e+03,
        3.72625488e+02, 6.33205453e+02, 4.14826408e+02, 2.46094264e+02,
        3.03025149e+02, 1.40991119e+03, 5.77999371e+02, 1.18096043e+03,
        1.63153742e+02, 7.16313845e+02, 4.50795084e+02, 3.29990283e+03,
        1.43576711e+02, 4.22842253e+03, 5.24726757e+02, 1.90804542e+02,
        3.55086622e+02, 6.27756534e+02, 2.17547649e+02, 2.80924909e+02,
        2.79659122e+03, 7.09348154e+02, 8.28622010e+02, 6.41114406e+02,
        1.00204918e+03, 3.05562157e+02, 2.90201108e+02, 5.30753736e+02,
        1.16784633e+03, 3.40143344e+02, 3.05782600e+02, 3.47336744e+02,
        6.67377164e+02, 5.37899181e+02, 6.44498454e+02, 1.53199925e+03,
        4.19584638e+02, 3.56988825e+02, 6.28530741e+03, 3.56260211e+02,
        7.12537477e+02, 8.33404942e+02, 2.34376557e+03, 2.65030333e+02,
        1.20994627e+02, 2.78243043e+02, 2.98643778e+04, 1.11067402e+02,
        1.79421774e+02, 1.07237060e+03, 4.81262508e+02, 9.19826281e+02,
        1.42244149e+02, 4.97342678e+02, 4.18378362e+02, 2.00665845e+02,
        2.34744288e+02, 2.16779097e+02, 9.20077893e+03, 1.22747649e+03,
        1.20804514e+03, 2.50517919e+02, 4.02159228e+02, 2.24396126e+02,
        5.54308513e+02, 2.88177352e+02, 3.68421049e+02, 8.76690657e+02,
        5.10745881e+02, 1.25673248e+02, 1.76143720e+02, 3.96563266e+02,
        1.03902719e+03, 9.91346700e+02, 1.38249539e+02, 1.88610588e+02,
        1.42677589e+03, 1.16043776e+02, 2.34677986e+02, 2.81986011e+02,
        1.22762033e+03, 1.04722061e+03, 2.34810333e+02, 2.95624720e+02,
        3.27291700e+02, 1.19924757e+03, 1.94255656e+02, 2.43644485e+02,
        4.93441800e+02, 1.73991933e+03, 1.08504026e+03, 3.07011748e+02,
        1.87423935e+02, 1.35792754e+02, 5.39206242e+02, 4.06313620e+02,
        2.09736205e+02, 1.53822175e+03, 2.31752024e+02, 4.50352595e+02,
        4.24977180e+02, 1.30686690e+03, 1.04931223e+03, 3.02663294e+02,
        1.44774795e+03, 1.91793551e+02, 2.23987098e+02, 6.37797383e+02,
        1.68250239e+03, 1.69300530e+02, 3.35040745e+02, 1.60601584e+02,
        2.61755687e+04, 2.99807512e+02, 1.53710895e+02, 1.62621282e+02,
        3.23475882e+02, 1.19419458e+03, 1.45075052e+03, 4.53485543e+02,
        1.92821797e+02, 4.46152356e+02, 4.42277574e+02, 2.59487930e+02,
        1.31734226e+03, 1.86236803e+02, 6.83896153e+03, 3.20889036e+02,
        1.58513658e+02, 3.59066579e+03, 1.78098079e+02, 2.64473078e+02,
        5.04245957e+02, 1.59362864e+02, 1.16260243e+03, 1.20359205e+02,
        4.20308199e+02, 7.02833351e+02, 2.91019535e+02, 4.41396227e+02,
        1.20839659e+02, 1.21208230e+02, 1.34644773e+03, 2.58815431e+02,
        3.98574188e+02, 9.58397078e+02, 1.36230488e+03, 1.78108096e+02,
        3.51515588e+02, 1.66876380e+03, 9.39780610e+02, 2.20089046e+02,
        8.42975894e+02, 4.51536732e+02, 1.81306886e+02, 1.05227613e+02,
        2.70520643e+02, 2.71864562e+02, 2.28594277e+02, 2.81118532e+02,
        6.78860066e+02, 2.57263459e+02, 3.73466646e+02, 2.87401921e+02,
        1.60369465e+02, 1.59788960e+02, 2.13223356e+02, 3.02589229e+02,
        2.03208274e+02, 5.04716500e+02, 1.60789914e+05, 1.24800129e+03,
        2.19685165e+03, 1.22424610e+03, 8.41563717e+04, 2.76888249e+04,
        9.27385988e+03, 5.51087867e+02, 1.42872470e+04, 1.15181175e+04,
        4.06659577e+02, 1.12136867e+03, 1.21498462e+04, 5.18129790e+03,
        4.61284945e+02, 4.75776903e+02, 1.02976886e+04, 3.99582598e+02,
        4.09717088e+03, 3.17295644e+04, 6.25315281e+03, 2.10418469e+04,
        7.15418376e+02, 2.78997991e+03, 4.97138102e+02, 8.62516403e+03,
        1.31516329e+04, 2.77956411e+04, 4.80118425e+04, 2.48169009e+04,
        2.23447961e+03, 2.39212831e+04, 5.51330759e+03, 1.62995400e+03,
        2.60956972e+04, 6.38836650e+03, 3.01223239e+03, 4.29326872e+02])}
[29]:
"""
for i in [3.9]:
    norm_energy = 1e5 # Energy of normalisation in units of GeV
    min_energy = 1e2 # GeV
    max_energy = 1e8 # GeV
    phi_solver = PhiSolver(aeff, norm_energy, min_energy, max_energy,
                           time=1, min_cosz=-1, max_cosz=1)
    phi_norm = phi_solver(Nnu=2000,
                          dec=30, # degrees
                          index=i) # spectral index
    phi_norm # GeV^-1 cm^-2 s^-1
    point_power_law = PowerLawFlux(phi_norm, norm_energy, i,
                                   min_energy, max_energy)
    point_source = PointSource(point_power_law, z=0., coord=(np.pi, np.deg2rad(30)))
    sources = [point_source]
    tsim = TimeDependentSimulator(["IC86_I", "IC86_II"], sources)
    for sim in tsim.simulators.values():
        sim.time = 1
    tsim.run(show_progress=True)
    tsim.save(f"index_{i}")
"""
[29]:
'\nfor i in [3.9]:\n    norm_energy = 1e5 # Energy of normalisation in units of GeV\n    min_energy = 1e2 # GeV\n    max_energy = 1e8 # GeV\n    phi_solver = PhiSolver(aeff, norm_energy, min_energy, max_energy, \n                           time=1, min_cosz=-1, max_cosz=1)\n    phi_norm = phi_solver(Nnu=2000, \n                          dec=30, # degrees\n                          index=i) # spectral index\n    phi_norm # GeV^-1 cm^-2 s^-1\n    point_power_law = PowerLawFlux(phi_norm, norm_energy, i, \n                                   min_energy, max_energy)\n    point_source = PointSource(point_power_law, z=0., coord=(np.pi, np.deg2rad(30)))\n    sources = [point_source]\n    tsim = TimeDependentSimulator(["IC86_I", "IC86_II"], sources)\n    for sim in tsim.simulators.values():\n        sim.time = 1\n    tsim.run(show_progress=True)\n    tsim.save(f"index_{i}")\n'
[ ]: