Metadata-Version: 2.4
Name: gliders
Version: 0.1.5
Summary: GaLaxy Image DEcontamination Scripts - GLIDErS: Galaxy image cleaning and deblending pipeline
Author-email: Alejandro Erostegui <alexeros90@gmail.com>
License: Copyright (c) 2026 Alejandro Erostegui Losantos
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/alexeros90/gliders
Project-URL: Repository, https://github.com/alexeros90/gliders
Project-URL: Issues, https://github.com/alexeros90/gliders/issues
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: astropy
Requires-Dist: photutils
Requires-Dist: pandas
Requires-Dist: scikit-image
Requires-Dist: opencv-python
Requires-Dist: sep
Dynamic: license-file

# GLIDErS (GaLaxy Image DEcontamination Scripts)

**GLIDErS** is a Python package for cleaning astronomical images while preserving the main source of interest, such as a galaxy, and reducing contamination from foreground stars, neighboring objects, and overexposure artifacts.

## Features

- **Artifact removal:** Detects and cleans potential overexposure artifacts.
- **Star masking:** Identifies contaminating stars and applies masking or interpolation based on their overlap with the main source.
- **Source deblending:** Separates overlapping sources using configurable criteria, including redshift and photometric-type information.
- **Background subtraction:** Supports background subtraction.
- **Background suppression:** Reduces the background noise level improving the signal-to-noise ratio for detecting faint sources or features.
- **Quality flags:** Reports potential issues such as significant stellar contamination, source truncation at image boundaries, failed redshift queries, and insufficient source size.

## Getting Started

The main entry point is `clean_image`, which combines the available cleaning operations into a configurable workflow.

```python
from gliders.pipeline import clean_image

cleaned_image, main_source_segment, cleaning_mask, cleaning_flags = clean_image(
    image,
    source_pos=(x, y),
    mask_stars=True,
    deblend_sources=True,
    clean_artifacts=True,
    show_plots=False
)
```

Here, `image` is a two-dimensional astronomical image, and `source_pos` specifies the approximate pixel coordinates `(x, y)` of the main source.

The function returns the cleaned image, the final main-source segmentation, a mask identifying pixels marked by selected cleaning operations, and flags summarizing potential issues encountered during processing.

GLIDErS supports configurable cleaning strategies, allowing individual operations to be enabled or disabled according to the scientific application.

## Configuration

GLIDErS uses a configuration object to control source detection, masking, and deblending parameters. When no configuration is provided, the package loads its default configuration.

## License

See the [`LICENSE`](LICENSE) file for licensing information.

- **GitHub:** [View the source code](https://github.com/alexeros90/gliders)
- **PyPI:** [View the package on PyPI](https://pypi.org/project/GLIDErS/)
- **Issues:** [Report a bug or request a feature](https://github.com/alexeros90/gliders/issues)
