scopesim_templates.stellar.imf

scopesim_templates.stellar.imf#

Initial mass function, used by the cluster function.

KL:

Copied (18.06.2020, vers:134c5ff) almost directly from https://github.com/astropy/PyPopStar/blob/master/popstar/imf/imf.py

  1. Lu

Original code was taken from libimf package written by Jan Pflamm-Altenburg and has been modified only marginally. The libimf code was licensed under a GNU General Public License.

When I use this code, I should cite Pflamm-Altenburg & Kroupa 2006

Unfortunately, the code was almost completely un-commented, so all comments are mine. I have also added substantially to the code to make more convenient and general purpose functions.

Functions

delta(x)

Pass in float or array of floats (x) and return 0.5 for x==0 and 1.0 for everything else.

error(x)

gamma_closed(m, left, right)

inv_error(x)

inv_prim_log_normal(m, mean_logm, sigma_logm)

inv_prim_power(x, power)

returns ((1+power) * x)**(1.0 / (1 + power)) and handles the case when power == -1.

log_normal(m, mean_logm, sigma_logm)

mlog_normal(m, mean_logm, sigma_logm)

prim_log_normal(m, mean_logm, sigma_logm)

prim_mlog_normal(m, mean_logm, sigma_logm)

prim_power(m, power)

Take floats or arrays, but return arrays.

theta_closed(x)

Pass in float or array of floats (x) and return 0 for x<0 and 1 for everything else.

theta_open(x)

Pass in float or array of floats (x) and return 1 for x>0 and 0 for everything else.

Classes

IMF([mass_limits, multiplicity])

IMF base class.

IMFSalpeter1955([multiplicity])

Define IMF from Salpeter (1955).

IMF_broken_powerlaw(mass_limits, powers[, ...])

Initialize a multi-part power-law with N parts.

Kennicutt_1983([multiplicity])

Define IMF from Kennicutt (1983).

Kroupa_2001([multiplicity])

Define IMF from Kroupa (2001).

Miller_Scalo_1979([multiplicity])

Define IMF from Miller & Scalo (1979).

Weidner_Kroupa_2004([multiplicity])

Define IMF from Weidner & Kroupa (2004).