Skip to content

snewpy compatibility issue for flavor transformation. #152

@waleey

Description

@waleey

Changes made to snewpy after the v1.6 version release has significant changes and it breaks ASTERA simulation. For example, I tried to run the following simulation:

model = {'name': 'Nakazato_2013', 'param':{ 'progenitor_mass': 13 * u.Msun, 'revival_time': 300 * [u.ms](http://u.ms/), 'metallicity': 0.004, 'eos': 'shen'} } xform = 'NoTransformation' nmo = 'Normal' sim = Simulation(model=model, distance=10 * u.kpc, Emin=0*u.MeV, Emax=100*u.MeV, dE=1*u.MeV, tmin=-10*u.s, tmax=20*u.s, dt=1*[u.ms](http://u.ms/), mixing_scheme=xform, hierarchy=nmo) sim.run()

And received the following error:

`/Users/walu/icecube/energy_constraints/snecc/snecc_functions.py:1114: SyntaxWarning: invalid escape sequence '\l'
"""
WARNING: QE weights are currently not applied.


AttributeError Traceback (most recent call last)
Cell In[12], line 15
9 nmo = 'Normal'
10 sim = Simulation(model=model,
11 distance=10 * u.kpc,
12 Emin=0u.MeV, Emax=100u.MeV, dE=1u.MeV,
13 tmin=-10
u.s, tmax=20u.s, dt=1u.ms,
14 mixing_scheme=xform, hierarchy=nmo)
---> 15 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:335, in Simulation.get_combined_spectrum(self, t, E, flavor, mixing)
333 if flavor.is_neutrino:
334 if flavor.is_electron:
--> 335 coeffs = mixing.prob_ee(t, E), mixing.prob_ex(t, E)
336 cflavor = Flavor.NU_X
337 else:

AttributeError: 'NoTransformation' object has no attribute 'prob_ee'`

I am using ASTERIA 1.8.0dev and snewpy 1.6, but I had pulled in the changes from a current branch under development.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions