IMF Object

Initial Mass Functions (IMFs) are defined as classes in spisea/imf/imf.py. These can be defined by:

from spisea.imf import imf
imf_obj = imf.<class_name>

Currently, the IMF is implemented as a power-law: dn / dm ~ m^-alpha. The Broken Power-Law IMF object gives users the flexibility to define the mass range and exponents of the IMF.

The IMF object is an input for the Cluster Object, and will be used to draw the inital stellar mass distribution for the cluster. A Stellar Multiplicity Object may be passed to the IMF object to form multiple star systems.

Base IMF Class

class imf.imf.IMF(massLimits=array([0.1, 150.0]), multiplicity=None)

The IMF base class. The mass sampling and multiplicity implementation is here.

Parameters
massLimits2 element array; optional

Define the minimum and maximum stellar masses in the IMF, in solar masses. First element is taken as the min, second element the max (e.g. massLimits = [min_mass, max_mass]).

multiplicityMultiplicity object or None

If None, no multiplicity is assumed. Otherwise, use multiplicity object to create multiple star systems.

Notes

Code author: J. Lu.

Original code was taken from libimf package written by Jan Pflamm-Altenburg (Pflamm-Altenburg & Kroupa 2006) and has been modified only marginally, though more convinient and general purpose functions have been added. The libimf code was licensed under a GNU General Public License.

Methods

calc_multi(newMasses, compMasses, ...)

Helper function to calculate multiples more efficiently.

generate_cluster(totalMass[, seed])

Generate a cluster of stellar systems with the specified IMF.

calc_multi(newMasses, compMasses, newSystemMasses, newIsMultiple, CSF, MF)

Helper function to calculate multiples more efficiently. We will use array operations as much as possible

generate_cluster(totalMass, seed=None)

Generate a cluster of stellar systems with the specified IMF.

Randomly sample from an IMF with specified mass limits until the desired total mass is reached. The maximum stellar mass is not allowed to exceed the total cluster mass. The simulated total mass will not be exactly equivalent to the desired total mass; but we will take one star above or below (whichever brings us closer to the desired total) the desired total cluster mass break point.

Primary stars are sampled from the IMF, companions are generated based on the multiplicity properties provided.

Parameters
totalMassfloat

The total mass of the cluster (including companions) in solar masses.

seed: int

If set to non-None, all random sampling will be seeded with the specified seed, forcing identical output. Default None

Returns
massesnumpy float array

List of primary star masses.

isMultiplenumpy boolean array

List of booleans with True for each primary star that is in a multiple system and False for each single star.

companionMassesnumpy float array

List of

Broken Power-Law IMFs

class imf.imf.IMF_broken_powerlaw(mass_limits, powers, multiplicity=None)

Bases: IMF

Initialize a multi-part power-law with N parts. Each part of the power-law is described with a probability density function:

P(m) propto m ** power[n]

for mass_limits[n] < m <= mass_limits[n+1].

Parameters
mass_limitsnumpy array

Array of length (N + 1) with lower and upper limits of the power-law segments.

powersnumpy array

Array of length N that contains the powers for each power-law segment.

multiplicityMultiplicity object or None

If None, no multiplicity is assumed. Otherwise, use multiplicity object to create multiple star systems.

Methods

calc_multi(newMasses, compMasses, ...)

Helper function to calculate multiples more efficiently.

dice_star_cl(r)

Given a list of random numbers (r), return a list of masses selected from the IMF.

generate_cluster(totalMass[, seed])

Generate a cluster of stellar systems with the specified IMF.

getMassBetween(massLo, massHi)

Return the integrated mass between some low and high mass value.

getProbabilityBetween(massLo, massHi)

Return the integrated probability between some low and high mass value.

int_mxi(massLo, massHi)

Return the integrated total mass between some low and high stellar mass value.

int_xi(massLo, massHi)

Return the integrated probability between some low and high mass value.

int_xi_cl(left, right)

Helper function

m_xi(m)

Mass-weighted probability m*xi

mxi_cl(m)

Helper function

norm_cl_wk04(Mcl[, Mmax, Mmin])

Helper function

normalize(Mcl[, Mmin, Mmax])

Normalize the IMF to a total cluster mass within a specified minimum and maximum stellar mass range.

prim_mxi(a)

Helper function

prim_xi(a)

Helper function

xi(m)

Probability density describing the IMF.

xi_cl(m)

Helper function

int_mxi_cl

class imf.imf.IMFSalpeter1955(multiplicity=None)

Bases: IMF_broken_powerlaw

Define IMF from Salpeter (1955). Mass range is 0.4 M_sun - 10 M_sun.

Methods

calc_multi(newMasses, compMasses, ...)

Helper function to calculate multiples more efficiently.

dice_star_cl(r)

Given a list of random numbers (r), return a list of masses selected from the IMF.

generate_cluster(totalMass[, seed])

Generate a cluster of stellar systems with the specified IMF.

getMassBetween(massLo, massHi)

Return the integrated mass between some low and high mass value.

getProbabilityBetween(massLo, massHi)

Return the integrated probability between some low and high mass value.

int_mxi(massLo, massHi)

Return the integrated total mass between some low and high stellar mass value.

int_xi(massLo, massHi)

Return the integrated probability between some low and high mass value.

int_xi_cl(left, right)

Helper function

m_xi(m)

Mass-weighted probability m*xi

mxi_cl(m)

Helper function

norm_cl_wk04(Mcl[, Mmax, Mmin])

Helper function

normalize(Mcl[, Mmin, Mmax])

Normalize the IMF to a total cluster mass within a specified minimum and maximum stellar mass range.

prim_mxi(a)

Helper function

prim_xi(a)

Helper function

xi(m)

Probability density describing the IMF.

xi_cl(m)

Helper function

int_mxi_cl

class imf.imf.Miller_Scalo_1979(multiplicity=None)

Bases: IMF_broken_powerlaw

Define IMF from Miller & Scalo (1979). Mass range is 0.1 M_sun - inf M_sun.

Methods

calc_multi(newMasses, compMasses, ...)

Helper function to calculate multiples more efficiently.

dice_star_cl(r)

Given a list of random numbers (r), return a list of masses selected from the IMF.

generate_cluster(totalMass[, seed])

Generate a cluster of stellar systems with the specified IMF.

getMassBetween(massLo, massHi)

Return the integrated mass between some low and high mass value.

getProbabilityBetween(massLo, massHi)

Return the integrated probability between some low and high mass value.

int_mxi(massLo, massHi)

Return the integrated total mass between some low and high stellar mass value.

int_xi(massLo, massHi)

Return the integrated probability between some low and high mass value.

int_xi_cl(left, right)

Helper function

m_xi(m)

Mass-weighted probability m*xi

mxi_cl(m)

Helper function

norm_cl_wk04(Mcl[, Mmax, Mmin])

Helper function

normalize(Mcl[, Mmin, Mmax])

Normalize the IMF to a total cluster mass within a specified minimum and maximum stellar mass range.

prim_mxi(a)

Helper function

prim_xi(a)

Helper function

xi(m)

Probability density describing the IMF.

xi_cl(m)

Helper function

int_mxi_cl

class imf.imf.Kennicutt_1983(multiplicity=None)

Bases: IMF_broken_powerlaw

Define IMF from Kennicutt (1983). Mass range is 0.1 M_sun - inf M_sun.

Methods

calc_multi(newMasses, compMasses, ...)

Helper function to calculate multiples more efficiently.

dice_star_cl(r)

Given a list of random numbers (r), return a list of masses selected from the IMF.

generate_cluster(totalMass[, seed])

Generate a cluster of stellar systems with the specified IMF.

getMassBetween(massLo, massHi)

Return the integrated mass between some low and high mass value.

getProbabilityBetween(massLo, massHi)

Return the integrated probability between some low and high mass value.

int_mxi(massLo, massHi)

Return the integrated total mass between some low and high stellar mass value.

int_xi(massLo, massHi)

Return the integrated probability between some low and high mass value.

int_xi_cl(left, right)

Helper function

m_xi(m)

Mass-weighted probability m*xi

mxi_cl(m)

Helper function

norm_cl_wk04(Mcl[, Mmax, Mmin])

Helper function

normalize(Mcl[, Mmin, Mmax])

Normalize the IMF to a total cluster mass within a specified minimum and maximum stellar mass range.

prim_mxi(a)

Helper function

prim_xi(a)

Helper function

xi(m)

Probability density describing the IMF.

xi_cl(m)

Helper function

int_mxi_cl

class imf.imf.Kroupa_2001(multiplicity=None)

Bases: IMF_broken_powerlaw

Define IMF from Kroupa (2001). Mass range is 0.01 M_sun - inf M_sun.

Methods

calc_multi(newMasses, compMasses, ...)

Helper function to calculate multiples more efficiently.

dice_star_cl(r)

Given a list of random numbers (r), return a list of masses selected from the IMF.

generate_cluster(totalMass[, seed])

Generate a cluster of stellar systems with the specified IMF.

getMassBetween(massLo, massHi)

Return the integrated mass between some low and high mass value.

getProbabilityBetween(massLo, massHi)

Return the integrated probability between some low and high mass value.

int_mxi(massLo, massHi)

Return the integrated total mass between some low and high stellar mass value.

int_xi(massLo, massHi)

Return the integrated probability between some low and high mass value.

int_xi_cl(left, right)

Helper function

m_xi(m)

Mass-weighted probability m*xi

mxi_cl(m)

Helper function

norm_cl_wk04(Mcl[, Mmax, Mmin])

Helper function

normalize(Mcl[, Mmin, Mmax])

Normalize the IMF to a total cluster mass within a specified minimum and maximum stellar mass range.

prim_mxi(a)

Helper function

prim_xi(a)

Helper function

xi(m)

Probability density describing the IMF.

xi_cl(m)

Helper function

int_mxi_cl

class imf.imf.Weidner_Kroupa_2004(multiplicity=None)

Bases: IMF_broken_powerlaw

Define IMF from Weidner & Kroupa (2004). Mass range is 0.01 M_sun - inf M_sun.

Methods

calc_multi(newMasses, compMasses, ...)

Helper function to calculate multiples more efficiently.

dice_star_cl(r)

Given a list of random numbers (r), return a list of masses selected from the IMF.

generate_cluster(totalMass[, seed])

Generate a cluster of stellar systems with the specified IMF.

getMassBetween(massLo, massHi)

Return the integrated mass between some low and high mass value.

getProbabilityBetween(massLo, massHi)

Return the integrated probability between some low and high mass value.

int_mxi(massLo, massHi)

Return the integrated total mass between some low and high stellar mass value.

int_xi(massLo, massHi)

Return the integrated probability between some low and high mass value.

int_xi_cl(left, right)

Helper function

m_xi(m)

Mass-weighted probability m*xi

mxi_cl(m)

Helper function

norm_cl_wk04(Mcl[, Mmax, Mmin])

Helper function

normalize(Mcl[, Mmin, Mmax])

Normalize the IMF to a total cluster mass within a specified minimum and maximum stellar mass range.

prim_mxi(a)

Helper function

prim_xi(a)

Helper function

xi(m)

Probability density describing the IMF.

xi_cl(m)

Helper function

int_mxi_cl