Membership#

class asteca.Membership(my_field: Cluster)#

Bases: object

Define a Membership object.

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 introduced ASteCA. The method requires (RA, DEC) data and will use any extra data dimensions stored in the Cluster object, 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 the Cluster object. Photometry data is not employed.

Parameters:

my_field (Cluster) – Cluster object with the loaded data for the observed field

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_c and radius attributes are required to be present in the Cluster object.

Parameters:
  • N_runs (int) – Maximum number of runs

  • eq_to_gal (bool) – Convert (RA, DEC) to (lon, lat). Useful for clusters with large DEC values to reduce the frame’s distortion

  • seed (int | None) – Random seed. If None a random integer will be generated and used

Raises:
  • AttributeError – If either required attributes are missing from the Cluster object

  • ValueError – If the N_runs parameter 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) and plx are required.

Parameters:
  • fixed_centers (bool) – If True the center values (radec_c, pms_c, plx_c) stored in the Cluster object will be kept fixed throughout the process

  • N_runs (int) – Maximum number of resamples

  • eq_to_gal (bool) – Convert (RA, DEC) to (lon, lat). Useful for clusters with large DEC values to reduce the frame’s distortion

  • seed (int | None) – Random seed. If None a random integer will be generated and used

Raises:
  • AttributeError – If the Cluster object is missing a required attribute

  • ValueError – If the N_runs parameter 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 Cluster object 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_max stars 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_min and N_prob_max are provided,

    • neither is provided,

    • prob_min is not between 0 and 1,

    • no members are found with probability above prob_min

    • N_prob_max is greater than the total number of stars

Returns:

A new Cluster object containing only the selected members

Return type:

Cluster