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.18577999134664, 24.51408397397894]

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
/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/scipy/optimize/_minpack_py.py:178: RuntimeWarning: The iteration is not making good progress, as measured by the
  improvement from the last ten iterations.
  warnings.warn(msg, RuntimeWarning)
[7]:
1.1444338237452659e-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:01<00:00, 148.18it/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, 1.62723177e+03, 2.67854713e+02,
        2.70530741e+02, 9.34743516e+02, 1.81460670e+02, 5.40258039e+02,
        6.55468755e+02, 5.75003650e+02, 1.26075824e+02, 4.85847409e+02,
        2.82589224e+02, 7.96531291e+02, 4.12075792e+02, 3.12642591e+02,
        1.65938649e+03, 6.77278871e+02, 4.99813029e+02, 6.13118787e+02,
        3.37696378e+02, 7.65201578e+02, 5.92951977e+02, 1.23201044e+02,
        1.89469848e+02, 1.13214053e+03, 4.72584760e+02, 1.31327456e+02,
        1.02745485e+03, 4.91791232e+02, 9.44514953e+02, 2.87311325e+03,
        8.21048861e+02, 3.91184938e+02, 4.30137055e+02, 5.29922706e+02,
        4.00587635e+02, 5.29919795e+02, 8.76724899e+02, 1.48299500e+02,
        5.72771988e+02, 8.36602314e+02, 1.14681697e+04, 2.44752024e+02,
        3.22245652e+02, 1.02005339e+03, 3.18125764e+02, 1.66246099e+03,
        8.74941849e+02, 1.36462011e+03, 1.07369025e+03, 2.70848742e+02,
        3.18249906e+02, 1.71764214e+03, 4.08723343e+03, 3.58361899e+02,
        1.37478269e+02, 2.97152214e+02, 1.94141437e+02, 5.22309151e+02,
        1.83344084e+02, 2.05133385e+02, 1.17666210e+03, 1.75173781e+03,
        4.17638181e+02, 2.93957666e+02, 5.93200498e+02, 1.75312242e+02,
        1.83150316e+02, 1.06684211e+03, 1.72164010e+02, 1.35537496e+03,
        5.13959376e+02, 1.70974415e+03, 6.70479213e+02, 7.40572983e+02,
        1.10229533e+02, 2.99456764e+03, 6.86612595e+02, 2.55393545e+03,
        3.72667504e+02, 1.29488188e+02, 6.31630310e+02, 1.02579774e+03,
        3.29540598e+02, 4.25228671e+02, 6.77594815e+02, 4.44957907e+02,
        6.97754095e+03, 2.37937436e+02, 1.28082738e+03, 1.41709525e+02,
        3.98169839e+02, 4.05308978e+02, 3.46877306e+02, 1.57425592e+02,
        1.98626686e+02, 2.97095507e+02, 1.20618178e+02, 1.01980968e+02,
        6.20139953e+02, 3.19540816e+02, 2.10449500e+02, 1.13580156e+03,
        8.41845940e+02, 1.96038638e+02, 1.06209981e+03, 5.45361725e+02,
        1.84471257e+02, 7.99520893e+02, 4.40335942e+02, 6.93721148e+02,
        7.28053940e+02, 2.21926825e+02, 2.61556126e+02, 1.65237017e+02,
        5.71202456e+02, 1.09426097e+02, 3.23701588e+02, 3.19474690e+02,
        2.40385568e+02, 1.78635264e+02, 1.19881449e+03, 2.63517743e+02,
        4.06868552e+02, 2.66571987e+02, 2.01011583e+02, 1.37241110e+03,
        6.67508730e+02, 8.01605148e+03, 2.32136932e+02, 1.59438339e+03,
        1.05395523e+03, 2.28668902e+03, 1.35765084e+03, 5.24799053e+02,
        4.93518719e+02, 6.90747069e+02, 4.89414748e+02, 1.25429843e+03,
        2.20727361e+03, 5.46678073e+03, 1.40921377e+03, 2.64497075e+02,
        3.99558627e+03, 2.56225571e+02, 1.32036801e+02, 1.03610586e+03,
        1.02781888e+02, 4.42497604e+02, 1.81710343e+03, 7.45241154e+02,
        2.92215226e+02, 1.93830572e+02, 8.00767434e+02, 3.79451176e+03,
        4.34868956e+02, 8.32340317e+02, 2.10793287e+03, 5.52735286e+03,
        1.48117020e+04, 3.11953075e+03, 2.12032186e+02, 2.03660542e+03,
        5.67091277e+03, 5.36020601e+04, 3.68926783e+03, 1.70175266e+05,
        1.91436414e+03, 4.04042977e+03, 2.89062509e+03, 1.64153158e+03,
        2.64551029e+03, 6.91903387e+04, 3.50694462e+03, 3.13186643e+04,
        5.84675136e+03, 1.10803981e+03, 2.12842765e+05, 4.19174300e+02,
        4.27329763e+02, 2.77406889e+03, 2.47314709e+03, 4.91004812e+04])}
[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 0x7fb9ffbb00a0>
../_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("IC86_I", "IC86_II")
uptime._time_obs("IC86_II"), uptime.time_span()["IC86_II"]
[20]:
(0.9089039325939252, 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:01<00:00, 152.00it/s]
Sampling: 100%|██████████| 316/316 [00:01<00:00, 204.44it/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.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, 2.72573059e+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.04660493e+02, 3.84705606e+02, 1.17600587e+03, 2.76326984e+03,
        6.17634418e+03, 3.71575557e+02, 1.88668614e+02, 3.26333895e+02,
        3.28943364e+02, 9.14343772e+02, 1.61466056e+02, 1.30527134e+03,
        2.81243362e+03, 1.00848477e+02, 4.71939113e+02, 1.70656907e+02,
        8.04200252e+02, 2.77283932e+03, 1.15309446e+02, 7.95225683e+02,
        1.96062714e+02, 1.17703725e+02, 1.62633405e+02, 2.56200449e+02,
        2.74244294e+03, 4.34035676e+02, 2.00867160e+02, 2.52191398e+02,
        7.44179973e+02, 6.79013026e+02, 1.38371178e+03, 2.61397527e+03,
        3.01582267e+03, 2.64384801e+02, 8.65082757e+03, 6.67306896e+02,
        4.87773883e+03, 2.16892914e+02, 7.74109796e+02, 1.73524879e+02,
        1.71691251e+02, 3.33247404e+03, 3.05936982e+02, 2.96563949e+02,
        1.30269473e+03, 1.04160275e+02, 3.68018893e+02, 4.05294801e+02,
        5.54941007e+02, 9.44774500e+02, 1.66277067e+02, 2.12132021e+02,
        4.65868562e+02, 4.78385125e+02, 4.85607169e+02, 3.27908624e+02,
        7.85856766e+02, 1.09129157e+03, 2.05621700e+02, 2.48631015e+02,
        3.89901431e+02, 9.20401865e+02, 3.50262569e+03, 2.27222219e+02,
        4.24802243e+02, 2.04913736e+02, 4.16743937e+02, 1.09135233e+03,
        1.14775033e+03, 1.99803132e+03, 2.52999711e+03, 1.72203207e+03,
        2.63141690e+02, 1.91392461e+03, 1.95222907e+02, 1.09789994e+02,
        5.86089797e+02, 2.70617259e+02, 4.36941957e+02, 2.60185301e+03,
        2.42439441e+03, 4.14079807e+02, 4.14744644e+02, 2.92599180e+02,
        1.49527817e+02, 3.64581285e+02, 3.83547677e+02, 2.12219621e+02,
        2.80842451e+02, 4.08738294e+02, 2.92280910e+02, 3.05541855e+02,
        1.92892098e+02, 2.07903207e+03, 4.41726445e+02, 1.60137212e+02,
        1.16573766e+03, 3.73190578e+02, 2.11205001e+03, 2.35902123e+02,
        3.18779685e+02, 4.15874335e+02, 2.65208487e+02, 4.66596299e+02,
        8.38087196e+02, 2.70265907e+03, 3.48286401e+03, 7.74651212e+02,
        4.23942692e+02, 8.87594596e+02, 3.00654365e+04, 1.72340970e+02,
        1.10085467e+02, 7.41920184e+02, 8.99693656e+02, 4.51942939e+02,
        4.81262508e+02, 1.16847144e+04, 9.26222423e+02, 2.40438433e+03,
        2.20042024e+03, 4.18426976e+03, 1.54526874e+02, 2.14618224e+03,
        2.26750015e+02, 2.29020884e+03, 1.88861299e+02, 5.43627189e+02,
        1.67950232e+02, 1.07190285e+02, 3.49373166e+03, 2.17298555e+02,
        1.90882402e+02, 3.98897330e+02, 3.97436524e+02, 6.00214973e+03,
        6.54466544e+02, 1.66984183e+02, 3.27306141e+02, 3.25211275e+02,
        1.68155950e+02, 1.11732218e+02, 3.14289030e+02, 2.60500459e+02,
        1.28397128e+02, 2.17549968e+02, 1.90751382e+04, 6.02117890e+02,
        1.26144262e+03, 4.21769487e+03, 1.75857140e+02, 2.99144055e+02,
        1.76558712e+04, 1.97404054e+03, 4.64038369e+02, 9.95295654e+02,
        2.08181310e+02, 2.29078878e+02, 2.32434564e+04, 2.64630456e+02,
        6.81094731e+02, 6.92788074e+02, 1.92092867e+03, 4.60434838e+02,
        7.71164128e+02, 1.10678300e+03, 3.02568463e+02, 3.34082519e+02,
        2.87030306e+02, 4.50790903e+02, 1.50400379e+04, 3.24640961e+03,
        9.52035252e+02, 1.79290877e+02, 4.33930320e+02, 1.15556128e+02,
        1.05184616e+02, 1.03885716e+02, 1.70904279e+02, 6.79075476e+02,
        2.34039219e+02, 1.74550147e+03, 2.12171071e+05, 2.13235613e+03,
        1.08200382e+04, 3.11780603e+03, 3.21631132e+03, 1.50821427e+04,
        3.52352876e+03, 3.32315190e+04, 4.76279003e+03, 8.60589429e+02,
        6.92731226e+04, 6.36340720e+02, 1.54273659e+03, 1.70645336e+04,
        2.23550706e+03, 7.50731483e+02, 2.71846325e+04, 1.99720753e+02,
        2.94404060e+04, 4.58889143e+02, 2.01366016e+04, 2.45754440e+03,
        3.37378962e+02, 1.29460706e+04, 1.02258266e+04, 1.54821664e+04,
        4.32042792e+04, 2.05901552e+03, 2.28709325e+03, 6.96321355e+03,
        2.29653483e+04, 3.51338945e+02, 2.00088521e+04, 1.00413163e+03,
        1.27876969e+04]),
 'IC86_II': array([  665.17799971,   169.20224047,  2704.76856955,   222.53233004,
          719.42338092,   113.76638539,  1306.03424485,   558.38820466,
         3687.46173024,   215.58493772,   280.95879564,   133.30873344,
          301.89838943,  1398.13513754,   767.65278968,   118.64413893,
          160.41866721,   118.92767322,   194.1523479 ,   120.64765736,
         1848.92419433,   123.8664367 ,   185.02169194,   327.92799311,
         1037.84104796,   266.12184725,   159.7771837 ,   430.93367644,
          518.3734617 ,   750.98295075,  1049.23778098,   264.52434044,
          441.57855045,   407.24088006,   932.72646932,   217.33690464,
          668.48709395,   840.3069546 ,   221.64523495,   129.24528277,
          201.30348814,   813.91844844,   165.42668338,  2392.19344772,
          306.01672199,   619.26394335,   205.54118511,   183.54452834,
          444.54702491,   286.7308729 ,  1103.89935252,   125.32529652,
         4221.01626458,  6159.45017066,   189.97672756,   151.52806977,
          264.03969804,   409.40883107,  1370.78069197,  1073.11171141,
          120.97175792,   202.50149386,  1074.16230111,   707.67977827,
          167.33680634,   304.80286617,   174.82402499,  1178.99103051,
          260.61484975,   704.4584648 ,   112.63250037,   374.47334873,
          436.16340875,   144.31224983,   681.88996726,   306.18139883,
          187.09052642,  1045.77839849,   338.45237683,   113.81121899,
          554.22164427,   280.23629107,   379.65455852,   165.72335547,
          159.8683858 ,  1004.30764957,   106.34627805,   163.15374225,
          716.31384524,   384.22744342,   467.50601569,   190.80454181,
          216.94108105,   416.99727371,   168.0905097 ,   161.33563558,
          466.36233206,  1167.84633208,   176.7223084 ,   627.31400085,
          356.98882519,  6285.30740961,   838.67204211,   186.52119779,
          278.24304309, 29864.37775134,   111.06740162,   179.42177353,
          171.20408886,   310.4591679 ,   158.94575503,   181.60940071,
          253.04695364,  1053.56576923,  1307.69889586,  1208.04514262,
          634.40252458,   102.97534251,   462.34736935,   588.58037011,
          129.80819391,   570.16105241,   204.7735844 ,  1884.27360298,
         1040.51986105,   176.14371957,  1285.92841635,   315.15457001,
          242.40687436,  1025.75297438,   109.81764027,   150.17963854,
          660.6902692 ,   264.5571498 ,   171.13200095,   234.6779858 ,
          757.16327404,  1047.43788847,   117.88453721,   275.86734678,
          273.08905125,  2640.2094381 ,  2253.81021821,   413.21565759,
          338.81161596,   493.44180041,  1739.91932914,   214.10729084,
          183.65542837,   536.77396307,   440.71671286,  3069.47692519,
          539.20624152,   318.97481387,  1160.03726084,   318.66308187,
          518.00239252,   186.60279408,   180.6676692 ,   565.24556756,
          109.34846318,   158.05166292,   294.35893225,   206.80785434,
        26175.56870109,   817.40499178,   295.22200044,  1352.36210133,
          114.47630726,  1170.56077299,  3187.49911199,   777.55454508,
         6729.62051088,  1212.0632022 ,  1608.93956318,   180.43329609,
          274.13763443,   271.40221337,   148.32800478,   780.40790433,
          629.93704299,   849.59835782,   214.81348121,  1347.01170003,
         1058.41920588,   301.32661781,   289.93859589,   108.88803252,
          658.57988291,   184.30192209,   662.57223211,   109.75416985,
         1865.35570976,   278.13226164,   923.53771418,   300.92900239,
         1029.53347916,   196.39103338,   253.23194208,  1164.73115683,
         4917.24372821,   636.33882215,   354.58479897,  1088.53462058,
          270.05701745,   377.15536744,  1938.24868659,   254.24823487,
          173.84678917,   251.16417039,   192.61306574,   419.50709591,
          628.86089756,  1152.82969815,   896.2325109 ,   696.42648681,
         1717.55668084,   305.78921079,   337.25324592,   172.45712477,
          693.54556435,   188.71621532,  4663.91416639,   473.36988195,
          115.42204314,  2379.70097025,   257.64850385,   735.81786299,
          164.25801428,  8109.58633028,   861.49657765,   111.40882983,
          725.26690219,   170.68372757,   136.49957361,   314.10713994,
         1476.50899661,   121.18799382,  1380.7462448 ,  1874.65024421,
         1078.71253455,  1794.23243858,   117.4010008 ,  1187.00047048,
          589.71414514,   192.33678829,   437.82329142,   657.01433569,
          242.99141263,   271.22233494, 12683.1087396 ,   408.29075101,
          406.04040503,  1813.76569574,   775.45442419,   368.59531327,
         1256.2679978 ,  1896.43587262,  1075.0111594 ,  1489.80344627,
          275.20703124,   540.35160675,   408.65471764,   450.73095688,
          223.05041231,   364.17793445,   108.50505695,   221.84454619,
          778.27632446,   117.45806125,  1300.33860539,   272.76603908,
          649.08534384,  1152.08021331,   234.58879622,  1615.53833905,
          173.85925604, 76408.66548679,  1987.78756539,  2061.21885186,
         4299.03682388, 24664.82340051, 26276.70028567,   221.902938  ,
         6175.69235272,   265.10753412,  1947.87805191,   639.12185654,
        10923.27083119, 11003.76235017, 15527.57218007,   786.28909582,
         5488.42991934,  4608.48387777,  2086.14164665, 33050.85440657,
          106.91961995, 32176.94562562,   635.66803767, 31049.25577361,
         4296.20758203,  2599.95397702,   854.68120812, 19196.25790662,
         3433.75660866,  5613.30383391,  4038.86628583,   445.72990803,
        25146.86829523,   700.05722028,   883.18722375, 91849.78186613,
        11784.98057907,   884.63121066,   967.43195317,   290.07242411])}
[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.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, 2.72573059e+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.04660493e+02, 3.84705606e+02, 1.17600587e+03, 2.76326984e+03,
        6.17634418e+03, 3.71575557e+02, 1.88668614e+02, 3.26333895e+02,
        3.28943364e+02, 9.14343772e+02, 1.61466056e+02, 1.30527134e+03,
        2.81243362e+03, 1.00848477e+02, 4.71939113e+02, 1.70656907e+02,
        8.04200252e+02, 2.77283932e+03, 1.15309446e+02, 7.95225683e+02,
        1.96062714e+02, 1.17703725e+02, 1.62633405e+02, 2.56200449e+02,
        2.74244294e+03, 4.34035676e+02, 2.00867160e+02, 2.52191398e+02,
        7.44179973e+02, 6.79013026e+02, 1.38371178e+03, 2.61397527e+03,
        3.01582267e+03, 2.64384801e+02, 8.65082757e+03, 6.67306896e+02,
        4.87773883e+03, 2.16892914e+02, 7.74109796e+02, 1.73524879e+02,
        1.71691251e+02, 3.33247404e+03, 3.05936982e+02, 2.96563949e+02,
        1.30269473e+03, 1.04160275e+02, 3.68018893e+02, 4.05294801e+02,
        5.54941007e+02, 9.44774500e+02, 1.66277067e+02, 2.12132021e+02,
        4.65868562e+02, 4.78385125e+02, 4.85607169e+02, 3.27908624e+02,
        7.85856766e+02, 1.09129157e+03, 2.05621700e+02, 2.48631015e+02,
        3.89901431e+02, 9.20401865e+02, 3.50262569e+03, 2.27222219e+02,
        4.24802243e+02, 2.04913736e+02, 4.16743937e+02, 1.09135233e+03,
        1.14775033e+03, 1.99803132e+03, 2.52999711e+03, 1.72203207e+03,
        2.63141690e+02, 1.91392461e+03, 1.95222907e+02, 1.09789994e+02,
        5.86089797e+02, 2.70617259e+02, 4.36941957e+02, 2.60185301e+03,
        2.42439441e+03, 4.14079807e+02, 4.14744644e+02, 2.92599180e+02,
        1.49527817e+02, 3.64581285e+02, 3.83547677e+02, 2.12219621e+02,
        2.80842451e+02, 4.08738294e+02, 2.92280910e+02, 3.05541855e+02,
        1.92892098e+02, 2.07903207e+03, 4.41726445e+02, 1.60137212e+02,
        1.16573766e+03, 3.73190578e+02, 2.11205001e+03, 2.35902123e+02,
        3.18779685e+02, 4.15874335e+02, 2.65208487e+02, 4.66596299e+02,
        8.38087196e+02, 2.70265907e+03, 3.48286401e+03, 7.74651212e+02,
        4.23942692e+02, 8.87594596e+02, 3.00654365e+04, 1.72340970e+02,
        1.10085467e+02, 7.41920184e+02, 8.99693656e+02, 4.51942939e+02,
        4.81262508e+02, 1.16847144e+04, 9.26222423e+02, 2.40438433e+03,
        2.20042024e+03, 4.18426976e+03, 1.54526874e+02, 2.14618224e+03,
        2.26750015e+02, 2.29020884e+03, 1.88861299e+02, 5.43627189e+02,
        1.67950232e+02, 1.07190285e+02, 3.49373166e+03, 2.17298555e+02,
        1.90882402e+02, 3.98897330e+02, 3.97436524e+02, 6.00214973e+03,
        6.54466544e+02, 1.66984183e+02, 3.27306141e+02, 3.25211275e+02,
        1.68155950e+02, 1.11732218e+02, 3.14289030e+02, 2.60500459e+02,
        1.28397128e+02, 2.17549968e+02, 1.90751382e+04, 6.02117890e+02,
        1.26144262e+03, 4.21769487e+03, 1.75857140e+02, 2.99144055e+02,
        1.76558712e+04, 1.97404054e+03, 4.64038369e+02, 9.95295654e+02,
        2.08181310e+02, 2.29078878e+02, 2.32434564e+04, 2.64630456e+02,
        6.81094731e+02, 6.92788074e+02, 1.92092867e+03, 4.60434838e+02,
        7.71164128e+02, 1.10678300e+03, 3.02568463e+02, 3.34082519e+02,
        2.87030306e+02, 4.50790903e+02, 1.50400379e+04, 3.24640961e+03,
        9.52035252e+02, 1.79290877e+02, 4.33930320e+02, 1.15556128e+02,
        1.05184616e+02, 1.03885716e+02, 1.70904279e+02, 6.79075476e+02,
        2.34039219e+02, 1.74550147e+03, 2.12171071e+05, 2.13235613e+03,
        1.08200382e+04, 3.11780603e+03, 3.21631132e+03, 1.50821427e+04,
        3.52352876e+03, 3.32315190e+04, 4.76279003e+03, 8.60589429e+02,
        6.92731226e+04, 6.36340720e+02, 1.54273659e+03, 1.70645336e+04,
        2.23550706e+03, 7.50731483e+02, 2.71846325e+04, 1.99720753e+02,
        2.94404060e+04, 4.58889143e+02, 2.01366016e+04, 2.45754440e+03,
        3.37378962e+02, 1.29460706e+04, 1.02258266e+04, 1.54821664e+04,
        4.32042792e+04, 2.05901552e+03, 2.28709325e+03, 6.96321355e+03,
        2.29653483e+04, 3.51338945e+02, 2.00088521e+04, 1.00413163e+03,
        1.27876969e+04]),
 'IC86_II': array([  665.17799971,   169.20224047,  2704.76856955,   222.53233004,
          719.42338092,   113.76638539,  1306.03424485,   558.38820466,
         3687.46173024,   215.58493772,   280.95879564,   133.30873344,
          301.89838943,  1398.13513754,   767.65278968,   118.64413893,
          160.41866721,   118.92767322,   194.1523479 ,   120.64765736,
         1848.92419433,   123.8664367 ,   185.02169194,   327.92799311,
         1037.84104796,   266.12184725,   159.7771837 ,   430.93367644,
          518.3734617 ,   750.98295075,  1049.23778098,   264.52434044,
          441.57855045,   407.24088006,   932.72646932,   217.33690464,
          668.48709395,   840.3069546 ,   221.64523495,   129.24528277,
          201.30348814,   813.91844844,   165.42668338,  2392.19344772,
          306.01672199,   619.26394335,   205.54118511,   183.54452834,
          444.54702491,   286.7308729 ,  1103.89935252,   125.32529652,
         4221.01626458,  6159.45017066,   189.97672756,   151.52806977,
          264.03969804,   409.40883107,  1370.78069197,  1073.11171141,
          120.97175792,   202.50149386,  1074.16230111,   707.67977827,
          167.33680634,   304.80286617,   174.82402499,  1178.99103051,
          260.61484975,   704.4584648 ,   112.63250037,   374.47334873,
          436.16340875,   144.31224983,   681.88996726,   306.18139883,
          187.09052642,  1045.77839849,   338.45237683,   113.81121899,
          554.22164427,   280.23629107,   379.65455852,   165.72335547,
          159.8683858 ,  1004.30764957,   106.34627805,   163.15374225,
          716.31384524,   384.22744342,   467.50601569,   190.80454181,
          216.94108105,   416.99727371,   168.0905097 ,   161.33563558,
          466.36233206,  1167.84633208,   176.7223084 ,   627.31400085,
          356.98882519,  6285.30740961,   838.67204211,   186.52119779,
          278.24304309, 29864.37775134,   111.06740162,   179.42177353,
          171.20408886,   310.4591679 ,   158.94575503,   181.60940071,
          253.04695364,  1053.56576923,  1307.69889586,  1208.04514262,
          634.40252458,   102.97534251,   462.34736935,   588.58037011,
          129.80819391,   570.16105241,   204.7735844 ,  1884.27360298,
         1040.51986105,   176.14371957,  1285.92841635,   315.15457001,
          242.40687436,  1025.75297438,   109.81764027,   150.17963854,
          660.6902692 ,   264.5571498 ,   171.13200095,   234.6779858 ,
          757.16327404,  1047.43788847,   117.88453721,   275.86734678,
          273.08905125,  2640.2094381 ,  2253.81021821,   413.21565759,
          338.81161596,   493.44180041,  1739.91932914,   214.10729084,
          183.65542837,   536.77396307,   440.71671286,  3069.47692519,
          539.20624152,   318.97481387,  1160.03726084,   318.66308187,
          518.00239252,   186.60279408,   180.6676692 ,   565.24556756,
          109.34846318,   158.05166292,   294.35893225,   206.80785434,
        26175.56870109,   817.40499178,   295.22200044,  1352.36210133,
          114.47630726,  1170.56077299,  3187.49911199,   777.55454508,
         6729.62051088,  1212.0632022 ,  1608.93956318,   180.43329609,
          274.13763443,   271.40221337,   148.32800478,   780.40790433,
          629.93704299,   849.59835782,   214.81348121,  1347.01170003,
         1058.41920588,   301.32661781,   289.93859589,   108.88803252,
          658.57988291,   184.30192209,   662.57223211,   109.75416985,
         1865.35570976,   278.13226164,   923.53771418,   300.92900239,
         1029.53347916,   196.39103338,   253.23194208,  1164.73115683,
         4917.24372821,   636.33882215,   354.58479897,  1088.53462058,
          270.05701745,   377.15536744,  1938.24868659,   254.24823487,
          173.84678917,   251.16417039,   192.61306574,   419.50709591,
          628.86089756,  1152.82969815,   896.2325109 ,   696.42648681,
         1717.55668084,   305.78921079,   337.25324592,   172.45712477,
          693.54556435,   188.71621532,  4663.91416639,   473.36988195,
          115.42204314,  2379.70097025,   257.64850385,   735.81786299,
          164.25801428,  8109.58633028,   861.49657765,   111.40882983,
          725.26690219,   170.68372757,   136.49957361,   314.10713994,
         1476.50899661,   121.18799382,  1380.7462448 ,  1874.65024421,
         1078.71253455,  1794.23243858,   117.4010008 ,  1187.00047048,
          589.71414514,   192.33678829,   437.82329142,   657.01433569,
          242.99141263,   271.22233494, 12683.1087396 ,   408.29075101,
          406.04040503,  1813.76569574,   775.45442419,   368.59531327,
         1256.2679978 ,  1896.43587262,  1075.0111594 ,  1489.80344627,
          275.20703124,   540.35160675,   408.65471764,   450.73095688,
          223.05041231,   364.17793445,   108.50505695,   221.84454619,
          778.27632446,   117.45806125,  1300.33860539,   272.76603908,
          649.08534384,  1152.08021331,   234.58879622,  1615.53833905,
          173.85925604, 76408.66548679,  1987.78756539,  2061.21885186,
         4299.03682388, 24664.82340051, 26276.70028567,   221.902938  ,
         6175.69235272,   265.10753412,  1947.87805191,   639.12185654,
        10923.27083119, 11003.76235017, 15527.57218007,   786.28909582,
         5488.42991934,  4608.48387777,  2086.14164665, 33050.85440657,
          106.91961995, 32176.94562562,   635.66803767, 31049.25577361,
         4296.20758203,  2599.95397702,   854.68120812, 19196.25790662,
         3433.75660866,  5613.30383391,  4038.86628583,   445.72990803,
        25146.86829523,   700.05722028,   883.18722375, 91849.78186613,
        11784.98057907,   884.63121066,   967.43195317,   290.07242411])}
[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.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, 2.72573059e+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.04660493e+02, 3.84705606e+02, 1.17600587e+03, 2.76326984e+03,
        6.17634418e+03, 3.71575557e+02, 1.88668614e+02, 3.26333895e+02,
        3.28943364e+02, 9.14343772e+02, 1.61466056e+02, 1.30527134e+03,
        2.81243362e+03, 1.00848477e+02, 4.71939113e+02, 1.70656907e+02,
        8.04200252e+02, 2.77283932e+03, 1.15309446e+02, 7.95225683e+02,
        1.96062714e+02, 1.17703725e+02, 1.62633405e+02, 2.56200449e+02,
        2.74244294e+03, 4.34035676e+02, 2.00867160e+02, 2.52191398e+02,
        7.44179973e+02, 6.79013026e+02, 1.38371178e+03, 2.61397527e+03,
        3.01582267e+03, 2.64384801e+02, 8.65082757e+03, 6.67306896e+02,
        4.87773883e+03, 2.16892914e+02, 7.74109796e+02, 1.73524879e+02,
        1.71691251e+02, 3.33247404e+03, 3.05936982e+02, 2.96563949e+02,
        1.30269473e+03, 1.04160275e+02, 3.68018893e+02, 4.05294801e+02,
        5.54941007e+02, 9.44774500e+02, 1.66277067e+02, 2.12132021e+02,
        4.65868562e+02, 4.78385125e+02, 4.85607169e+02, 3.27908624e+02,
        7.85856766e+02, 1.09129157e+03, 2.05621700e+02, 2.48631015e+02,
        3.89901431e+02, 9.20401865e+02, 3.50262569e+03, 2.27222219e+02,
        4.24802243e+02, 2.04913736e+02, 4.16743937e+02, 1.09135233e+03,
        1.14775033e+03, 1.99803132e+03, 2.52999711e+03, 1.72203207e+03,
        2.63141690e+02, 1.91392461e+03, 1.95222907e+02, 1.09789994e+02,
        5.86089797e+02, 2.70617259e+02, 4.36941957e+02, 2.60185301e+03,
        2.42439441e+03, 4.14079807e+02, 4.14744644e+02, 2.92599180e+02,
        1.49527817e+02, 3.64581285e+02, 3.83547677e+02, 2.12219621e+02,
        2.80842451e+02, 4.08738294e+02, 2.92280910e+02, 3.05541855e+02,
        1.92892098e+02, 2.07903207e+03, 4.41726445e+02, 1.60137212e+02,
        1.16573766e+03, 3.73190578e+02, 2.11205001e+03, 2.35902123e+02,
        3.18779685e+02, 4.15874335e+02, 2.65208487e+02, 4.66596299e+02,
        8.38087196e+02, 2.70265907e+03, 3.48286401e+03, 7.74651212e+02,
        4.23942692e+02, 8.87594596e+02, 3.00654365e+04, 1.72340970e+02,
        1.10085467e+02, 7.41920184e+02, 8.99693656e+02, 4.51942939e+02,
        4.81262508e+02, 1.16847144e+04, 9.26222423e+02, 2.40438433e+03,
        2.20042024e+03, 4.18426976e+03, 1.54526874e+02, 2.14618224e+03,
        2.26750015e+02, 2.29020884e+03, 1.88861299e+02, 5.43627189e+02,
        1.67950232e+02, 1.07190285e+02, 3.49373166e+03, 2.17298555e+02,
        1.90882402e+02, 3.98897330e+02, 3.97436524e+02, 6.00214973e+03,
        6.54466544e+02, 1.66984183e+02, 3.27306141e+02, 3.25211275e+02,
        1.68155950e+02, 1.11732218e+02, 3.14289030e+02, 2.60500459e+02,
        1.28397128e+02, 2.17549968e+02, 1.90751382e+04, 6.02117890e+02,
        1.26144262e+03, 4.21769487e+03, 1.75857140e+02, 2.99144055e+02,
        1.76558712e+04, 1.97404054e+03, 4.64038369e+02, 9.95295654e+02,
        2.08181310e+02, 2.29078878e+02, 2.32434564e+04, 2.64630456e+02,
        6.81094731e+02, 6.92788074e+02, 1.92092867e+03, 4.60434838e+02,
        7.71164128e+02, 1.10678300e+03, 3.02568463e+02, 3.34082519e+02,
        2.87030306e+02, 4.50790903e+02, 1.50400379e+04, 3.24640961e+03,
        9.52035252e+02, 1.79290877e+02, 4.33930320e+02, 1.15556128e+02,
        1.05184616e+02, 1.03885716e+02, 1.70904279e+02, 6.79075476e+02,
        2.34039219e+02, 1.74550147e+03, 2.12171071e+05, 2.13235613e+03,
        1.08200382e+04, 3.11780603e+03, 3.21631132e+03, 1.50821427e+04,
        3.52352876e+03, 3.32315190e+04, 4.76279003e+03, 8.60589429e+02,
        6.92731226e+04, 6.36340720e+02, 1.54273659e+03, 1.70645336e+04,
        2.23550706e+03, 7.50731483e+02, 2.71846325e+04, 1.99720753e+02,
        2.94404060e+04, 4.58889143e+02, 2.01366016e+04, 2.45754440e+03,
        3.37378962e+02, 1.29460706e+04, 1.02258266e+04, 1.54821664e+04,
        4.32042792e+04, 2.05901552e+03, 2.28709325e+03, 6.96321355e+03,
        2.29653483e+04, 3.51338945e+02, 2.00088521e+04, 1.00413163e+03,
        1.27876969e+04]),
 'IC86_II': array([  665.17799971,   169.20224047,  2704.76856955,   222.53233004,
          719.42338092,   113.76638539,  1306.03424485,   558.38820466,
         3687.46173024,   215.58493772,   280.95879564,   133.30873344,
          301.89838943,  1398.13513754,   767.65278968,   118.64413893,
          160.41866721,   118.92767322,   194.1523479 ,   120.64765736,
         1848.92419433,   123.8664367 ,   185.02169194,   327.92799311,
         1037.84104796,   266.12184725,   159.7771837 ,   430.93367644,
          518.3734617 ,   750.98295075,  1049.23778098,   264.52434044,
          441.57855045,   407.24088006,   932.72646932,   217.33690464,
          668.48709395,   840.3069546 ,   221.64523495,   129.24528277,
          201.30348814,   813.91844844,   165.42668338,  2392.19344772,
          306.01672199,   619.26394335,   205.54118511,   183.54452834,
          444.54702491,   286.7308729 ,  1103.89935252,   125.32529652,
         4221.01626458,  6159.45017066,   189.97672756,   151.52806977,
          264.03969804,   409.40883107,  1370.78069197,  1073.11171141,
          120.97175792,   202.50149386,  1074.16230111,   707.67977827,
          167.33680634,   304.80286617,   174.82402499,  1178.99103051,
          260.61484975,   704.4584648 ,   112.63250037,   374.47334873,
          436.16340875,   144.31224983,   681.88996726,   306.18139883,
          187.09052642,  1045.77839849,   338.45237683,   113.81121899,
          554.22164427,   280.23629107,   379.65455852,   165.72335547,
          159.8683858 ,  1004.30764957,   106.34627805,   163.15374225,
          716.31384524,   384.22744342,   467.50601569,   190.80454181,
          216.94108105,   416.99727371,   168.0905097 ,   161.33563558,
          466.36233206,  1167.84633208,   176.7223084 ,   627.31400085,
          356.98882519,  6285.30740961,   838.67204211,   186.52119779,
          278.24304309, 29864.37775134,   111.06740162,   179.42177353,
          171.20408886,   310.4591679 ,   158.94575503,   181.60940071,
          253.04695364,  1053.56576923,  1307.69889586,  1208.04514262,
          634.40252458,   102.97534251,   462.34736935,   588.58037011,
          129.80819391,   570.16105241,   204.7735844 ,  1884.27360298,
         1040.51986105,   176.14371957,  1285.92841635,   315.15457001,
          242.40687436,  1025.75297438,   109.81764027,   150.17963854,
          660.6902692 ,   264.5571498 ,   171.13200095,   234.6779858 ,
          757.16327404,  1047.43788847,   117.88453721,   275.86734678,
          273.08905125,  2640.2094381 ,  2253.81021821,   413.21565759,
          338.81161596,   493.44180041,  1739.91932914,   214.10729084,
          183.65542837,   536.77396307,   440.71671286,  3069.47692519,
          539.20624152,   318.97481387,  1160.03726084,   318.66308187,
          518.00239252,   186.60279408,   180.6676692 ,   565.24556756,
          109.34846318,   158.05166292,   294.35893225,   206.80785434,
        26175.56870109,   817.40499178,   295.22200044,  1352.36210133,
          114.47630726,  1170.56077299,  3187.49911199,   777.55454508,
         6729.62051088,  1212.0632022 ,  1608.93956318,   180.43329609,
          274.13763443,   271.40221337,   148.32800478,   780.40790433,
          629.93704299,   849.59835782,   214.81348121,  1347.01170003,
         1058.41920588,   301.32661781,   289.93859589,   108.88803252,
          658.57988291,   184.30192209,   662.57223211,   109.75416985,
         1865.35570976,   278.13226164,   923.53771418,   300.92900239,
         1029.53347916,   196.39103338,   253.23194208,  1164.73115683,
         4917.24372821,   636.33882215,   354.58479897,  1088.53462058,
          270.05701745,   377.15536744,  1938.24868659,   254.24823487,
          173.84678917,   251.16417039,   192.61306574,   419.50709591,
          628.86089756,  1152.82969815,   896.2325109 ,   696.42648681,
         1717.55668084,   305.78921079,   337.25324592,   172.45712477,
          693.54556435,   188.71621532,  4663.91416639,   473.36988195,
          115.42204314,  2379.70097025,   257.64850385,   735.81786299,
          164.25801428,  8109.58633028,   861.49657765,   111.40882983,
          725.26690219,   170.68372757,   136.49957361,   314.10713994,
         1476.50899661,   121.18799382,  1380.7462448 ,  1874.65024421,
         1078.71253455,  1794.23243858,   117.4010008 ,  1187.00047048,
          589.71414514,   192.33678829,   437.82329142,   657.01433569,
          242.99141263,   271.22233494, 12683.1087396 ,   408.29075101,
          406.04040503,  1813.76569574,   775.45442419,   368.59531327,
         1256.2679978 ,  1896.43587262,  1075.0111594 ,  1489.80344627,
          275.20703124,   540.35160675,   408.65471764,   450.73095688,
          223.05041231,   364.17793445,   108.50505695,   221.84454619,
          778.27632446,   117.45806125,  1300.33860539,   272.76603908,
          649.08534384,  1152.08021331,   234.58879622,  1615.53833905,
          173.85925604, 76408.66548679,  1987.78756539,  2061.21885186,
         4299.03682388, 24664.82340051, 26276.70028567,   221.902938  ,
         6175.69235272,   265.10753412,  1947.87805191,   639.12185654,
        10923.27083119, 11003.76235017, 15527.57218007,   786.28909582,
         5488.42991934,  4608.48387777,  2086.14164665, 33050.85440657,
          106.91961995, 32176.94562562,   635.66803767, 31049.25577361,
         4296.20758203,  2599.95397702,   854.68120812, 19196.25790662,
         3433.75660866,  5613.30383391,  4038.86628583,   445.72990803,
        25146.86829523,   700.05722028,   883.18722375, 91849.78186613,
        11784.98057907,   884.63121066,   967.43195317,   290.07242411])}
[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'
[ ]: