synthpop.modules.metallicity ============================ .. py:module:: synthpop.modules.metallicity Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/synthpop/modules/metallicity/_metallicity/index /autoapi/synthpop/modules/metallicity/double_gaussian/index /autoapi/synthpop/modules/metallicity/gaussian/index /autoapi/synthpop/modules/metallicity/gaussian_gradient/index /autoapi/synthpop/modules/metallicity/single_value/index Classes ------- .. autoapisummary:: synthpop.modules.metallicity.Metallicity Package Contents ---------------- .. py:class:: Metallicity(sun: types.ModuleType = None, coord_trans: types.ModuleType = None, logger: types.ModuleType = None, **kwargs) Bases: :py:obj:`abc.ABC` Metallicity class for a Population class. he appropriate subclass is assigned based on the metallicity_func_kwargs through the "get_subclass" factory. Attributes ---------- metallicity_func_name : str name of the metallicity Class (more attributes are specified in the subclasses) Methods ------- __init__(self,**kwargs) : None initialize the metallicity class draw_random_metallicity(self, N: int or None = None, x: np.ndarray or float = None, y: np.ndarray or float = None, z: np.ndarray or float = None, ) : float, ndarray [[Fe/H]] returns one or more random metallicity values in [Fe/H]. (specified in the subclasses) average_metallicity(self) : float [[Fe/H]] returns the average metallicity for the distribution in [Fe/H] (specified in the subclasses) .. py:attribute:: logger :value: None .. py:attribute:: sun .. py:attribute:: coord_trans :value: None .. py:attribute:: metallicity_func_name :value: 'None' .. py:method:: draw_random_metallicity(N: int or None = None, x: np.ndarray or float = None, y: np.ndarray or float = None, z: np.ndarray or float = None, age: np.ndarray or float = None) -> np.ndarray or float :abstractmethod: Generate a random metallicity from the distribution Parameters ---------- N : int, None, optional if N is set to an integer, an array with N random metallicities is returned x, y, z, : float, ndarray [kpc] galactocentric cartesian coordinates has length N, or is a float if N == None age : float, ndarray [Gyr] age of the stars has length N, or is a float if N == None Returns ------- random_metallicity : float, ndarray [[Fe/H]] array of random metallicities .. py:method:: average_metallicity() -> float :abstractmethod: Returns the average metallicity .. py:method:: likelyhood_distribution(met: numpy.ndarray) -> numpy.ndarray analytic version of likelyhood_distribution. only used for the validating