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

sim.runner.spectrum_integrated doesn't work when spectrum: integrated: interpolate_shells: > 0 #1463

Closed
ycamacho opened this issue Feb 19, 2021 · 3 comments

Comments

@ycamacho
Copy link
Contributor

Problem description

When interpolate_shells: > 0 in input yml file sim.runner.spectrum_integrated results in following error


AttributeError Traceback (most recent call last)
in ()
----> 1 sim24.runner.spectrum_integrated

/Users/yssavo/Documents/GitHub/tardis/tardis/montecarlo/base.py in spectrum_integrated(self)
233 if self._spectrum_integrated is None:
234 self._spectrum_integrated = self.integrator.calculate_spectrum(
--> 235 self.spectrum_frequency[:-1], **self.integrator_settings
236 )
237 return self._spectrum_integrated

/Users/yssavo/Documents/GitHub/tardis/tardis/montecarlo/formal_integral.py in calculate_spectrum(self, frequency, points, interpolate_shells, raises)
94 self.interpolate_shells = interpolate_shells
95 frequency = frequency.to("Hz", u.spectral())
---> 96 luminosity = u.Quantity(formal_integral(self, frequency, N), "erg") * (
97 frequency[1] - frequency[0]
98 )

/Users/yssavo/Documents/GitHub/tardis/tardis/montecarlo/montecarlo.pyx in tardis.montecarlo.montecarlo.formal_integral()

AttributeError: 'numpy.ndarray' object has no attribute 'values'

Expected Output

Formal integral should work when interpolate_shells: > 0

Issue is occurring because sim.runner.electron_densities_integ is a numpy array instead of a pandas series. Fix needs to occur in tardis/tardis/montecarlo/formal_integral.py line 253

@ycamacho
Copy link
Contributor Author

ycamacho commented Feb 19, 2021

@chvogl This issue seems to have occurred during your PR #1358

@chvogl
Copy link
Contributor

chvogl commented Feb 19, 2021

Yes, this was a relatively stupid error on my part. Thanks for fixing it @Rodot. The problem should be resolved through the merge of PR #1464.

@chvogl
Copy link
Contributor

chvogl commented Feb 19, 2021

I am closing this for now.

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

2 participants