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

MIssing condition in model wavelength setup #51

Open rmendsley opened 8 months ago

rmendsley commented 8 months ago

Hi Adam,

I was trying to run a test photometry+spectrum fit that happened to be a case where the minimum and maximum wavelength bounds for the photometric bands fell entirely within the input spectrum wavelength regime. That condition isn't dealt with in the _get_wavelength_sampling function of the models/model_galaxy.py script. That is, you're missing a condition where: self.spec_wavs[0] < self.filter_set.min_phot_wav and self.spec_wavs[-1] > self.filter_set.max_phot_wav. The resulting error was something like 'model_galaxy does not have attribute self.R' during the fit step.

I was able to resolve this and get the fit running by just throwing in a fake, very high noise photometric data point in a very blue band, but thought you might want to edit the code to include this case.

Cheers, Ryan

ACCarnall commented 8 months ago

Hey Ryan,

Thanks for pointing this out. I think I vaguely remember being aware of this at some point, but it's never really been an issue until JWST. I guess if people are working with prism data regularly it's much more likely this case will come up. I'll try to find some time to implement a fix in the next version.

Cheers, Adam