Cluster Object¶
The cluster classes are defined in spisea/synthetic.py. The primary
inputs to a cluster object are the cluster mass,
Isochrone Object, and IMF Object. In addition, an
IFMR Object 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:
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¶
- class synthetic.Cluster(iso, imf, cluster_mass, ifmr=None, verbose=False, seed=None)¶
Base class to create a cluster with user-specified isochrone, imf, ifmr, and total mass.
- Parameters
- iso: isochrone object
SPISEA isochrone object
- imf: imf object
SPISEA IMF object
- cluster_mass: float
Total initial mass of the cluster, in M_sun
- ifmr: ifmr object or None
If ifmr object is defined, will create compact remnants produced by the cluster at the given isochrone age. Otherwise, no compact remnants are produced.
- seed: int
Seed for the random number generator numpy.random.default_rng(seed). All random functions in the class will use this generator, unless a different generator is passed in as an argument to the function, by default None.
- vebose: boolean
True for verbose output.
Cluster Sub-classes¶
- class synthetic.ResolvedCluster(iso, imf, cluster_mass, ifmr=None, verbose=True, seed=None, keep_low_mass_stars=False)¶
Bases:
ClusterCluster sub-class that produces a resolved stellar cluster. A table is output with the synthetic photometry and intrinsic properties of the individual stars (or stellar systems, if mutliplicity is used in the IMF object).
If multiplicity is used, than a second table is produced that contains the properties of the companion stars independent of their primary stars.
- Parameters
- iso: isochrone object
SPISEA isochrone object
- imf: imf object
SPISEA IMF object
- cluster_mass: float
Total initial mass of the cluster, in M_sun
- ifmr: ifmr object, optional
If ifmr object is defined, will create compact remnants produced by the cluster at the given isochrone age. Otherwise, no compact remnants are produced. By default None.
- keep_low_mass_stars: boolean, optional
If True, the cluster will not cut out stars below the isochrone grid on initial mass. They are assigned a current mass equal to their initial mass, a phase of 98, and no other evolutionary properties or photometry. If False, stars below the isochrone initial mass limit are cut out. By default False.
- seed: int, optional
Seed for the random number generator numpy.random.default_rng(seed). All random functions in the class will use this generator, unless a different generator is passed in as an argument to the function, by default None.
- vebose: boolean, optional
True for verbose output.
- Attributes
- star_systems: astropy.table.Table
- Table containing the properties of the primary stars (or stellar systems, if multiplicity is used). The columns include:
mass: primary mass isMultiple: boolean for whether the star is in a multiple system systemMass: total initial mass of the stellar system (primary + companions) Teff: effective temperature of the star L: luminosity of the star in L_sun logg: surface gravity of the star in cgs isWR: boolean for whether the star is a Wolf-Rayet star mass_current: current mass of the star phase: evolutionary phase of the star, as defined by the isochrone model metallicity: metallicity of the star filter columns: magnitude of the star in each filter defined by the isochrone model
- companions: astropy.table.Table (only if multiplicity is used in the IMF object)
- Table containing the properties of the companion stars. The columns include:
system_idx: index of the stellar system this companion belongs to, which can be used to match to the star_systems table mass: initial mass of the companion star Teff: effective temperature of the companion star L: luminosity of the companion star in L_sun logg: surface gravity of the companion star in cgs isWR: boolean for whether the companion star is a Wolf-Rayet star mass_current: current mass of the companion star phase: evolutionary phase of the companion star, as defined by the isochrone model metallicity: metallicity of the companion star filter columns: magnitude of the companion star in each filter defined by the isochrone model If multiplicity properties are defined in the IMF object, additional columns for those properties (e.g., log_a, e, i, Omega, omega) are included.
Methods
set_filter_names()Set filter column names
- class synthetic.ResolvedClusterDiffRedden(iso, imf, cluster_mass, deltaAKs, ifmr=None, verbose=False, seed=None)¶
Bases:
ResolvedClusterSub-class of ResolvedCluster that applies differential extinction to the synthetic photometry.
- Parameters
- iso: isochrone object
SPISEA isochrone object
- imf: imf object
SPISEA IMF object
- cluster_mass: float
Total initial mass of the cluster, in M_sun
- delta_AKs: float
Amount of differential extinction to apply to synthetic photometry, in terms of magnitudes of extinction in the Ks filter. Specifically, delta_AKs defines the standard deviation of a Gaussian distribution from which the delta_AKs values will be drawn from for each individual system.
- ifmr: ifmr object, optional
If ifmr object is defined, will create compact remnants produced by the cluster at the given isochrone age. Otherwise, no compact remnants are produced.
- seed: int, optional
Seed for the random number generator numpy.random.default_rng(seed). All random functions in the class will use this generator, unless a different generator is passed in as an argument to the function, by default None.
- vebose: boolean, optional
True for verbose output.
- Attributes
- star_systems: astropy.table.Table
- Table containing the properties of the primary stars (or stellar systems, if multiplicity is used). The columns include:
mass: primary mass isMultiple: boolean for whether the star is in a multiple system systemMass: total initial mass of the stellar system (primary + companions) Teff: effective temperature of the star L: luminosity of the star in L_sun logg: surface gravity of the star in cgs isWR: boolean for whether the star is a Wolf-Rayet star mass_current: current mass of the star phase: evolutionary phase of the star, as defined by the isochrone model metallicity: metallicity of the star filter columns: magnitude of the star in each filter defined by the isochrone model, which have been perturbed by differential reddening according to the delta_AKs parameter AKs_f: the final AKs value for each star, which is the original AKs value from the isochrone plus the differential reddening drawn from the Gaussian distribution defined by delta_AKs
- companions: astropy.table.Table, optional
- If multiplicity is used, this table contains the properties of the companion stars. The columns include:
system_idx: index of the primary star’s system in the star_systems table mass: mass of the companion star Teff: effective temperature of the companion star L: luminosity of the companion star in L_sun logg: surface gravity of the companion star in cgs isWR: boolean for whether the companion star is a Wolf-Rayet star mass_current: current mass of the companion star phase: evolutionary phase of the companion star, as defined by the isochrone model metallicity: metallicity of the companion star filter columns: magnitude of the companion star in each filter defined by the isochrone model, which have been perturbed by differential reddening according to the delta_AKs parameter If multiplicity properties are defined in the IMF object, additional columns for those properties (e.g., log_a, e, i, Omega, omega) are included.
Methods
set_filter_names()Set filter column names
- class synthetic.UnresolvedCluster(iso, imf, cluster_mass, wave_range=[3000, 52000], verbose=False)¶
Bases:
ClusterCluster sub-class that produces an unresolved stellar cluster. Output is a combined spectrum that is the sum of the individual spectra of the cluster stars.
- Parameters
- iso: isochrone object
SPISEA isochrone object
- imf: imf object
SPISEA IMF object
- cluster_mass: float
Total initial mass of the cluster, in M_sun
- wave_range: 2-element array
Define the minumum and maximum wavelengths of the final output spectrum, in Angstroms. Array should be [min_wave, max_wave]
- vebose: boolean, optional
True for verbose output, by default False.
- Attributes
- mass_all: numpy array
The mass of each star in the cluster, in M_sun.
- spec_list: list of spectra
List of the spectra of each star in the cluster, resampled to a common wavelength grid
- spec_list_trim: list of spectra
List of the spectra of each star in the cluster, resampled to a common wavelength grid and trimmed to the wavelength range defined by wave_range
- spec_tot_full: numpy array
The total spectrum of the cluster, obtained by summing the spectra of all stars in spec_list, before trimming to wave_range
- spec_trim: numpy array
The total spectrum of the cluster, obtained by summing the spectra of all stars in spec_list_trim, which have been trimmed to the wavelength range defined by wave_range
- wave_trim: numpy array
The wavelength grid corresponding to spec_trim, which is the same as the wavelength grid of the individual spectra in spec_list_trim