ACCarnall / bagpipes

Bagpipes is a state of the art code for generating realistic model galaxy spectra and fitting these to spectroscopic and photometric observations. Users should install with pip, not by cloning the repository.
http://bagpipes.readthedocs.io
GNU General Public License v3.0
71 stars 37 forks source link

Issue with galaxy.plot() #38

Closed kmlgould closed 1 year ago

kmlgould commented 1 year ago

hi Adam,

I found a possible bug in the galaxy.plot() function, originating from plot_spectrum.py. In line 53, ax.fill_between(spectrum[:, 0], lower, upper, color=color, zorder=zorder-1, alpha=0.75, linewidth=0), lower and upper are passed as generators, but according to the documentation they should be passed as arrays (or lists).

For me, this showed up as an error which said "TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe'', which I found can be fixed by passing upper and lower as lists instead.

ACCarnall commented 1 year ago

Hi Kate,

A few people have been having these sorts of problems recently, e.g., see #34 - this might be the solution? Also I think sometimes this issue arises when the photometry and spectroscopy you're feeding it have very different normalisations, might be worth checking this too.

Cheers, Adam

ACCarnall commented 1 year ago

I believe this should now be fixed in v1.0.2.