I tried to produce IceCube-Gen2 detector hits for fornax_2022 model with the following code:
#running ASTERIA simulation for the given model mass = 26.00 distance = 10.0 model_dict = {'name': 'Fornax_2022', 'param':{ 'progenitor_mass': mass * u.Msun} } process = [interactions.InvBetaPar] #we only care about IBD for this project. xform = 'AdiabaticMSW' normal_sim = Simulation(model=model_dict, distance=distance * u.kpc, interactions=process, Emin=0*u.MeV, Emax=100*u.MeV, dE=1*u.MeV, tmin=-10*u.s, tmax=20*u.s, dt=1*u.ms, mixing_scheme=xform, hierarchy="Normal", detector_scope='Gen2') normal_sim.run()
However, ASTERIA printed this error message:
`WARNING:root:Model 'Fornax_2022' lacks one or more of the following attributes: 'luminosity', 'meanE', 'pinch'. Some ASTERIA methods may not function fully
WARNING:root:Model 'Fornax_2022' detected. Special compatibility mode enabled.
Expect a reduction in performance and increase in simulation run times.
KeyError Traceback (most recent call last)
Cell In[73], line 17
9 xform = 'AdiabaticMSW'
10 normal_sim = Simulation(model=model_dict,
11 distance=distance * u.kpc,
12 interactions=process,
(...)
15 mixing_scheme=xform, hierarchy="Normal",
16 detector_scope='Gen2')
---> 17 normal_sim.run()
File ~/jupyter_env/lib/python3.13/site-packages/asteria/simulation.py:291, in Simulation.run(self, load_simulation)
288 raise NotImplementedError('Simulation loading is not currently implemented')
290 self.compute_photon_spectra()
--> 291 self.compute_energy_per_vol()
292 return
File ~/jupyter_env/lib/python3.13/site-packages/asteria/simulation.py:394, in Simulation.compute_energy_per_vol(self, part_size)
392 if part_size < self.time.size:
393 while idx + part_size < self.time.size:
--> 394 spectrum = self.get_combined_spectrum(self.time[idx:idx + part_size], self.energy, flavor,
395 self._mixing)
396 result[idx:idx + part_size] = np.trapz(spectrum, self.energy.value, axis=1)
397 idx += part_size
File ~/jupyter_env/lib/python3.13/site-packages/asteria/simulation.py:350, in Simulation.get_combined_spectrum(self, t, E, flavor, mixing)
348 nu_spectrum = np.zeros(shape=(t.size, E.size))
349 for coeff, _flavor in zip(coeffs, (flavor, cflavor)):
--> 350 alpha = self.source.alpha(t, _flavor)
351 meanE = self.source.meanE(t, _flavor).to(u.MeV).value
353 alpha[alpha < 0] = 0
File ~/jupyter_env/lib/python3.13/site-packages/asteria/source.py:141, in Source.alpha(self, t, flavor)
127 """Return source pinching paramter alpha at time t for a given flavor.
128 Parameters
129 ----------
(...)
138 Source pinching parameter (unitless).
139 """
140 # TODO Checks for units/unitless inputs
--> 141 return np.nan_to_num(self._interp_pinchflavor)
KeyError: <Flavor.NU_E: 0>`
Looks like due to the absence of pinch parameter in the fornax_2022 model, it failed to produce detector hits. Spencer provided a nice workaround that I will copy here:
- To start, load the SNEWPY Fornax model. Using the model.get_initial_spectra() method, obtain the neutrino energy spectrum. Using the spectrum, compute the pinch parameter using Eqs. 2-3 of https://arxiv.org/pdf/2109.08188.
- Load the model mean energy, luminosity, and pinch parameter into SNEWPY's Analytic3Species model (See SNEWPY/docs/nb/AnalyticFluence.ipynb) and save it. Then, in your ASTERIA simulation, load that model using the following to declare it
model_dict = { 'name': 'Analytic3Species', 'param':{ 'filename': '<path_to_input_file>' } }
I tried to produce IceCube-Gen2 detector hits for fornax_2022 model with the following code:
#running ASTERIA simulation for the given model mass = 26.00 distance = 10.0 model_dict = {'name': 'Fornax_2022', 'param':{ 'progenitor_mass': mass * u.Msun} } process = [interactions.InvBetaPar] #we only care about IBD for this project. xform = 'AdiabaticMSW' normal_sim = Simulation(model=model_dict, distance=distance * u.kpc, interactions=process, Emin=0*u.MeV, Emax=100*u.MeV, dE=1*u.MeV, tmin=-10*u.s, tmax=20*u.s, dt=1*u.ms, mixing_scheme=xform, hierarchy="Normal", detector_scope='Gen2') normal_sim.run()However, ASTERIA printed this error message:
`WARNING:root:Model 'Fornax_2022' lacks one or more of the following attributes: 'luminosity', 'meanE', 'pinch'. Some ASTERIA methods may not function fully
WARNING:root:Model 'Fornax_2022' detected. Special compatibility mode enabled.
Expect a reduction in performance and increase in simulation run times.
KeyError Traceback (most recent call last)
Cell In[73], line 17
9 xform = 'AdiabaticMSW'
10 normal_sim = Simulation(model=model_dict,
11 distance=distance * u.kpc,
12 interactions=process,
(...)
15 mixing_scheme=xform, hierarchy="Normal",
16 detector_scope='Gen2')
---> 17 normal_sim.run()
File ~/jupyter_env/lib/python3.13/site-packages/asteria/simulation.py:291, in Simulation.run(self, load_simulation)
288 raise NotImplementedError('Simulation loading is not currently implemented')
290 self.compute_photon_spectra()
--> 291 self.compute_energy_per_vol()
292 return
File ~/jupyter_env/lib/python3.13/site-packages/asteria/simulation.py:394, in Simulation.compute_energy_per_vol(self, part_size)
392 if part_size < self.time.size:
393 while idx + part_size < self.time.size:
--> 394 spectrum = self.get_combined_spectrum(self.time[idx:idx + part_size], self.energy, flavor,
395 self._mixing)
396 result[idx:idx + part_size] = np.trapz(spectrum, self.energy.value, axis=1)
397 idx += part_size
File ~/jupyter_env/lib/python3.13/site-packages/asteria/simulation.py:350, in Simulation.get_combined_spectrum(self, t, E, flavor, mixing)
348 nu_spectrum = np.zeros(shape=(t.size, E.size))
349 for coeff, _flavor in zip(coeffs, (flavor, cflavor)):
--> 350 alpha = self.source.alpha(t, _flavor)
351 meanE = self.source.meanE(t, _flavor).to(u.MeV).value
353 alpha[alpha < 0] = 0
File ~/jupyter_env/lib/python3.13/site-packages/asteria/source.py:141, in Source.alpha(self, t, flavor)
127 """Return source pinching paramter alpha at time t for a given flavor.
128 Parameters
129 ----------
(...)
138 Source pinching parameter (unitless).
139 """
140 # TODO Checks for units/unitless inputs
--> 141 return np.nan_to_num(self._interp_pinchflavor)
KeyError: <Flavor.NU_E: 0>`
Looks like due to the absence of pinch parameter in the fornax_2022 model, it failed to produce detector hits. Spencer provided a nice workaround that I will copy here:
model_dict = { 'name': 'Analytic3Species', 'param':{ 'filename': '<path_to_input_file>' } }