asteca.synthetic
#
Module Contents#
Classes#
Define a |
- class asteca.synthetic.synthetic#
Define a
synthetic
object.Use the isochrones loaded in the
asteca.isochrones
object to generate aasteca.synthetic
object. This object is used to generate synthetic clusters given aasteca.cluster
object and a set of input fundamental parameters (metallicity, age, distance, extinction, etc.).See the Synthetic clusters section for more details.
- Parameters:
isochs (
isochrones
) –asteca.isochrones
object with the loaded files for the theoretical isochrones.ext_law (str, {"CCMO", "GAIADR3"}, default="CCMO") – Extinction law. If “GAIADR3” is selected, the magnitude and first color defined in
isochrones
andcluster
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, {"uniform", "normal"}, default="uniform") – Distribution function for the differential reddening.
IMF_name (str, {"salpeter_1955", "kroupa_2001", "chabrier_2014"}, default="chabrier_2014") – Name of the initial mass function used to populate the isochrones.
max_mass (int, default=100_000) – Maximum total initial mass. Should be large enough to allow generating as many synthetic stars as observed stars.
gamma (str, float, {"D&K", "fisher_stepped", "fisher_peaked", "raghavan"}, default="D&K") – Distribution function for the mass ratio of the binary systems.
seed (int, optional, default=None) – Random seed. If
None
a random integer will be generated and used.
- calibrate(cluster, fix_params: dict = {})#
Calibrate a
asteca.synthetic
object based on aasteca.cluster
object and a dictionary of fixed fundamental parameters (fix_params
).Use the data obtained from your observed cluster stored in the
asteca.cluster
object, to calibrate aasteca.synthetic
object. Additionally, a dictionary of fixed fundamental parameters (metallicity, age, distance, extinction, etc.) can be passed.See the Synthetic clusters section for more details.
- Parameters:
cluster (
cluster
) –asteca.cluster
object with the processed data from your observed cluster.fix_params (dict, optional, default={}) – Dictionary with the values for the fixed parameters (if any).
- generate(fit_params: dict) numpy.ndarray #
Generate a synthetic cluster.
The synthetic cluster is generated according to the parameters given in the
fit_params
dictionary and the already calibratedasteca.synthetic
object.- Parameters:
fit_params (dict) – Dictionary with the values for the fundamental parameters that were not included in the
fix_params
dictionary when theasteca.synthetic
object was calibrated (synthetic.calibrate()
method).- Returns:
Return a
np.array
containing a synthetic cluster with the shape[mag, c1, (c2)]
, wheremag
is the magnitude dimension, andc1
andc2
(last one is optional) are the color dimension(s).- Return type:
array[mag, c1, (c2)]
- synthplot(ax, fit_params, color_idx=0, isochplot=False)#
Generate a color-magnitude plot for a synthetic cluster.
The synthetic cluster is generated using the fundamental parameter values given in the
fit_params
dictionary.- Parameters:
ax (matplotlib.axis, optional, default=None) – Matplotlib axis where to draw the plot.
fit_params (dict) – Dictionary with the values for the fundamental parameters that were not included in the
fix_params
dictionary when theasteca.synthetic
object was calibrated (synthetic.calibrate()
method).color_idx (int, default=0) – Index of the color to plot. If
0
(default), plot the first color. If1
plot the second color.isochplot (bool, default=False) – If
True
, the accompanying isochrone will be plotted.
- Returns:
Matplotlib axis object
- Return type:
matplotlib.axis
- masses_binary_probs(model, model_std)#
Estimate individual masses for the observed stars, along with their binary probabilities (if binarity was estimated).
- Parameters:
model (dict) – Dictionary with the values for the fundamental parameters that were not included in the
fix_params
dictionary when theasteca.synthetic
object was calibrated (synthetic.calibrate()
method).model_std (dict) – Dictionary with the standard deviations for the fundamental parameters in the
model
argument.
- Returns:
pandas.DataFrame – Data frame containing per-star primary and secondary masses along with their uncertainties, and their probability of being a binary system.
numpy.array – Distribution of total binary fraction values for the cluster.