Package enrichpy :: Module delay :: Class Delay

Class Delay

source code

Known Subclasses:

Represents the delay distribution for metals emerging from stars.

Takes the IMF, stellar metal yield function, and stellar lifetime function and calculates various the distribution of ejected metal mass with respect to stellar mass and stellar lifetime.

Instance Methods
 
__init__(self, metallicity, imfFunc=by_number(imf_mass_Chabrier), yieldClass=<class enrichpy.yields.Data_GBM at 0x8ef062c>, ejections=False, lifetimeFunc=<function main_sequence_life_K97 at 0x8f42b1c>, lowMass=None, highMass=None, minTime=None, maxTime=None)
Initialize the distribution.
source code
 
mass_limit_error(self, m_max=None, imf_index=-2.3)
Estimate the error incurred by excluding stars above m_max.
source code
 
metal_mass_dist_postinterp(self, m)
Like metal_mass_dist, but with interpolation after IMF multiplication.
source code
 
metal_mass_dist(self, m)
Fraction of total carbon yield from stars of mass m, dfC/dm, i.e. the distribution of carbon production as a function of stellar mass.
source code
 
yield_mass(self, m)
Carbon yield from a star of mass m.
source code
 
metal_mass_CCDF(self, m, highMass=None, method='romberg', **kwargs)
Complementary cumulative distribution of metal yield by mass, i.e. the fraction of the total metal output produced by stars above mass m.
source code
 
metal_mass_dist_binned(self, m, ccdf=None, **kwargs)
Calculate the values of a binned enrichment function.
source code
 
metal_time_CDF(self, t, ccdf=None, return_mass=False, **kwargs)
The delay CDF of metal yield as a function of stellar age.
source code
 
metal_time_dist_binned(self, t, ccdf=None, **kwargs)
Calculate the values of a binned delay function.
source code
 
metal_time_dist_unbinned(self, t, **kwargs)
Delay function inferred from metal_time_dist_binned.
source code
 
imf(self, mass)
The initial mass function.
source code
 
m_star(self, t_life)
Stellar mass as a function of lifetime.
source code
 
t_life(self, m_star)
Stellar lifetime as a function of mass.
source code
 
stats(self, meantol=0.001)
Calculate median and mean delay.
source code
 
printstats(self) source code
Method Details

__init__(self, metallicity, imfFunc=by_number(imf_mass_Chabrier), yieldClass=<class enrichpy.yields.Data_GBM at 0x8ef062c>, ejections=False, lifetimeFunc=<function main_sequence_life_K97 at 0x8f42b1c>, lowMass=None, highMass=None, minTime=None, maxTime=None)
(Constructor)

source code 

Initialize the distribution.

Parameters

metallicity: scalar
metallicity value for the yield calculation.
imfFunc: function
should return IMF by number given stellar mass in Msun.
yieldClass:
class encapsulating the yield data (see yields.py)
lifetimeFunc: function
should return lifetime of a star given mass in Msun.
lowMass, highMass: float
define the interval over which to normalize the distributions. Default to the range of masses in yieldClass().mVals

mass_limit_error(self, m_max=None, imf_index=-2.3)

source code 

Estimate the error incurred by excluding stars above m_max.

m_max defaults to self.highMass.

imf_index is the powerlaw index of the imf at high masses.

metal_mass_dist(self, m)

source code 

Fraction of total carbon yield from stars of mass m, dfC/dm, i.e. the distribution of carbon production as a function of stellar mass.

This is weighted by the stellar initial mass function (IMF), so that metal_mass_dist(m) * dm is the fraction of carbon emitted by stars with masses between m and m+dm.

Note that this is normalized over the interval from self.lowMass to self.highMass.

yield_mass(self, m)

source code 

Carbon yield from a star of mass m.

This is the total mass of carbon emitted by a single star of mass m over its lifetime.

metal_mass_CCDF(self, m, highMass=None, method='romberg', **kwargs)

source code 

Complementary cumulative distribution of metal yield by mass, i.e. the fraction of the total metal output produced by stars above mass m.

This is the integral of metal_mass_dist from m to highMass (or self.highMass).

Note that this is normalized over the interval from self.lowMass to self.highMass, so values may be negative above highMass and greater than one below lowMass.

kwargs get passed to utils.ccumulate, which may passes them to utils.integrate_piecewise, which may pass them to the integration routine.

See also: metal_mass_dist.

metal_mass_dist_binned(self, m, ccdf=None, **kwargs)

source code 

Calculate the values of a binned enrichment function.

Each returned value bdf[i] is the integral of the mass dist function from m[i-1] to m[i]. bdf[0] is the integral from self.lowMass to m[0].

Also returned are delta_m values (the width of each bin in units of mass), so the average derivative can be calculated, if desired.

Note that this is normalized over the interval from self.lowMass to self.highMass.

See also: metal_mass_CCDF

metal_time_CDF(self, t, ccdf=None, return_mass=False, **kwargs)

source code 

The delay CDF of metal yield as a function of stellar age.

I.e. the fraction of the total metal yield produced by stars with a lifetime of t or less.

Note that this is normalized over the interval from self.lowMass to self.highMass, so values may be negative above the lifetime corresponding to highMass and greater than one below the lowMass lifetime.

Calculated using metal_mass_CCDF and m_star.

kwargs get passed to metal_mass_CCDF.

metal_time_dist_binned(self, t, ccdf=None, **kwargs)

source code 

Calculate the values of a binned delay function.

Each returned value bdf[i] is the integral of the delay function from t[i-1] to t[i]. bdf[0] is the integral from self.minTime to t[0].

Also returned are delta_t values (the width of each bin in units of time), so the average derivative can be calculated, if desired.

Note that this is normalized over the interval from self.lowMass to self.highMass.

See also: metal_time_CDF

metal_time_dist_unbinned(self, t, **kwargs)

source code 

Delay function inferred from metal_time_dist_binned.

Simply returns the bin values divided by the bin size. Note that the first bin is from self.minTime to t[0].

Notes

This is the most accurate way to get the distribution of metal emission delay times. A more analytical treatment would be to convert directly from the continuous metal-mass distribution, but this involves the derivative of the stellar lifetime as a funtion of mass, which can be numerically problematic.

Note that this is normalized over the interval from self.lowMass to self.highMass.

imf(self, mass)

source code 

The initial mass function.

Note that the normalization may include stars that do not contribute to the yield of metals.