synthpop.modules.initial_mass_function.piecewise_powerlaw ========================================================= .. py:module:: synthpop.modules.initial_mass_function.piecewise_powerlaw .. autoapi-nested-parse:: Initial mass function for a piecewise power law, e.g.: For M ≤ m1: ξ(M) ∝ M^-a0 For m1 < M ≤ m2: ξ(M) ∝ M^-a1 For m2 < M: ξ(M) ∝ M^-a2 The number of splitpoints is modifiable. Classes ------- .. autoapisummary:: synthpop.modules.initial_mass_function.piecewise_powerlaw.PiecewisePowerlaw Module Contents --------------- .. py:class:: PiecewisePowerlaw(min_mass=None, max_mass=None, alphas: tuple[float] = 1, splitpoints: tuple[float] = (), **kwargs) Bases: :py:obj:`synthpop.modules.initial_mass_function._initial_mass_function.InitialMassFunction` Initial mass function generator for a piecewise power law Attributes: ----------- min_mass : float lower initial mass limit max_mass : float upper initial mass limit alphas : ndarray [float] power law indices for the mass chunks from lower mass to higher splitpoints : ndarray [float] mass values where pieces split; length must be length alphas minus 1 .. py:attribute:: imf_name :value: 'Piecewise Powerlaw' .. py:attribute:: alphas :value: 1 .. py:attribute:: splitpoints :value: () .. py:method:: get_functions(alphas, splitpoints) .. py:method:: get_imf_parts(m_upper, m_lower, a, alpha) .. py:method:: get_F_parts(m_upper, m_lower, a, alpha) -> Callable .. py:method:: get_F_inv_parts(m_upper, m_lower, p_upper, p_lower, a, alpha) .. py:method:: imf(m_in) Initial mass function Parameters ---------- m_in: initial mass Returns ------- prob: probability at the initial mass .. py:method:: F_imf(m_in) Integral of the initial mass function from 0 to m_in Parameters ---------- m_in: initial mass Returns ------- F: integral .. py:method:: F_imf_inverse(p_in) Inverse of F_imf Parameters ---------- p_in : cumulative likelihood Returns ------- met .. py:attribute:: grid_max :value: 10000 .. py:attribute:: grid_min :value: 0