galapy.StarFormationHistory

GalaPy module handling Star Formation History (SFH) models.

Module Attributes

sfh_tunables

Dictionary of tunable parameters

Functions

sfh_build_params([tau_quench, model])

Builds the parameter dictionary for a given SFH model.

Classes

SFH(*args[, tau_quench, model])

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 = 100

  • tau_star (float) – model = ['insitu','delayedexp', 'lognormal'], optional, default = 3.e+8 if insitu or lognormal, = 1.e+8 if delayedexp

  • psi (float) – model = 'constant', optional, default = 1.0

  • psi_norm (float) – model = ['delayedexp', 'lognormal'], optional, default = 1.0 if delayedexp, = 100 if lognormal

  • k_shape (float) – model = 'delayedexp', optional, default = 0.2

  • sigma_star (float) – model = 'lognormal', optional, default = 2.0

  • Mdust (float) – model = ['constant','delayedexp','lognormal','interpolated'], optional, default = 1.e+8

  • Zgxy (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:

  1. '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_star and \(\psi_\text{max} =\)psi_max

  2. 'constant'

    \[\psi(\tau) = \psi_0\]

    with \(\psi_0 =\)psi

  3. 'delayedexp'

    \[\psi(\tau) = \psi_\text{norm} \tau^{\kappa}\, \exp{(-\tau/\tau_\star)}\]

    with \(\psi_\text{norm} =\)psi_norm, \(\kappa =\)k_shape and \(\tau_\star =\)tau_star

  4. '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_star and \(\tau_\star =\)tau_star

  5. '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 grids args = (tau,sfr) with len(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) with len(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 = 100

  • tau_star (float) – model = ['insitu','delayedexp', 'lognormal'], optional, default = 3.e+8 if insitu or lognormal, = 1.e+8 if delayedexp

  • psi (float) – model = 'constant', optional, default = 1.0

  • psi_norm (float) – model = ['delayedexp', 'lognormal'], optional, default = 1.0 if delayedexp, = 100 if lognormal

  • k_shape (float) – model = 'delayedexp', optional, default = 0.2

  • sigma_star (float) – model = 'lognormal', optional, default = 2.0

  • Mdust (float) – model = ['constant','delayedexp','lognormal','interpolated'], optional, default = 1.e+8

  • Zgxy (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 = 100

  • tau_star (float) – model = ['insitu','delayedexp', 'lognormal'], optional, default = 3.e+8 if insitu or lognormal, = 1.e+8 if delayedexp

  • psi (float) – model = 'constant', optional, default = 1.0

  • psi_norm (float) – model = ['delayedexp', 'lognormal'], optional, default = 1.0 if delayedexp, = 100 if lognormal

  • k_shape (float) – model = 'delayedexp', optional, default = 0.2

  • sigma_star (float) – model = 'lognormal', optional, default = 2.0

  • Mdust (float) – model = ['constant','delayedexp','lognormal','interpolated'], optional, default = 1.e+8

  • Zgxy (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 insitu model, 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 insitu model, 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 insitu model, 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 insitu model, 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