galapy.StarFormationHistory
GalaPy module handling Star Formation History (SFH) models.
Module Attributes
Dictionary of tunable parameters |
Functions
|
Builds the parameter dictionary for a given SFH model. |
Classes
|
Class wrapping the C-core implementation of the Star Formation History type. |
- galapy.StarFormationHistory.sfh_tunables = {'constant': ('psi', 'Mdust', 'Zgxy'), 'delayedexp': ('psi_norm', 'k_shape', 'tau_star', 'Mdust', 'Zgxy'), 'insitu': ('psi_max', 'tau_star'), 'interpolated': ('Mdust', 'Zgxy'), 'lognormal': ('psi_norm', 'sigma_star', 'tau_star', 'Mdust', 'Zgxy')}
Dictionary of tunable parameters
- galapy.StarFormationHistory.sfh_build_params(tau_quench=20000000000.0, model='insitu', **kwargs)
Builds the parameter dictionary for a given SFH model.
- Parameters:
tau_quench (float) – eventual time of quenching in units of year, defaults to the arbitrary large value of $2 cdot 10^9$ years
model (string) – SFH model
**kwargs (dictionary, optional) – The free-parameters of the SFH model chosen (with argument
model) The parameterization depends on the chosen model.
- Keyword Arguments:
psi_max (float) –
model = 'insitu', optional, default = 100tau_star (float) –
model = ['insitu','delayedexp', 'lognormal'], optional, default = 3.e+8 ifinsituorlognormal, = 1.e+8 ifdelayedexppsi (float) –
model = 'constant', optional, default = 1.0psi_norm (float) –
model = ['delayedexp', 'lognormal'], optional, default = 1.0 ifdelayedexp, = 100 iflognormalk_shape (float) –
model = 'delayedexp', optional, default = 0.2sigma_star (float) –
model = 'lognormal', optional, default = 2.0Mdust (float) –
model = ['constant','delayedexp','lognormal','interpolated'], optional, default = 1.e+8Zgxy (float) –
model = ['constant','delayedexp','lognormal','interpolated'], optional, default = 0.01
- Returns:
Dictionary containing the parameterization of the chosen SFH model. All the parameters that have not been passed to the function are defined with their default value.
- Return type:
dict
- class galapy.StarFormationHistory.SFH(*args, tau_quench=2e+20, model='insitu', **kwargs)
Class wrapping the C-core implementation of the Star Formation History type.
The possible models to choose are:
'insitu'\[\psi(\tau) = \psi_\text{max} \left[ \exp(-x) - \exp(-s\gamma x) \right]\]with \(x = \tau / (s\tau_\star)\), \(s=3\), \(\gamma = 1 - \mathcal{R} + 3 \psi_\text{max}^{-0.3}\), \(\mathcal{R} = 0.45\) the instantaneous recycling factor, \(\tau_\star =\)
tau_starand \(\psi_\text{max} =\)psi_max'constant'\[\psi(\tau) = \psi_0\]with \(\psi_0 =\)
psi'delayedexp'\[\psi(\tau) = \psi_\text{norm} \tau^{\kappa}\, \exp{(-\tau/\tau_\star)}\]with \(\psi_\text{norm} =\)
psi_norm, \(\kappa =\)k_shapeand \(\tau_\star =\)tau_star'lognormal'\[\psi(\tau) = \psi_\text{norm} \dfrac{1}{\tau}\, \dfrac{1}{\sqrt{2\pi\sigma_\star^2}}\, \exp\left[-\dfrac{\ln^2(\tau/\tau_\star)}{2\,\sigma_\star^2}\right]\]with \(\psi_\text{norm} =\)
psi_norm, \(\sigma_\star =\)sigma_starand \(\tau_\star =\)tau_star'interpolated': from a pre-computed grid of SFRs computed at given times. If this model is chosen, two positional arguments are mandatory, i.e. the two gridsargs = (tau,sfr)withlen(tau)==len(sfr), see below.
- Parameters:
*args – positional arguments are optional, if passed they should be the two-iterables corresponding to gridded values of time and SFR to interpolate over:
args = (tau, sfr)withlen(tau)==len(sfr). Note that in this case the ‘model’ argument will be over-written and fixed to ‘interpolated’tau_quench (float) – Eventual abrupt quenching time for star formation. Should be expressed in years. It refers to the age of the galaxy, i.e. it has to be intended as the time passed from the formation of the galaxy.
model (string) – One among ( ‘insitu’, ‘constant’, ‘delayedexp’, ‘lognormal’, ‘interpolated’, ‘burst’ ). Default is ‘insitu’.
**kwargs (dictionary, optional) – The free-parameters of the SFH model chosen (with argument
model) The parameterization depends on the chosen model.
- Keyword Arguments:
psi_max (float) –
model = 'insitu', optional, default = 100tau_star (float) –
model = ['insitu','delayedexp', 'lognormal'], optional, default = 3.e+8 ifinsituorlognormal, = 1.e+8 ifdelayedexppsi (float) –
model = 'constant', optional, default = 1.0psi_norm (float) –
model = ['delayedexp', 'lognormal'], optional, default = 1.0 ifdelayedexp, = 100 iflognormalk_shape (float) –
model = 'delayedexp', optional, default = 0.2sigma_star (float) –
model = 'lognormal', optional, default = 2.0Mdust (float) –
model = ['constant','delayedexp','lognormal','interpolated'], optional, default = 1.e+8Zgxy (float) –
model = ['constant','delayedexp','lognormal','interpolated'], optional, default = 0.01
Note
Not for SED fitting, use the galaxy class
- set_parameters(tau_quench=None, **kwargs)
Function for setting the parameters of the model.
- Parameters:
tau_quench (float) – Eventual time of abrupt quenching event, stopping star formation forever.
**kwargs (dictionary, optional) – The free-parameters of the SFH model chosen (with argument
model) The parameterization depends on the chosen model.
- Keyword Arguments:
psi_max (float) –
model = 'insitu', optional, default = 100tau_star (float) –
model = ['insitu','delayedexp', 'lognormal'], optional, default = 3.e+8 ifinsituorlognormal, = 1.e+8 ifdelayedexppsi (float) –
model = 'constant', optional, default = 1.0psi_norm (float) –
model = ['delayedexp', 'lognormal'], optional, default = 1.0 ifdelayedexp, = 100 iflognormalk_shape (float) –
model = 'delayedexp', optional, default = 0.2sigma_star (float) –
model = 'lognormal', optional, default = 2.0Mdust (float) –
model = ['constant','delayedexp','lognormal','interpolated'], optional, default = 1.e+8Zgxy (float) –
model = ['constant','delayedexp','lognormal','interpolated'], optional, default = 0.01
- Return type:
None
- Mstar(tau, npoints=100)
Computes the stellar mass at a given age of the galaxy.
It approximates the integral:
\[M_\ast(\tau') = \int_0^{\tau'}\text{d}\tau \bigl[1 - \mathcal{R}_\text{IMF}(\tau)\bigr]\psi(\tau)\]- Parameters:
tau (float or array-like of floats) – galaxy age in years.
npoints (int) – thinness for approximated integral computation (default is 100)
- Returns:
the stellar mass of the galaxy at time \(\tau\)
- Return type:
float or array-like of floats
- Mdust(tau)
Returns the dust mass at a given age of the galaxy.
For empirical models of star formation (i.e.
const,delayedexp,lognorm) this is a free parameter.For the
insitumodel, the dust mass is given by\[M_\text{dust} = M_\text{gas}(\tau)D(\tau)\]where
\[M_\text{gas}=\psi(\tau)\tau_\ast\]and where \(D(\tau)\) is the gas mass ratio (for an analytic expression of this quantity see Pantoni et al. 2019 and Lapi et al. 2020).
- Parameters:
tau (float or array-like of floats) – age of the galaxy in years.
- Returns:
Dust content in solar masses (\(M_\odot\)) at give time \(\tau\).
- Return type:
float or array-like of floats
- Mgas(tau)
Returns the gas mass at a given age of the galaxy.
For empirical models of star formation (i.e.
const,delayedexp,lognorm) this is given by\[M_\text{gas} = M_\text{dust}/D\]where \(D \sim 0.01 (Z_\text{gas}/Z_\odot)^{-0.85}\) is the dust-to-gas mass ratio, derived from observations.
For the
insitumodel, the gas mass is given by\[M_\text{gas}=\psi(\tau)\tau_\ast\]- Parameters:
tau (float or array-like of floats) – age of the galaxy in years.
- Returns:
Gas content in solar masses (\(M_\odot\)) at give time \(\tau\).
- Return type:
float or array-like of floats
- Zgas(tau)
Returns the gas metallicity at a given age of the galaxy.
For empirical models of star formation (i.e.
const,delayedexp,lognorm) this is a free parameter with \(Z_\text{gas} = Z_\ast\).For the
insitumodel, it is instead given by\[Z_\text{gas}=\dfrac{s y_Z}{s\gamma-1} \biggl[ 1 - \dfrac{(s\gamma-1)x}{e^{(s\gamma-1)x}-1} \biggr]\]where \(x\equiv\tau/s\tau_\ast\) and \(y_Z\approx0.04\) is the metal production yield (including recycling) for a Chabrier IMF.
- Parameters:
tau (float or array-like of floats) – age of the galaxy in years.
- Returns:
Gas absolute metallicity at give time \(\tau\).
- Return type:
float or array-like of floats
- Zstar(tau)
Returns the stellar metallicity at a given age of the galaxy.
For empirical models of star formation (i.e.
const,delayedexp,lognorm) this is a free parameter with \(Z_\ast = Z_\text{gas}\).For the
insitumodel, it is instead given by\[Z_\ast=\dfrac{y_Z}{\gamma-1} \biggl[1 - \dfrac{s\gamma}{(s\gamma-1} \dfrac{e^{-x}-e^{-s\gamma x}[1 + (s\gamma -1)x]} {s\gamma -1 + e^{-s\gamma x}- s\gamma e^{-x}}\biggr]\]where \(x\equiv\tau/s\tau_\ast\) and \(y_Z\approx0.04\) is the metal production yield (including recycling) for a Chabrier IMF.
- Parameters:
tau (float or array-like of floats) – age of the galaxy in years.
- Returns:
Stellar absolute metallicity at give time \(\tau\).
- Return type:
float or array-like of floats