.. _cluster_objects: =============== Cluster Object =============== The cluster classes are defined in ``spisea/synthetic.py``. The primary inputs to a cluster object are the cluster mass, :ref:`isochrone_objects`, and :ref:`imf_objects`. In addition, an :ref:`ifmr_objects` may be defined to produce compact stellar remnants. An example of making a ResolvedCluster, assuming the isochrone object has already been created:: from spisea import synthetic, ifmr from spisea.imf import imf, multiplicity import numpy as np # Define stellar multiplicity properties. Here we # use the default multiplicity object. # This is an input for the IMF object. imf_multi = multiplicity.MultiplicityUnresolved() # Define the IFMR. Here we use the IFMR object # IFMR_Raithel18. # If no IFMR is desired, set this variable # to None my_ifmr = ifmr.IFMR_Raithel18() # Define the IMF. Here we'll use a broken # power-law with the parameters from # Kroupa et al. (2001, MNRAS, 322, 231) # and the multiplicity we defined previously. # Note: when defining the power law slope for each segment of #the IMF, we define the entire exponent, including the negative sign. # For example, if dN/dm $\propto$ m^-alpha, then you would use # the value -2.3 to specify an IMF with alpha = 2.3. massLimits = np.array([0.08, 0.5, 1, 120]) # mass segments powers = np.array([-1.3, -2.3, -2.3]) # power-law exponents my_imf = imf.IMF_broken_powerlaw(massLimits, powers, multiplicity=imf_multi) # Define the cluster mass mass = 10**5 # Units: solar masses # Make the cluster object. We will assume that the isochrone object # is already defined as my_iso. cluster = synthetic.ResolvedCluster(my_iso, my_imf, mass, ifmr=my_ifmr) See `Quick Start Example `_ for a detailed example for how to make different cluster sub-classes and interact with the resulting output. Here is a table from Hosek et al. 2020 that describes the values in the cluster output table: .. figure:: images/cluster_table.png :width: 405 :height: 550 :align: center Tips and Tricks: The Cluster Object ----------------------------------------- * The cluster is generated by drawing a population of initial stellar masses according to the IMF/multiplicity objects and then assigning stellar properties to each using the evolution model. Thus, it is possible for the cluster to generate a star with an initial mass beyond the boundaries of the evolution model. If this occurs, then nans are assigned to the properties of that star (e.g. Teff, current_mass, photometry, etc). Base Cluster Class ---------------------------- .. autoclass:: synthetic.Cluster Cluster Sub-classes ----------------------- .. autoclass:: synthetic.ResolvedCluster :show-inheritance: .. autoclass:: synthetic.ResolvedClusterDiffRedden :show-inheritance: .. autoclass:: synthetic.UnresolvedCluster :show-inheritance: