Membership#
- class asteca.Membership(my_field: Cluster)#
Bases:
objectDefine a
Membershipobject.This object is used as a container for membership probabilities methods. Currently two methods are included:
bayesian(): The algorithm was described in detail in the article were we originally introducedASteCA. The method requires(RA, DEC)data and will use any extra data dimensions stored in theClusterobject, i.e.: photometry, proper motions, and parallax.fastmp(): The algorithm was described in detail in the article were we introduced the Unified Cluster Catalogue (UCC). The method requires proper motions, and parallax data dimensions stored in theClusterobject. Photometry data is not employed.Methods Summary
bayesian([N_runs, eq_to_gal, seed])Assign membership probabilities.
fastmp([fixed_centers, N_runs, eq_to_gal, seed])Assign membership probabilities.
select_members([prob_min, N_prob_max])Select members based on membership probabilities.
Methods Documentation
- bayesian(N_runs: int = 1000, eq_to_gal: bool = False, seed: int | None = None) None#
Assign membership probabilities.
Estimate the probability of being a true cluster member for all observed stars, using a Bayesian algorithm. The
radec_candradiusattributes are required to be present in theClusterobject.- Parameters:
N_runs (int) – Maximum number of runs
eq_to_gal (bool) – Convert
(RA, DEC)to(lon, lat). Useful for clusters with largeDECvalues to reduce the frame’s distortionseed (int | None) – Random seed. If
Nonea random integer will be generated and used
- Raises:
AttributeError – If either required attributes are missing from the
ClusterobjectValueError – If the
N_runsparameter is less than 10
- fastmp(fixed_centers: bool = True, N_runs: int = 1000, eq_to_gal: bool = True, seed: int | None = None) None#
Assign membership probabilities.
Estimate the probability of being a true cluster member for all observed stars using the fastMP algorithm. The following data dimensions are required:
(pmRA, pmDE, plx); photometry is not employed. Center estimates in(RA, DEC), as well as(pmRA, pmDE)andplxare required.- Parameters:
fixed_centers (bool) – If
Truethe center values (radec_c, pms_c, plx_c) stored in theClusterobject will be kept fixed throughout the processN_runs (int) – Maximum number of resamples
eq_to_gal (bool) – Convert
(RA, DEC)to(lon, lat). Useful for clusters with largeDECvalues to reduce the frame’s distortionseed (int | None) – Random seed. If
Nonea random integer will be generated and used
- Raises:
AttributeError – If the
Clusterobject is missing a required attributeValueError – If the
N_runsparameter is less than 10
- select_members(prob_min: float | None = 0.5, N_prob_max: int | None = None) Cluster#
Select members based on membership probabilities. This method modifies the
Clusterobject in place, keeping only the stars that meet the selection criteria.- Parameters:
prob_min (float | None) – Minimum probability threshold for membership selection. Stars with probabilities above this threshold will be selected as members.
N_prob_max (int | None) – Maximum number of members to select based on probability. The top
N_prob_maxstars with the highest probabilities will be selected as members.
- Raises:
AttributeError – If the ‘probs’ attribute is not defined in the ‘cluster’ object
ValueError –
Raised if:
both
prob_minandN_prob_maxare provided,neither is provided,
prob_minis not between 0 and 1,no members are found with probability above
prob_minN_prob_maxis greater than the total number of stars
- Returns:
A new
Clusterobject containing only the selected members- Return type: