Synthetic#

class asteca.Synthetic(isochs: Isochrones, def_params: dict[str, float] = {'Av': 0.2, 'DR': 0.0, 'Rv': 3.1, 'alpha': 0.09, 'beta': 0.94, 'dm': 9.0, 'loga': 8.0, 'met': 0.0152}, IMF_name: str = 'chabrier_2014', max_mass: int = 10000, gamma: float | str = 'D&K', ext_law: str = 'CCMO', DR_distribution: str = 'uniform', seed: int | None = None, verbose: int = 1)#

Bases: object

Define a Synthetic object.

Use the isochrones loaded in the Isochrones object to generate a Synthetic object. This object is used to generate synthetic clusters given a Cluster object and a set of input fundamental parameters (metallicity, age, distance, extinction, etc.).

See the Synthetic module section for more details.

Parameters:
  • isochs (Isochrones) – Isochrones object with the loaded files for the theoretical isochrones

  • def_params (dict[str, float]) – Default values for all the required fundamental parameters

  • IMF_name (str) – Name of the initial mass function used to populate the isochrones, one of salpeter_1955, kroupa_2001, chabrier_2014

  • max_mass (int) – Maximum total initial mass. Should be large enough to allow generating as many synthetic stars as observed stars

  • gamma (float | str) – Distribution function for the mass ratio of the binary systems, float or one of D&K, fisher_stepped, fisher_peaked, raghavan

  • ext_law (str) – Extinction law, one of CCMO, GAIADR3. If GAIADR3 is selected, the magnitude and first color defined in the Isochrones and Cluster objects are assumed to be Gaia’s (E)DR3 G and (BP-RP) respectively. The second color (if defined) will always be affected by the CCMO model

  • DR_distribution (str) – Distribution function for the differential reddening, one of uniform, normal

  • seed (int | None) – Random seed. If None a random integer will be generated and used

  • verbose (int) – Verbose level. A value of 0 hides all output

Raises:

ValueError – If any of the attributes is not recognized as a valid option

Methods Summary

calibrate(cluster)

Calibrate a Synthetic object based on a Cluster object .

cluster_masses([radec_c, rho_amb, M_B, r_B, ...])

Estimate the different total masses for the observed cluster.

generate([params, N_stars])

Generate a synthetic cluster.

get_isochrone(fit_params[, color_idx, ...])

Generate an isochrone for plotting.

get_models(model, model_std[, N_models, ...])

Generate random sampled models from the selected solution.

stellar_parameters([mag_offset_1, ...])

Estimate parameters for the observed stars: - Mass of single system - Mass of binary system; if binarity was estimated - Binary probabilities; if binarity was estimated - Blue straggler probabilities

Methods Documentation

calibrate(cluster: Cluster)#

Calibrate a Synthetic object based on a Cluster object .

Use the data obtained from your observed cluster, stored in the Cluster object, to calibrate a Synthetic object.

See the Synthetic module section for more details.

Parameters:

cluster (Cluster) – Cluster object with the processed data from your observed cluster

Raises:

ValueError

  • If required are ‘Cluster’ attributes missing.

  • If the number of colors defined in the Cluster and Synthetic objects do not match

cluster_masses(radec_c: tuple | None = None, rho_amb: float | None = None, M_B: float = 25000000000.0, r_B: float = 500.0, M_D: float = 75000000000.0, a: float = 5400.0, b: float = 300.0, M_s: float = 187000000000.0, r_s: float = 15190.0, C_env: float = 810000000.0, gamma: float = 0.62, epsilon: float = 0.08, return_arrays: bool = False) dict#

Estimate the different total masses for the observed cluster.

The returned dictionary contains distributions for M_init, M_actual, M_obs, M_phot, M_evol, M_dyn, where:

  • M_init : Initial mass

  • M_actual : Actual mass

  • M_obs : Observed mass

  • M_phot: Photometric mass, ie: mass not observed that is located below the maximum observed magnitude

  • M_evol: Mass lost via stellar evolution

  • M_dyn : Mass lost via dynamical effects

The actual and initial masses can also be obtained as:

  • M_actual = M_obs + M_phot

  • M_init = M_actual + M_evol + M_dyn

If rho_amb is not provided (None), then the method will try to estimate it using the cluster’s position and a model for the Galaxy’s potential. In this case, the coordinates of the cluster radec_c are required to estimate the ambient density. If these are also None, the method will try to resolve the coordinates from the cluster_ra and cluster_dec attributes, stored when calling the calibrate() method with a Cluster object. If these attributes are missing, a ValueError is raised because the ambient density cannot be estimated without coordinates.

Parameters:
  • radec_c (tuple | None) – Center coordinates in (RA, DEC)

  • rho_amb (float | None) – Ambient density [\(M_{\odot}\,pc^{-3}\)]. If None, it is estimated using the cluster’s position (radec_c) and a model for the Galaxy’s potential

  • M_B (float) – Bulge mass; defaults to 2.5e10 [\(M_{\odot}\)] (from Haghi et al. 2015, Table 1)

  • r_B (float) – Characteristic radius of the bulge; defaults to 0.5e3 [pc] (from Haghi et al. 2015, Table 1)

  • M_D (float) – Disc mass; defaults to 7.5e10 [\(M_{\odot}\)] (from Haghi et al. 2015, Table 1)

  • a (float) – Disc scale radius; defaults to 5400 [pc] (from Haghi et al. 2015, Table 1)

  • b (float) – Disc scaleheight; defaults to 300 [pc] (from Haghi et al. 2015, Table 1)

  • M_s (float) – Dark matter halo mass; defaults to 1.87e11 [\(M_{\odot}\)] (from Sanderson et al. 2017, Table 1)

  • r_s (float) – Dark matter halo scale radius; defaults to 15.19e3 [pc] (from Sanderson et al. 2017, Table 1)

  • C_env (float) – Constant related to the disruption time; defaults to 810e6 [Myr] (from Lamers, Gieles & Zwart 2005)

  • gamma (float) – Constant related to the disruption time (no units); defaults to 0.62 (from Lamers, Gieles & Zwart 2005)

  • epsilon (float) – Eccentricity of the orbit (no units); defaults to 0.08 (from Angelo et al. (2023))

  • return_arrays (bool) – If True, return arrays with the mass values for each model instead of the median and STDDEV values

Returns:

Dictionary with the mass distributions for the initial, actual, observed, photometric, evolutionary, and dynamical masses: M_init, M_actual, M_obs, M_phot, M_evol, M_dyn

Return type:

dict

Raises:

ValueError – If the get_models() method was not previously called

generate(params: dict = {}, N_stars: int = 100) ndarray | tuple[ndarray, ndarray]#

Generate a synthetic cluster.

The synthetic cluster is generated according to the parameters given in the params dictionary and the already calibrated Synthetic object.

The params``dictionary can include values for all or some of the parameters. E.g. of a dictionary with some fundamental parameters: ``params = {met: 0.0152, loga: 8.1, Av: 0.2, DR: 0., Rv: 3.1, dm: 9.7} If no params dictionary is given, an empty one is used and the default values defined in the Synthetic object are used to generate the synthetic cluster.

Parameters:
  • params (dict) – Dictionary containing the values for the fundamental parameters.

  • N_stars (int) – Number of synthetic stars to generate

Returns:

Returns a np.array containing a synthetic cluster with the data [mag, c1, (c2), mass, mass_b], where mag is the magnitude, c1 is the color, c2 is the optional second color, and mass, mass_b are the masses of the single and secondary components of the binary systems, respectively (if generated). If the system is a single star, then mass_b==np.nan.

Return type:

np.ndarray | tuple[np.ndarray, np.ndarray]

get_isochrone(fit_params: dict, color_idx: int = 0, full_track: bool = False, N_stars: int = 1000) ndarray#

Generate an isochrone for plotting.

The isochrone is generated using the fundamental parameter values given in the fit_params dictionary.

Parameters:
  • fit_params (dict) – Dictionary with the values for the fundamental parameters that were not included in the fix_params dictionary when the Synthetic object was calibrated (calibrate() method).

  • color_idx (int) – Index of the color to plot. If 0 (default), plot the first color. If 1 plot the second color

  • full_track (bool) – If True, return the full isochrone (ie: do not apply the max mass filter)

  • N_stars (int) – Number of synthetic stars to generate

Returns:

Array with the isochrone data to plot

Return type:

np.ndarray

get_models(model: dict[str, float], model_std: dict[str, float], N_models: int = 200, color_idx: int = 0) None#

Generate random sampled models from the selected solution. Use these models to generate full synthetic clusters.

Parameters:
  • model (dict[str, float]) – Dictionary with the values for the fundamental parameters

  • model_std (dict[str, float]) – Dictionary with the standard deviations for the fundamental parameters in the model argument

  • N_models (int) – Number of sampled models

  • color_idx (int) – Index of the color used to define the CMD. If only one color is defined, set to 0. If two colors are defined, set to 0 to use the first color, or 1 to use the second color. Defaults to 0.

Raises:

ValueError

  • If the calibrate() method was not previously called

  • If all the synthetic arrays generated are empty

stellar_parameters(mag_offset_1: float = 0.5, col_offset_1: float = -0.1, mag_offset_2: float = -0.5, col_offset_2: float = -0.05) dict#

Estimate parameters for the observed stars: - Mass of single system - Mass of binary system; if binarity was estimated - Binary probabilities; if binarity was estimated - Blue straggler probabilities

Parameters:
  • mag_offset_1 (float) – Offset applied to the turn-off magnitude to define the first BSS region

  • col_offset_1 (float) – Offset applied to the turn-off color to define the first BSS region

  • mag_offset_2 (float) – Offset applied to the turn-off magnitude to define the second BSS region

  • col_offset_2 (float) – Offset applied to the turn-off color to define the second BSS region

Returns:

Data frame containing per-star primary and secondary masses along with their uncertainties, and their probability of being a binary system and/or a blue straggler star (BSS)

Return type:

dict

Raises:

ValueError – If the get_models() method was not previously called