Cluster#
- class asteca.Cluster(ra: ndarray | None = None, dec: ndarray | None = None, magnitude: ndarray | None = None, e_mag: ndarray | None = None, color: ndarray | None = None, e_color: ndarray | None = None, color2: ndarray | None = None, e_color2: ndarray | None = None, plx: ndarray | None = None, e_plx: ndarray | None = None, pmra: ndarray | None = None, e_pmra: ndarray | None = None, pmde: ndarray | None = None, e_pmde: ndarray | None = None, N_clust_min: int = 25, N_clust_max: int = 5000, verbose: int = 1)#
Bases:
objectDefine a
Clusterobject.This object contains the basic data required to load a group of observed stars that could represent a cluster or an entire field.
- Parameters:
ra (np.ndarray | None) – Array that contains the right ascension (RA), defaults to
Nonedec (np.ndarray | None) – Array that contains the declination (DEC), defaults to
Nonemagnitude (np.ndarray | None) – Array that contains the magnitude, defaults to
Nonee_mag (np.ndarray | None) – Array that contains the magnitude’s uncertainty, defaults to
Nonecolor (np.ndarray | None) – Array that contains the color, defaults to
Nonee_color (np.ndarray | None) – Array that contains the color’s uncertainty, defaults to
Nonecolor2 (np.ndarray | None) – Array that contains the second color, defaults to
Nonee_color2 (np.ndarray | None) – Array that contains the second color’s uncertainty, defaults to
Noneplx (np.ndarray | None) – Array that contains the parallax, defaults to
Nonee_plx (np.ndarray | None) – Array that contains the parallax uncertainty, defaults to
Nonepmra (np.ndarray | None) – Array that contains the RA proper motion, defaults to
Nonee_pmra (np.ndarray | None) – Array that contains the RA proper motion’s uncertainty, defaults to
Nonepmde (np.ndarray | None) – Array that contains the DEC proper motion, defaults to
Nonee_pmde (np.ndarray | None) – Array that contains the DEC proper motion’s uncertainty, defaults to
NoneN_clust_min (int) – Minimum number of cluster members, defaults to
25N_clust_max (int) – Maximum number of cluster members, defaults to
5000verbose (int) – Verbose level. A value of
0hides all output, defaults to1
Methods Summary
get_center([algo, data_2d, radec_c, pms_c, ...])Estimate center coordinates for the cluster
get_nmembers([algo, eq_to_gal])Estimate the number of members for the cluster.
Methods Documentation
- get_center(algo: str = 'knn_5d', data_2d: str = 'radec', radec_c: tuple[float, float] | None = None, pms_c: tuple[float, float] | None = None, plx_c: float | None = None) None#
Estimate center coordinates for the cluster
Use the available data (ra, dec, pmra, pmde, plx) to estimate a cluster’s center coordinates as the point(s) of maximum density. Algorithms:
knn_5d: Estimates the 5-dimensional center values (inra, dec, pmra, pmde, plx) as the median position of the k (k=N_clust_min) stars with the largest nearest-neighbor density to a 5D center value that can be either given (fully or partially) or estimated.kde_2d: Estimates the 2-dimensional center values (either in(ra, dec)or in(pmra, pmde); determined by thedata_2dargument) using a Kernel Density Estimator (KDE).
- Parameters:
algo (str) – Algorithm used to estimate center values, one of (
knn_5d,kde_2d), defaults toknn_5ddata_2d (str) – String indicating the data to be used to estimate the center value, either:
radecorpms, defaults toradecradec_c (tuple[float, float] | None) – Estimated value for the (RA, DEC) center, defaults to
Nonepms_c (tuple[float, float] | None) – Estimated value for the (pmRA, pmDE) center, defaults to
Noneplx_c (float | None) – Estimated value for the plx center, defaults to
None
- Raises:
ValueError – If required data is missing from the
Clusterobject
- get_nmembers(algo: str = 'ripley', eq_to_gal: bool = True) None#
Estimate the number of members for the cluster. Algorithms:
ripley: Originally introduced with thefastMPmembership method in Perren et al. (2023). Requires(ra, dec, pmra, pmde, plx)and their center estimates.density: Simple algorithm that counts the number of stars within the cluster region (center+radius) and subtracts the expected number of field stars within that region. Requires the(ra, dec)center and the radius of the cluster to be defined.
- Parameters:
algo (str) – Algorithm used to estimate center values, one of (
ripley, density); defaults toripleyeq_to_gal (bool) – Convert
(ra, dec)to(lon, lat). Useful for clusters with largedecvalues to reduce the frame’s distortion, defaults toFalse
- Raises:
ValueError – If
algoargument is not recognizedAttributeError – If required attributes are missing from the
Clusterobject