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]

Calculate 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]

Calculate 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.

plot(show=True, save=False, **kwargs)[source]

Plot the star formation history, returned by calculate_sfh.

Parameters:
  • show (bool) – display plot to screen directly

  • save (bool, string) – if False, don’t save. If string, save to directory

  • kwargs (dict) – key word arguments describing sfh

plot_sfh(t_range=(0, 10000000000), dt=1000000, log=False)[source]

Create a quick plot of the star formation history.

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

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

Examples using synthesizer.parametric.sf_hist.Common

Parametric Young Stars Example

Parametric Young Stars Example

Plot spectra example

Plot spectra example

Photometry example

Photometry example

Compare different parametric star formation history models

Compare different parametric star formation history models

Demonstrate the dense basis approach for describing the SFZH

Demonstrate the dense basis approach for describing the SFZH

Plot delta_lambda for a grid.

Plot delta_lambda for a grid.

Create image example

Create image example

Generating Lines from a Parametric Galaxy

Generating Lines from a Parametric Galaxy

Generate parametric observed SED

Generate parametric observed 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.

Generate parametric galaxy SED

Generate parametric galaxy SED

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 optical depth calculations

Plot line of sight optical depth calculations
class synthesizer.parametric.sf_hist.Constant(max_age=unyt_quantity(100, 'yr'), min_age=unyt_quantity(0, 'yr'), duration=None)[source]

A constant star formation history.

The SFR is defined such that:

sfr = 1; min_age<t<=max_age sfr = 0; t>max_age, t<min_age

max_age

The age above which the star formation history is truncated.

Type:

unyt_quantity

min_age

The age below which the star formation history is truncated.

Type:

unyt_quantity

Examples using synthesizer.parametric.sf_hist.Constant

Parametric Young Stars Example

Parametric Young Stars Example

Plot spectra example

Plot spectra example

Photometry example

Photometry example

Compare different parametric star formation history models

Compare different parametric star formation history models

Plot delta_lambda for a grid.

Plot delta_lambda for a grid.

Create image example

Create image example

Generating Lines from a Parametric Galaxy

Generating Lines from a Parametric Galaxy

Generate parametric observed SED

Generate parametric observed 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.

Generate parametric galaxy SED

Generate parametric galaxy SED

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 optical depth calculations

Plot line of sight optical depth calculations
class synthesizer.parametric.sf_hist.DecliningExponential(tau, max_age, min_age=unyt_quantity(0., 'yr'))[source]
class synthesizer.parametric.sf_hist.DelayedExponential(tau, max_age, min_age=unyt_quantity(0., 'yr'))[source]

A delayed exponential star formation history that can be truncated. The “delayed” element results in a more gradual increase at earlier times.

tau

The “stretch” parameter of the exponential.

Type:

unyt_quantity

max_age

The age above which the star formation history is truncated.

Type:

unyt_quantity

min_age

The age below which the star formation history is truncated.

Type:

unyt_quantity

Examples using synthesizer.parametric.sf_hist.DelayedExponential

Compare different parametric star formation history models

Compare different parametric star formation history models
class synthesizer.parametric.sf_hist.DenseBasis(db_tuple, redshift)[source]

Dense Basis representation of a SFH.

See here for more details on the Dense Basis method.

https://dense-basis.readthedocs.io/en/latest/

db_tuple

Dense basis parameters describing the SFH 1) total mass formed 2) SFR at the time of observation (see redshift) 3) number of tx parameters 4) times when the galaxy formed fractions of its mass,

units of fraction of the age of the universe [0-1]

Type:

tuple

redshift

redshift at which to scale the SFH

Type:

float

Examples using synthesizer.parametric.sf_hist.DenseBasis

Demonstrate the dense basis approach for describing the SFZH

Demonstrate the dense basis approach for describing the SFZH
class synthesizer.parametric.sf_hist.DoublePowerLaw(peak_age, alpha, beta, min_age=unyt_quantity(0, 'yr'), max_age=unyt_quantity(1.e+11, 'yr'))[source]

A double power law star formation history.

peak_age

The age at which the star formation history peaks.

Type:

unyt_quantity

alpha

The first power.

Type:

float

beta

The second power.

Type:

float

max_age

The age above which the star formation history is truncated.

Type:

unyt_quantity

min_age

The age below which the star formation history is truncated.

Type:

unyt_quantity

Examples using synthesizer.parametric.sf_hist.DoublePowerLaw

Compare different parametric star formation history models

Compare different parametric star formation history models
class synthesizer.parametric.sf_hist.Exponential(tau, max_age, min_age=unyt_quantity(0., 'yr'))[source]

A exponential star formation history that can be truncated.

Note: synthesizer uses age (not t) as its parameter such that:

t = max_age - age

tau

The “stretch” parameter of the exponential.

Type:

unyt_quantity

max_age

The age above which the star formation history is truncated.

Type:

unyt_quantity

min_age

The age below which the star formation history is truncated.

Type:

unyt_quantity

Examples using synthesizer.parametric.sf_hist.Exponential

Compare different parametric star formation history models

Compare different parametric star formation history models
class synthesizer.parametric.sf_hist.Gaussian(peak_age, sigma, max_age=unyt_quantity(1.e+11, 'yr'), min_age=unyt_quantity(0, 'yr'))[source]

A Gaussian star formation history.

peak_age

The age at which the star formation peaks, i.e. the age at which the gaussian is centred.

Type:

unyt_quantity

sigma

The standard deviation of the gaussian function.

Type:

unyt_quantity

max_age

The age above which the star formation history is truncated.

Type:

unyt_quantity

min_age

The age below which the star formation history is truncated.

Type:

unyt_quantity

Examples using synthesizer.parametric.sf_hist.Gaussian

Compare different parametric star formation history models

Compare different parametric star formation history models
class synthesizer.parametric.sf_hist.LogNormal(tau, peak_age, max_age, min_age=unyt_quantity(0, 'yr'))[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. In addition to truncating the star formation history this is used to define the peak.

Type:

unyt_quantity

min_age

The age below which the star formation history is truncated.

Type:

unyt_quantity

Examples using synthesizer.parametric.sf_hist.LogNormal

Compare different parametric star formation history models

Compare different parametric star formation history models
class synthesizer.parametric.sf_hist.TruncatedExponential(tau, max_age, min_age)[source]

A truncated exponential star formation history.

tau

The “stretch” parameter of the exponential.

Type:

unyt_quantity

max_age

The age above which the star formation history is truncated.

Type:

unyt_quantity

min_age

The age below which the star formation history is truncated.

Type:

unyt_quantity