You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error:
AttributeError: 'Flavor' object has no attribute 'to'
Location:
Config_Example: cell [2]
Error trace:
AttributeError Traceback (most recent call last)
Input In [2], in <cell line: 6>()
5 fig, ax = plt.subplots(1, figsize = (6,7))
6 for flavor in sim.flavors:
----> 7 ax.plot(sim.time, sim.avg_dom_signal(flavor), label=flavor.name)
8 ax.legend()
9 ax.set(xlabel=r't-t$_{bounce}$ [s]', ylabel='Signal per DOM', xlim=(-0.025, 0.65))
File ~/ASTERIA/python/asteria/simulation.py:377, in Simulation.avg_dom_signal(self, dt, flavor)
375 if not dt:
376 dt = self._res_dt
--> 377 self.rebin_result(dt)
379 if flavor is None:
380 E_per_V = self._total_E_per_V_binned
File ~/ASTERIA/python/asteria/simulation.py:407, in Simulation.rebin_result(self, dt, offset, force_rebin)
404 if self._E_per_V is None or self._total_E_per_V is None:
405 raise RuntimeError("Simulation has not been executed yet, please use Simulation.run()")
--> 407 _dt = dt.to(u.s).value
408 _offset = int(offset.to(u.us).value + 0.5) # This is a guard against floating point errors
409 is_same_rebin = _dt == self._res_dt.to(u.s).value and _offset == int(self._res_offset.to(u.us).value + 0.5)
AttributeError: 'Flavor' object has no attribute 'to'
The text was updated successfully, but these errors were encountered:
EmmaTintinger
changed the title
Atribute Error in Config_Example Notebook
Attribute Error in Config_Example Notebook
Oct 9, 2023
Error:
AttributeError: 'Flavor' object has no attribute 'to'
Location:
Config_Example: cell [2]
Error trace:
AttributeError Traceback (most recent call last)
Input In [2], in <cell line: 6>()
5 fig, ax = plt.subplots(1, figsize = (6,7))
6 for flavor in sim.flavors:
----> 7 ax.plot(sim.time, sim.avg_dom_signal(flavor), label=flavor.name)
8 ax.legend()
9 ax.set(xlabel=r't-t$_{bounce}$ [s]', ylabel='Signal per DOM', xlim=(-0.025, 0.65))
File ~/ASTERIA/python/asteria/simulation.py:377, in Simulation.avg_dom_signal(self, dt, flavor)
375 if not dt:
376 dt = self._res_dt
--> 377 self.rebin_result(dt)
379 if flavor is None:
380 E_per_V = self._total_E_per_V_binned
File ~/ASTERIA/python/asteria/simulation.py:407, in Simulation.rebin_result(self, dt, offset, force_rebin)
404 if self._E_per_V is None or self._total_E_per_V is None:
405 raise RuntimeError("Simulation has not been executed yet, please use Simulation.run()")
--> 407 _dt = dt.to(u.s).value
408 _offset = int(offset.to(u.us).value + 0.5) # This is a guard against floating point errors
409 is_same_rebin = _dt == self._res_dt.to(u.s).value and _offset == int(self._res_offset.to(u.us).value + 0.5)
AttributeError: 'Flavor' object has no attribute 'to'
The text was updated successfully, but these errors were encountered: