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

Posterior EW #54

Open perin224 opened 6 months ago

perin224 commented 6 months ago

Is there a way of extracting equivalent widths from the posterior photometry model? I can't see it anywhere in the code and the data in spec_post isn't at a high enough resolution to manually calculate the EWs.

ACCarnall commented 6 months ago

There's a couple of things you could do here. Firstly, you could go into bagpipes/config.py and increase the model resolution (e.g. R_phot) to the point where you can calculate indices from the posterior spectrum.

Secondly, you could use the fit.posterior.predict function. You'll need to look in bagpipes/fitting/posterior.py for this function as it's not yet documented. There's also undocumented equivalent width calculation and fitting code in bagpipes - I've attached an example of how this works to this message, hopefully this helps.

indices_example.txt