synthpop.modules.evolution._evolution ===================================== .. py:module:: synthpop.modules.evolution._evolution .. autoapi-nested-parse:: This is a module containing the base classes for the evolution process. The Evolution class is split into a EvolutionIsochrones and EvolutionInterpolator. This allows to vary both independently. Those are combined into a common Evolution Class using the CombineEvolution function A EvolutionIsochrones subclass should also have an EvolutionInterpolator as second Parent to specify a default interpolator. This interpolator is used whenever no Interpolator is defined. Attributes ---------- .. autoapisummary:: synthpop.modules.evolution._evolution.ISOCHRONES_DIR synthpop.modules.evolution._evolution.EVOLUTION_DIR synthpop.modules.evolution._evolution.MUST_HAVE_COLUMNS Classes ------- .. autoapisummary:: synthpop.modules.evolution._evolution.EvolutionIsochrones synthpop.modules.evolution._evolution.EvolutionInterpolator Functions --------- .. autoapisummary:: synthpop.modules.evolution._evolution.CombineEvolution Module Contents --------------- .. py:data:: ISOCHRONES_DIR :value: "b'.'/data/isochrones" .. py:data:: EVOLUTION_DIR .. py:data:: MUST_HAVE_COLUMNS :value: ['log10_isochrone_age_yr', 'initial_mass', '[Fe/H]_init', 'phase'] .. py:class:: EvolutionIsochrones(columns=None, logger: types.ModuleType = None, **kwargs) Bases: :py:obj:`abc.ABC` The EvolutionIsochrones base class. The appropriate subclass is assigned based on Population[evolution_class][name] through the "get_subclass" factory. must specify at least this "log10_isochrone_age_yr", "initial_mass", "[Fe/H]_init", "star_mass" Current included subclasses: ---------------------------- -MIST': Using the MIST isochrones systems, Attributes ---------- isochrones : Pandas DataFrame DataFrame of the loaded isochrones isochrones_grouped : Pandas DataFrameGroupBy Isochrones groupend in metallicity and age more Attributes can be specified in the subclasses Methods ------- __init__(self,**kwargs) : None initialize the EvolutionIsochrones class from a Population dictionary get_isochrones(self) : None return the Isochrones Data Frame .. py:attribute:: isochrones_name :value: None .. py:attribute:: isochrones_grouped :value: None .. py:attribute:: columns :value: None .. py:attribute:: logger :value: None .. py:method:: get_isochrones() Returns ------- isochrones : Pandas.DataFrame Isochrone Grid .. py:method:: get_mass_min(band: str, magnitude_limit: float, distances: np.ndarray or float, max_age: float = None, extinction_at_slice_front: np.ndarray or float = None) -> numpy.ndarray gets the minimum mass of stars still passing the magnitude_limit Parameters ---------- magnitude_limit : float maximum observed magnitude, (set distance to 0.01 if absolute magnitudes), distances : np.ndarray or float distances in kpc max_age: float [Gyr] Returns ------- min_mass : np.ndarray or float Returns minimum mass for stars brighter than magnitude_limit .. py:class:: EvolutionInterpolator(logger: types.ModuleType = None, **kwargs) Bases: :py:obj:`abc.ABC` The EvolutionInterpolator base class. The appropriate subclass is assigned based on Population[evolution_class][Interpolator] through the "get_subclass" factory. Each EvolutionIsochrone Class should have a specified default Interpolator Current included subclasses: ---------------------------- -LagrangeInterpolator: Using Lagrange Polynomials to interpolate between Consecutive stars in the Isochrone grid Attributes ---------- accept_np_arrays : Bool should be set to True if the interpolator can work with multiple stars given as array. more Attributes can be specified in the subclasses Methods ------- __init__(self,**kwargs) : None initialize the EvolutionIsochrones class from a Population dictionary get_evolved_props(self) : pandas.DataFrame return the Isochrones .. py:attribute:: interpolator_name :value: None .. py:attribute:: accept_np_arrays :value: False .. py:attribute:: isochrones :value: None .. py:attribute:: met_to_file_iso :value: None .. py:attribute:: file_met :value: None .. py:attribute:: iso_ages :value: None .. py:attribute:: logger :value: None .. py:method:: get_evolved_props(m_init, met, age, props, **kwargs) :abstractmethod: Get the interpolated properties from the isochrones. Parameters ---------- m_init : float, ndarray [Msun] initial mass for the stars met : float, ndarray [dex] initial metallicity for the stars age : float, ndarray [Gyr] initial age for the stars props : set a set of properties kwargs : dict, optional further ignored keywords Returns ------- s_track : dict interpolator properties for all keywords specified in props in_grid : bool , ndarray indicator if the star is within the Isochrone Grid final_phase : bool, ndarray indicator if the star is in its final phase and might need special treatment. (can be the same as in_grid) Note: if accept_np_arrays is set to True. each entry in s_track has to be a ndarray of the same shape as the input parameters .. py:function:: CombineEvolution(Isochrones=None, Interpolator=None) This function combines the isochrones and Interpolator into a common Evolution Class Parameters ---------- Isochrones : class Class of the Isochrone system Interpolator : class or None Class of the Interpolator Returns ------- Evolution: class