synthesizer.parametric.metal_dist¶
A submodule for creating and manipulating metallicity distributions.
- NOTE: This module is imported as ZDist in parametric.__init__ enabling the
syntax shown below.
Example usage:
from synthesizer.parametric import ZDist
print(ZDist.parametrisations)
metal_dist = ZDist.DeltaConstant(…) metal_dist = ZDist.Normal(…)
metal_dist.get_dist_weight(metals)
Classes
- class synthesizer.parametric.metal_dist.Common(name, **kwargs)[source]¶
The parent class for all ZDist parametrisations.
- name¶
The name of this ZDist. This is set by the child and encodes the type of the metallicity distribution. Possible values are defined in parametrisations above.
- Type:
str
- parameters¶
A dictionary containing the parameters of the model.
- Type:
dict
- get_bin_weights(edges)[source]¶
Get the weight of each metallicity bin.
- Parameters:
edges (np.ndarray of float) – The (linear) metallicity bin edges.
- Returns:
The integrated weight in each bin.
- Return type:
np.ndarray of float
- get_cdf(metals)[source]¶
Get the weight between a metallicity of zero and each metallicity.
Children with a closed form override this, the default integrates the distribution numerically with Gauss-Legendre quadrature over log spaced panels whose edges include the requested metallicities.
- Parameters:
metals (np.ndarray of float) – The (linear) metallicities at which to evaluate the CDF.
- Returns:
The integrated weight up to each metallicity.
- Return type:
np.ndarray of float
Examples using synthesizer.parametric.metal_dist.Common¶
Demonstrate the dense basis approach for describing the SFZH
An example showing how to scale a galaxy’s mass by luminosity/flux.
Spatial resampling with parametric SFH and MetalDist
- class synthesizer.parametric.metal_dist.DeltaConstant(metallicity=None, log10metallicity=None)[source]¶
A single metallicity “distribution”.
- metallicity_¶
The single (linear) metallicity for all stellar mass in the distribution.
- Type:
float
- log10metallicity_¶
The log base 10 of metallicity.
- Type:
float
Examples using synthesizer.parametric.metal_dist.DeltaConstant¶
Demonstrate the dense basis approach for describing the SFZH
Examples using synthesizer.parametric.metal_dist.Normal¶
An example showing how to scale a galaxy’s mass by luminosity/flux.
Spatial resampling with parametric SFH and MetalDist