cconroy20 / fsps

Flexible Stellar Population Synthesis
MIT License
84 stars 48 forks source link

Use BPASS models in FSPS #43

Closed palfeng closed 3 years ago

palfeng commented 3 years ago

Hello,

I am trying to use FSPS models by doing fits by Prospector. I found in the manual that BPASS model is now included in FSPS (section 1.16 of the manual). But I found it is not clear how to use BPASS in FSPS. Specifically, my question is:

How to use BPASS on in Prospector code? When I load FSPS models, I just did "build_sps(**run_params)" and I don't know if this reads the BPASS models by default.

Thanks for your help!

-Xinfeng

bd-j commented 3 years ago

You need to recompile FSPS with BPASS enabled. This is done by changing the pre-compiler flags in sps_vars.f90, e.g. S2.1.1 of https://github.com/cconroy20/fsps/blob/master/doc/MANUAL.pdf

Then you need to re-install python-fsps

cd /path/to/python-fsps
python setup.py install

You can check which libraries are being used with

import fsps
sp = fsps.StellarPopulation()
print(sp.libraries)
palfeng commented 3 years ago

Thanks! I found in sps_vars.f90, and I think what you mean is to change:

ifndef BPASS

define BPASS 0

endif

to be:

ifndef BPASS

define BPASS 1

endif

Then reinstall fsps?

One additional questions (maybe too sophisticated there): Is it possible for Prospector to use SB99 database instead of fsps?

Thanks, Xinfeng

bd-j commented 3 years ago

yes, but you also have to set the other isochrone libraries to false/0;

define MIST 0

There is not currently code to allow prospector to use SB99. This feature could be added in principle if it possible to access SB99 spectra through python.

palfeng commented 3 years ago

Thanks! I will try later today to use BPASS.

-Xinfeng