bd-j / prospector

Python code for Stellar Population Inference from Spectra and SEDs
http://prospect.readthedocs.io
MIT License
153 stars 71 forks source link

How to fit SSP model instead of CSP #320

Closed palfeng closed 5 months ago

palfeng commented 5 months ago

Hello, I found most of the tutorials are about fitting CSP to galaxy spectra (e.g., InteractiveDemo.ipynb). After checking the manuals, I think ssp can be accessed by:

def build_sps(zcontinuous=1, compute_vega_mags=False, **extras):

from prospect.sources import SSPBasis
sps = SSPBasis(zcontinuous=zcontinuous)

return sps

def build_model(object_redshift=None, ldist=10.0, fixed_metallicity=None, add_duste=False, **extras)

model_params = TemplateLibrary["ssp"] 

#Define parameters then

Is this correct? Thanks in advance for your help!

bd-j commented 5 months ago

Hi @palfeng, actually CSPBasis can handle SSPs as well, as long as the "sfh" parameter is set to zero (which is done by TemplateLibrary["ssp"]) and I would suggest using that. Otherwise FastSSPBasis would be the better choice.

palfeng commented 5 months ago

Thanks, it works!