stam.assign.assign_to_polygon

stam.assign.assign_to_polygon(color, color_error, mag, mag_error, polygon, n_realizations=10, thresh=0.5)[source]

Assign a star to a polygon based on its color and magnitude (taking uncertainties into account).

Parameters:
  • color (array_like) – Color of the stars (usually Gaia’s Gbp-Grp).

  • color_error (array_like) – color uncertainty (same size as color).

  • mag (array_like) – Absolute magnitude of the stars (usually Gaia’s M_G; same size as color).

  • mag_error (array_like) – mag uncertainty (same size as color).

  • polygon (Path object) – A polygon defining a location on the CMD.

  • 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).

  • thresh (float, optional) – Polygon assignment minimal threshold score (default: 0.5).

  • show_progress_bar (bool, optional) – If true, show progress bar (default: True).

Returns:

inside_idx – Indices of stars inside the polygon.

Return type:

array_like