Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formed vs Surviving stellar mass #233

Open
muryelgp opened this issue Jan 18, 2022 · 4 comments
Open

Formed vs Surviving stellar mass #233

muryelgp opened this issue Jan 18, 2022 · 4 comments
Labels

Comments

@muryelgp
Copy link

The output mass on the prospector is the ever-formed stellar mass, right?

How can this be changed? so that the output is the surviving stellar mass? I think I should pass add_stellar_remnants = False to fsps, but I was not able to do so.

Or even, it is possible to calculate the surviving mass from a fitted formed mass?

thanks!

@bd-j
Copy link
Owner

bd-j commented Jan 18, 2022

You can obtain the ratio of the surviving stellar mass to the formed stellar mass from a call to predict, e.g.

spec, phot, mfrac = model.predict(parameter_vector, obs=obs, sps=sps)
surviving_mass = np.sum(model.params["mass"]) * mfrac

where parameter_vector can by any posterior sample (e.g. the highest probability sample, or you can do this for every sample in the chain if you want the full posterior for the surviving stellar mass). See https://prospect.readthedocs.io/en/latest/tutorial.html#working-with-the-output for more info.

I should add this to the FAQ.

@muryelgp
Copy link
Author

Thanks!

But this way if I want the full posterior for the surviving stellar mass I need to run 'model.predict(..)' in a for loop for every sample in the chain, which seems to take quite some time!

Is there a way to make the prospector result itself to be in surviving stellar mass?

@bd-j
Copy link
Owner

bd-j commented Jan 22, 2022

Sorry, not in general; the problem is that the ratio of surviving to formed mass is not known until the model is generated (it depends on the stellar age and metallicity distribution, as well as the IMF) and this makes sampling from the surviving mass itself a bit tricky.

If you are using CSPSPecBasis (for parametric SFHs) you can try adding

model_params["mass_units"]=dict(init="mstar", isfree=False, N=1)

to your model specification to get sampling in surviving stellar mass, but this is no longer an actively supported feature.

@bd-j bd-j added the question label Mar 8, 2022
@bd-j
Copy link
Owner

bd-j commented May 17, 2022

Also to note a future update to prospector will store the ratio of the surviving to formed mass in the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants