synthesizer.parametric.sf_hist

A module for creating and manipulating star formation histories.

NOTE: This module is imported as SFH in parametric.__init__ enabling the syntax

shown below.

Example usage:

from synthesizer.parametric import SFH

print(SFH.parametrisations)

sfh = SFH.Constant(…) sfh = SFH.Exponential(…) sfh = SFH.LogNormal(…)

sfh.calculate_sfh()

Classes

class synthesizer.parametric.sf_hist.Common(name, **kwargs)[source]

The parent class for all SFH parametrisations.

name

The name of this SFH. This is set by the child and encodes the type of the SFH. Possible values are defined in parametrisations above.

Type:

string

parameters

A dictionary containing the parameters of the model.

Type:

dict

calculate_mean_age(t_range=(0, 10000000000), dt=1000000)[source]

Calcualte the median age of a given star formation history.

Parameters:
  • t_range (tuple, float) – The age limits over which to calculate the SFH.

  • dt (float) – The interval between age bins.

Returns:

t (array-like, float)

The age bins.

sfh (array-like, float)

The SFH.

calculate_median_age(t_range=(0, 10000000000), dt=1000000)[source]

Calcualte the median age of a given star formation history.

Parameters:
  • t_range (tuple, float) – The age limits over which to calculate the SFH.

  • dt (float) – The interval between age bins.

Returns:

t (array-like, float)

The age bins.

sfh (array-like, float)

The SFH.

calculate_moment(n)[source]

Calculate the n-th moment of the star formation history.

calculate_sfh(t_range=(0, 10000000000), dt=1000000)[source]

Calcualte the age of a given star formation history.

Parameters:
  • t_range (tuple, float) – The age limits over which to calculate the SFH.

  • dt (float) – The interval between age bins.

Returns:

t (array-like, float)

The age bins.

sfh (array-like, float)

The SFH in units of 1 / yr.

get_sfr(age)[source]

Calculate the star formation in each bin.

Parameters:

age (float) – The age at which to calculate the SFR.

Returns:

sfr (float/array-like, float)

The SFR at the passed age. Either as a single value or an array for each age in age.

Examples using synthesizer.parametric.sf_hist.Common

Photometry example

Photometry example

Plot delta_lambda for a grid.

Plot delta_lambda for a grid.

Create image example

Create image example

Generate parametric observed SED

Generate parametric observed SED

Generate parametric galaxy SED

Generate parametric galaxy SED

An example showing how to scale a galaxy’s mass by luminosity/flux.

An example showing how to scale a galaxy's mass by luminosity/flux.

Plot equivalent width for UV indices

Plot equivalent width for UV indices

Create sampled SED

Create sampled SED

Compare parametric and particle SEDs

Compare parametric and particle SEDs

Compare SPS grid assignment methods

Compare SPS grid assignment methods

Plot line of sight diagnostics

Plot line of sight diagnostics

Plot line of sight diagnostics

Plot line of sight diagnostics
class synthesizer.parametric.sf_hist.Constant(duration)[source]

A constant star formation history.

The SFR is defined such that:

sfr = 1; t<=duration sfr = 0; t>duration

duration

The duration of the period of constant star formation.

Type:

float

Examples using synthesizer.parametric.sf_hist.Constant

Photometry example

Photometry example

Plot delta_lambda for a grid.

Plot delta_lambda for a grid.

Create image example

Create image example

Generate parametric observed SED

Generate parametric observed SED

Generate parametric galaxy SED

Generate parametric galaxy SED

An example showing how to scale a galaxy’s mass by luminosity/flux.

An example showing how to scale a galaxy's mass by luminosity/flux.

Plot equivalent width for UV indices

Plot equivalent width for UV indices

Create sampled SED

Create sampled SED

Compare parametric and particle SEDs

Compare parametric and particle SEDs

Compare SPS grid assignment methods

Compare SPS grid assignment methods

Plot line of sight diagnostics

Plot line of sight diagnostics

Plot line of sight diagnostics

Plot line of sight diagnostics
class synthesizer.parametric.sf_hist.DelayedExponentiallyDeclining(initial_age, tau)[source]

A delayed exponentially declining star formation history.

This is effectively the same as ExponentiallyDeclining with an overloaded _sfr method.

tau

The “stretch” parameter of the exponential.

Type:

float

initial_age

The “start age” of the exponential, i.e. the age where star formation is maximal.

Type:

unyt_quantity

class synthesizer.parametric.sf_hist.DoublePowerLaw(tau, alpha, beta)[source]

A double power law star formation history.

tau

The normalisation of age before raising to the powers.

Type:

float

alpha

The first power.

Type:

float

beta

The second power.

Type:

float

class synthesizer.parametric.sf_hist.Exponential(tau)[source]

An exponential star formation history.

tau

The “stretch” parameter of the exponential.

Type:

float

class synthesizer.parametric.sf_hist.ExponentiallyDeclining(initial_age, tau, name=None)[source]

An exponentially declining star formation history

tau

The “stretch” parameter of the exponential.

Type:

float

initial_age

The “start age” of the exponential, i.e. the age where star formation is maximal.

Type:

unyt_quantity

class synthesizer.parametric.sf_hist.LogNormal(tau, peak_age, max_age)[source]

A log-normal star formation history.

tau

The dimensionless “width” of the log normal distribution.

Type:

float

peak_age

The peak of the log normal distribution.

Type:

float

max_age

The maximum age of the log normal distribution.

Type:

float

class synthesizer.parametric.sf_hist.TruncatedExponential(tau, max_age)[source]

A truncated exponential star formation history.

tau

The “stretch” parameter of the exponential.

Type:

unyt_quantity

max_age

The age at which the exponential is truncated. Above this age the SFR is 0.

Type:

unyt_quantity