Physics Stack Exchange is a question and answer site for active researchers, academics and students of physics. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Are there any publicly available codes to sample from an initial mass function (common ones... Kroupa, Chabrier, Salpeter) to construct a cluster, then use stellar models to generate an integrated spectrum? I imagine such codes must be quite common, as they're relatively easy to write, but require access to stellar model databases or very simple stellar models.

share|cite|improve this question
SLUG ( does a lot of what I want, but only incorporated into full-scale Galaxy simulation. It's probably possibly to make it generate just one cluster. – keflavich Nov 26 '11 at 23:59
The astrophysics source code library ( is another place to look. I did a quick search for "initial mass function", and SLUG came up, but nothing that seemed much more specifically suited to your purpose. – jdmcbr Mar 3 '12 at 17:44

The one population synthesis code I've used is GALAXEV, which can be found here. It allows you to choose either the Chabrier or Salpeter IMF, as well as select a star formation history from a few simple models, and it outputs the integrated spectrum. The stellar models and evolutionary tracks are all included in the code and supporting files.

I will caution, however, that this code, despite its popularity, is written in near-defunct Fortran. It took me several days to get it working, between figuring out its ancient I/O format, running preliminary scripts to convert between ASCII and binary files (yes the authors believe reading in a few kilobytes of ASCII data somehow takes a significant amount of time), and finding a compiler from the post-vacuum tube era that actually accepted the source. Yet one more example of astronomy being several decades behind when it comes to computers...

share|cite|improve this answer
Well, sounds like a great candidate to get wrapped in python... astronomy's not ALL behind, but there are plenty of astronomers who are. – keflavich Feb 11 '13 at 2:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.