Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attribute Error in Config_Example Notebook #90

Open
EmmaTintinger opened this issue Oct 9, 2023 · 0 comments
Open

Attribute Error in Config_Example Notebook #90

EmmaTintinger opened this issue Oct 9, 2023 · 0 comments

Comments

@EmmaTintinger
Copy link

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'

@EmmaTintinger EmmaTintinger changed the title Atribute Error in Config_Example Notebook Attribute Error in Config_Example Notebook Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant