Metadata-Version: 2.5
Name: tessapps
Version: 0.2.8
Summary: TESS Aperture Photometry Pollution eStimator
Author: Leonidas Liponis
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Classifier: License :: OSI Approved :: MIT License
License-File: LICENSE
Requires-Dist: numpy>=1.21.2
Requires-Dist: scipy>=1.7.2
Requires-Dist: matplotlib>=3.5
Requires-Dist: astropy>=5.0
Requires-Dist: astroquery>=0.4.6
Requires-Dist: lightkurve>=2.0
Requires-Dist: bump-my-version ; extra == "dev"
Requires-Dist: flit ; extra == "dev"
Project-URL: Homepage, https://codeberg.org/leolip128/tessapps
Project-URL: Repository, https://codeberg.org/leolip128/tessapps
Provides-Extra: dev
Import-Name: tessapps

# TESS Aperture Photometry Pollution eStimator   [![PyPI](https://img.shields.io/pypi/v/tessapps)](https://pypi.org/project/tessapps/)

*Note: this module is not yet fully developed. For commercial use, please wait for v1.0.0. It is expected to be in development for at least another month.*

## Description

A python module that calculates a contamination factor in the aperture region of a tpf based on the relative flux of the background stars and the target.

<p align="center">
    <img src="https://codeberg.org/leolip128/tessapps/raw/branch/main/documentation/examples/images/HAT-P-1.png" alt="HAT-P-1 example" style="width:63.21%; height:auto;">
</p>

Full documentation is available [here](https://codeberg.org/leolip128/tessapps/src/branch/main/documentation/usage). Below is some useful information, taken from the documentation.

## Installation

### Prerequisites

Mandatory:

- ```numpy``` (>=1.21.2): to make all calculations
- ```scipy``` (>=1.7.2): to integrate the gaussian function
- ```astropy``` (>=5.0): to build data used in this module
- ```astroquery``` (>=0.4.6): to find stars in the target's region
- ```matplotlib``` (>=3.5): to plot the result (shows aperture mask with a caption at the bottom)

Optional:

- ```lightkurve``` (>=2.0): to fetch tpf files  (unless they already exist locally)

Python >=3.10 is required. The above are the earliest vesrions that have been found to work. Intermediate versions have not been individually checked, and testing proceeds with the latest versions of each dependency. More information can be found [here](https://codeberg.org/leolip128/tessapps/src/branch/main/documentation/installation).

### Package

To install, run ```pip install tessapps```. More info about installation can be found at the above link.

## Running the module

### Running from a notebook

A tpf is needed to run this module. If no tpf is supplied, the default is a file with HAT-P-1 (the example picture above). So, here is the minimal example:
```
import tessapps as tapps

tapps.run()

>>> [0.57675, 0.00191]
```

The first number is the contamination factor, and the second is its error. Here is a more realistic example with CoRoT-1 (also in the example images):

```
import lightkurve as lk
import tessapps as tapps

tpf_CoRoT_1 = lk.search_targetpixelfile('CoRoT 1')[1].download()
contamination, error = tapps.run(tpf_CoRoT_1, result=True)

>>> The background contributes (2.249 ± 0.020)% of the total flux in the aperture region.
```

This means that the contamination factor is 0.02249 ± 0.00020.

### Running from a terminal

Alternatively, from a terminal you can run this module as:
```
tapps --tpf tpf_file
python3 -m tessapps --tpf tpf_file
```

And also:
```
tapps --tpf tpf_file --result --sigma=1.2
```

More about usage info in [here](https://codeberg.org/leolip128/tessapps/src/branch/main/documentation/usage).

## Authors

Leonidas Liponis

## Links

Codeberg page: https://codeberg.org/leolip128/tessapps

PyPI page: https://pypi.org/project/tessapps/

Email (for contact): lliponis (at) physics.auth.gr

## AI Disclosure

No LLMs were used in the making of this project. All code was generated and verified by humans, so it will only contain human-made mistakes. All commits made by bots will be refused, and commits made by humans will be checked: published code should be fully understandable by the authors.

## To-Do list

- add description
- specify dependencies' versions
- add options to run the module
- redo the examples since they reference the flux instead of the contamination factor
- add the scoring function
- add more stuff in this to-do list
