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

speeding up SedModel.mean_model method? #164

Open
moustakas opened this issue Feb 16, 2020 · 3 comments
Open

speeding up SedModel.mean_model method? #164

moustakas opened this issue Feb 16, 2020 · 3 comments

Comments

@moustakas
Copy link
Contributor

In the interactive demo (as well as in my own, independent fits), instantiating the CSPSpecBasis object (using the MILES spectral library and the MIST isochrones) takes about 10 seconds, which is fine because all the model spectra have to be read and cached.

However, the sedmodel.SedModel.mean_model (or, equivalently, the sedmodel.SedModel.sed) method, which evaluates the SED given a set of input parameters, takes a almost a full minute.

I can do some profiling but off-hand I wanted to ask if there are any ways to speed up this computation. Or maybe I'm missing something obvious?

@moustakas
Copy link
Contributor Author

I wonder if having sources.galaxy_basis.CSPSpecBasis subclass sources.ssp_basis.FastSSPBasis instead of sources.ssp_basis.SSPBasis would speed things up.

@moustakas
Copy link
Contributor Author

I wonder if having sources.galaxy_basis.CSPSpecBasis subclass sources.ssp_basis.FastSSPBasis instead of sources.ssp_basis.SSPBasis would speed things up.

Unfortunately, no change in compute time.

@bd-j
Copy link
Owner

bd-j commented Mar 4, 2020

The default MIST isochrones are just slow the first time the SSPs for a given metallicity are constructed. This is largely due to a huge amount of isochrone points covering the TP-AGB. Ity is on our to-do list to remove some of these points, but this may take some time.

However, subsequent calls with the same metallicity should be fast (since the SSPs get cached unless you change the IMF or something like that.). Once all metallicities are generated, call time should be something like 50ms including nebular emission.

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

No branches or pull requests

2 participants