eloy.detection
==============

.. py:module:: eloy.detection

.. autoapi-nested-parse::

   Source detection utilities for astronomical images.

   This module provides functions for cleaning close coordinates and detecting
   stars in images using thresholding and morphological operations.



Functions
---------

.. autoapisummary::

   eloy.detection.clean_close_coords
   eloy.detection.stars_detection


Module Contents
---------------

.. py:function:: clean_close_coords(coords, min_separation=30)

   Remove coordinates that are closer than a minimum separation.

   :param coords: Array of (x, y) coordinates.
   :type coords: np.ndarray
   :param min_separation: Minimum allowed separation between coordinates.
   :type min_separation: float, optional

   :returns: Filtered array of coordinates with minimum separation enforced.
   :rtype: np.ndarray


.. py:function:: stars_detection(image, threshold=5, opening=5)

   Detect stars in an image using thresholding and morphological opening.

   :param image: 2D image data or object with .data attribute.
   :type image: np.ndarray or object with .data attribute
   :param threshold: Detection threshold in units of standard deviation above the median.
   :type threshold: float, optional
   :param opening: Size of the morphological opening kernel.
   :type opening: int, optional

   :returns: List of skimage.measure._regionprops.RegionProperties objects for detected regions.
   :rtype: list


