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:
object
Define a
Cluster
object.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
None
dec (np.ndarray | None) – Array that contains the declination (DEC), defaults to
None
magnitude (np.ndarray | None) – Array that contains the magnitude, defaults to
None
e_mag (np.ndarray | None) – Array that contains the magnitude’s uncertainty, defaults to
None
color (np.ndarray | None) – Array that contains the color, defaults to
None
e_color (np.ndarray | None) – Array that contains the color’s uncertainty, defaults to
None
color2 (np.ndarray | None) – Array that contains the second color, defaults to
None
e_color2 (np.ndarray | None) – Array that contains the second color’s uncertainty, defaults to
None
plx (np.ndarray | None) – Array that contains the parallax, defaults to
None
e_plx (np.ndarray | None) – Array that contains the parallax uncertainty, defaults to
None
pmra (np.ndarray | None) – Array that contains the RA proper motion, defaults to
None
e_pmra (np.ndarray | None) – Array that contains the RA proper motion’s uncertainty, defaults to
None
pmde (np.ndarray | None) – Array that contains the DEC proper motion, defaults to
None
e_pmde (np.ndarray | None) – Array that contains the DEC proper motion’s uncertainty, defaults to
None
N_clust_min (int) – Minimum number of cluster members, defaults to
25
N_clust_max (int) – Maximum number of cluster members, defaults to
5000
verbose (int) – Verbose level. A value of
0
hides 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_2d
argument) using a Kernel Density Estimator (KDE).
- Parameters:
algo (str) – Algorithm used to estimate center values, one of (
knn_5d
,kde_2d
), defaults toknn_5d
data_2d (str) – String indicating the data to be used to estimate the center value, either:
radec
orpms
, defaults toradec
radec_c (tuple[float, float] | None) – Estimated value for the (RA, DEC) center, defaults to
None
pms_c (tuple[float, float] | None) – Estimated value for the (pmRA, pmDE) center, defaults to
None
plx_c (float | None) – Estimated value for the plx center, defaults to
None
- Raises:
ValueError – If required data is missing from the
Cluster
object
- get_nmembers(algo: str = 'ripley', eq_to_gal: bool = True) None #
Estimate the number of members for the cluster. Algorithms:
ripley
: Originally introduced with thefastMP
membership 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 toripley
eq_to_gal (bool) – Convert
(ra, dec)
to(lon, lat)
. Useful for clusters with largedec
values to reduce the frame’s distortion, defaults toFalse
- Raises:
ValueError – If
algo
argument is not recognizedAttributeError – If required attributes are missing from the
Cluster
object