stam.assign.assign_param
- stam.assign.assign_param(x, xerror, y, yerror, tracks, n_realizations=10, xparam='color', yparam='absmag', param='mass', interp_fun='rbf', binary_polygon=None, show_progress_bar=True, return_realizations=False, **kwargs)[source]
- assign_param(x, xerror, y, yerror, tracks, n_realizations=10, param=”mass”, interp_fun=”rbf”,
binary_polygon=None, **kwargs)
Assign a specific parameter (mass or metallicity) to a star, based on its color and magnitude.
- Parameters:
x (array_like) – x-axis parameter (usually the color of the stars, e.g. Gaia’s Gbp-Grp).
xerror (array_like) – color uncertainty (same size as color).
y (array_like) – Absolute magnitude of the stars (usually Gaia’s M_G; same size as color).
yerror (array_like) – mag uncertainty (same size as color).
tracks (Table) – Stellar-track grid, as retrieved by stam.tracks.get_isomasses or stam.tracks.get_combined_isomasses.
n_realizations (int, optional) – Number of realizations to draw for each star, from a 2D-Gaussian distribution around the color-magnitude position of the star (default: 10).
xparam (str, optional) – x-axis parameter (default: “color”).
yparam (str, optional) – y-axis parameter (default: “absmag”).
param (str, optional) – Which parameter to estimate (options: “mass”, “mh”; default: “mass”).
interp_fun (str, optional) – Which interpolation method to use (options: “rbf”, “griddata”, “nurbs”; default: “rbf”).
binary_polygon (Path object, optional) – The polygon defining the equal-mass binary region on the HR-diagram (default: None).
show_progress_bar (bool, optional) – If true, show progress bar (default: True).
return_realizations (bool, optional) – If true, also returns the individual realizations of param (default: False).
- Returns:
param_mean (array_like) – Estimated parameter mean for each star (same size as x).
param_error (array_like) – Estimated parameter standard deviation for each star (same size as x).
binary_param_mean (array_like, returned only if binary_polygon is not None) – Estimated parameter mean for each star inside binary_polygon, assuming an equal-mass binary (same size as x).
binary_param_error (array_like, returned only if binary_polygon is not None) – Estimated parameter standard deviation for each star inside binary_polygon, assuming an equal-mass binary (same size as x).
weight (array_like, returned only if binary_polygon is not None) – Single-star probability: the fraction of realizations in which the star was outside of binary_polygon (same size as x).
realizations (array_like, returned only if return_realizations is True) – Individual realizations of param (shape (len(x), n_realizations)).