tessapps 0.2.2__tar.gz → 0.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,145 @@
1
+ Metadata-Version: 2.5
2
+ Name: tessapps
3
+ Version: 0.2.4
4
+ Summary: TESS Aperture Photometry Pollution eStimator
5
+ Author: Leonidas Liponis
6
+ Requires-Python: >=3.9
7
+ Description-Content-Type: text/markdown
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ License-File: LICENSE
10
+ Requires-Dist: numpy
11
+ Requires-Dist: scipy
12
+ Requires-Dist: matplotlib
13
+ Requires-Dist: astropy
14
+ Requires-Dist: astroquery
15
+ Requires-Dist: lightkurve
16
+ Requires-Dist: bump-my-version ; extra == "dev"
17
+ Requires-Dist: flit ; extra == "dev"
18
+ Project-URL: Homepage, https://codeberg.org/leolip128/tessapps
19
+ Project-URL: Repository, https://codeberg.org/leolip128/tessapps
20
+ Provides-Extra: dev
21
+ Import-Name: tessapps
22
+
23
+ # TESS Aperture Photometry Pollution eStimator [![PyPI](https://img.shields.io/pypi/v/tessapps)](https://pypi.org/project/tessapps/)
24
+
25
+ ## Description
26
+
27
+ 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.
28
+
29
+ <p align="center">
30
+ <img src="https://github.com/leolip128/tessapps/blob/main/examples/HAT-P-1.png" alt="HAT-P-1 example" style="width:63.21%; height:auto;">
31
+ </p>
32
+
33
+ ## Prerequisites
34
+
35
+ Mandatory:
36
+
37
+ - ```numpy``` (2.4.2): to make all calculations
38
+ - ```scipy``` (1.17.1): to integrate the gaussian function
39
+ - ```astropy``` (8.0.1): to build data used in this module
40
+ - ```astroquery``` (0.4.11): to find stars in the target's region
41
+
42
+ Optional:
43
+
44
+ - ```lightkurve``` (2.6.0): to fetch tpf files (unless they already exist locally)
45
+ - ```matplotlib``` (3.10.8): to plot the result (shows aperture mask with a caption at the bottom)
46
+
47
+ A future version will include minimum working versions (these are the only tested so far)
48
+
49
+ ## Running the module
50
+
51
+ 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:
52
+ ```
53
+ import tessapps as tapps
54
+
55
+ tapps.run()
56
+
57
+ >>> [0.42325, 0.00191]
58
+ ```
59
+
60
+ The first number is 1 minus the contamination factor, and the second is its error. Here is a more realistic example with CoRoT-1 (also in the example images):
61
+
62
+ ```
63
+ import lightkurve as lk
64
+ import tessapps as tapps
65
+
66
+ tpf_CoRoT_1 = lk.search_targetpixelfile('CoRoT 1')[1].download()
67
+ flux, error = tapps.run(tpf_CoRoT_1, result=True)
68
+
69
+ >>> The target star contributes (97.751 ± 0.020)% of the total flux.
70
+ ```
71
+
72
+ ## File Organization
73
+
74
+ ### Files in ```/src```:
75
+
76
+ ```bash
77
+ src
78
+ └── tessapps
79
+ ├── __init__.py
80
+ ├── __main__.py
81
+ ├── main.py
82
+ ├── tpf_to_nearby_stars.py
83
+ ├── nearby_stars_to_data.py
84
+ └── data_to_contamination.py
85
+
86
+ 2 directories, 6 files
87
+ ```
88
+
89
+ ### File description
90
+
91
+ - ```__init__.py```: makes it so that the user can run ```tessapps.run(...)```
92
+ - ```__main__.py```: executes main.py
93
+ - ```main.py```: the file that runs all other relevant files
94
+ - ```tpf_to_nearby_stars.py```: produces a list of stars near the target star only using the tpf file
95
+ - ```nearby_stars_to_data.py```: builds a data table containing all relevant information about stars, in a format readable by this module
96
+ - ```data_to_contamination.py``` constructs the gaussian fields and calulates the contamination filter
97
+
98
+ ## Possible Issues
99
+
100
+ - ```ConnectionResetError```: happens sometimes due to ```urllib3```. Run again and it should compile normally.
101
+
102
+ ## Authors
103
+
104
+ Leonidas Liponis
105
+
106
+ ## Links
107
+
108
+ Github page: https://github.com/leolip128/tessapps
109
+
110
+ PyPI page: https://pypi.org/project/tessapps/
111
+
112
+ Email (for contact): lliponis (at) physics.auth.gr
113
+
114
+ ## AI Disclosure
115
+
116
+ 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 on github made by bots will be refused, and commits made by humans will be checked: published code should be fully understandable by the authors.
117
+
118
+ ## To-Do list
119
+
120
+ - add description
121
+ - specify dependencies' versions
122
+ - add options to run the module
123
+ - add more stuff in this to-do list
124
+
125
+ ## Notes
126
+
127
+ ### Examples
128
+
129
+ The default tpf is ```lk.search_targetpixelfile("HAT-P-1", mission="TESS", sector=84, exptime=120)[0].download()```, with ```[0]``` specified for reproducability (there is only one such file as of October 2026). HAT-P-1 has a star directly next to it with similar brightness, so it is a good default file as it is expected to find a contamination factor of about 0.5 (actual: 0.42).
130
+
131
+ All examples provided were generated with the following tpfs:
132
+
133
+ - HAT-P-1: ```lk.search_targetpixelfile("HAT-P-1", mission="TESS", sector=84, exptime=120)[0].download()```
134
+ - WASP-12: ```lk.search_targetpixelfile("WASP-12", mission="TESS", sector=20, exptime=120).download()```
135
+ - TOI-122: ```lk.search_targetpixelfile("TOI-122", mission="TESS", exptime=1800).download()```
136
+ - AUMic: ```lk.search_targetpixelfile('20:45:09.5323 -31:20:27.241')[4].download()```
137
+ - 55-Cnc: ```lk.search_targetpixelfile('55 Cnc')[6].download()```
138
+ - CoRoT-1: ```lk.search_targetpixelfile('CoRoT 1')[1].download()```
139
+ - CoRoT-10: ```lk.search_targetpixelfile('19:24:15.2868 +00:44:46.003')[1].download()```
140
+
141
+ The caption on each example was edited manually to show the name of each star.
142
+
143
+ ### Other
144
+
145
+ The directory in File Organization has its files sorted manually.
@@ -0,0 +1,123 @@
1
+ # TESS Aperture Photometry Pollution eStimator [![PyPI](https://img.shields.io/pypi/v/tessapps)](https://pypi.org/project/tessapps/)
2
+
3
+ ## Description
4
+
5
+ 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.
6
+
7
+ <p align="center">
8
+ <img src="https://github.com/leolip128/tessapps/blob/main/examples/HAT-P-1.png" alt="HAT-P-1 example" style="width:63.21%; height:auto;">
9
+ </p>
10
+
11
+ ## Prerequisites
12
+
13
+ Mandatory:
14
+
15
+ - ```numpy``` (2.4.2): to make all calculations
16
+ - ```scipy``` (1.17.1): to integrate the gaussian function
17
+ - ```astropy``` (8.0.1): to build data used in this module
18
+ - ```astroquery``` (0.4.11): to find stars in the target's region
19
+
20
+ Optional:
21
+
22
+ - ```lightkurve``` (2.6.0): to fetch tpf files (unless they already exist locally)
23
+ - ```matplotlib``` (3.10.8): to plot the result (shows aperture mask with a caption at the bottom)
24
+
25
+ A future version will include minimum working versions (these are the only tested so far)
26
+
27
+ ## Running the module
28
+
29
+ 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:
30
+ ```
31
+ import tessapps as tapps
32
+
33
+ tapps.run()
34
+
35
+ >>> [0.42325, 0.00191]
36
+ ```
37
+
38
+ The first number is 1 minus the contamination factor, and the second is its error. Here is a more realistic example with CoRoT-1 (also in the example images):
39
+
40
+ ```
41
+ import lightkurve as lk
42
+ import tessapps as tapps
43
+
44
+ tpf_CoRoT_1 = lk.search_targetpixelfile('CoRoT 1')[1].download()
45
+ flux, error = tapps.run(tpf_CoRoT_1, result=True)
46
+
47
+ >>> The target star contributes (97.751 ± 0.020)% of the total flux.
48
+ ```
49
+
50
+ ## File Organization
51
+
52
+ ### Files in ```/src```:
53
+
54
+ ```bash
55
+ src
56
+ └── tessapps
57
+ ├── __init__.py
58
+ ├── __main__.py
59
+ ├── main.py
60
+ ├── tpf_to_nearby_stars.py
61
+ ├── nearby_stars_to_data.py
62
+ └── data_to_contamination.py
63
+
64
+ 2 directories, 6 files
65
+ ```
66
+
67
+ ### File description
68
+
69
+ - ```__init__.py```: makes it so that the user can run ```tessapps.run(...)```
70
+ - ```__main__.py```: executes main.py
71
+ - ```main.py```: the file that runs all other relevant files
72
+ - ```tpf_to_nearby_stars.py```: produces a list of stars near the target star only using the tpf file
73
+ - ```nearby_stars_to_data.py```: builds a data table containing all relevant information about stars, in a format readable by this module
74
+ - ```data_to_contamination.py``` constructs the gaussian fields and calulates the contamination filter
75
+
76
+ ## Possible Issues
77
+
78
+ - ```ConnectionResetError```: happens sometimes due to ```urllib3```. Run again and it should compile normally.
79
+
80
+ ## Authors
81
+
82
+ Leonidas Liponis
83
+
84
+ ## Links
85
+
86
+ Github page: https://github.com/leolip128/tessapps
87
+
88
+ PyPI page: https://pypi.org/project/tessapps/
89
+
90
+ Email (for contact): lliponis (at) physics.auth.gr
91
+
92
+ ## AI Disclosure
93
+
94
+ 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 on github made by bots will be refused, and commits made by humans will be checked: published code should be fully understandable by the authors.
95
+
96
+ ## To-Do list
97
+
98
+ - add description
99
+ - specify dependencies' versions
100
+ - add options to run the module
101
+ - add more stuff in this to-do list
102
+
103
+ ## Notes
104
+
105
+ ### Examples
106
+
107
+ The default tpf is ```lk.search_targetpixelfile("HAT-P-1", mission="TESS", sector=84, exptime=120)[0].download()```, with ```[0]``` specified for reproducability (there is only one such file as of October 2026). HAT-P-1 has a star directly next to it with similar brightness, so it is a good default file as it is expected to find a contamination factor of about 0.5 (actual: 0.42).
108
+
109
+ All examples provided were generated with the following tpfs:
110
+
111
+ - HAT-P-1: ```lk.search_targetpixelfile("HAT-P-1", mission="TESS", sector=84, exptime=120)[0].download()```
112
+ - WASP-12: ```lk.search_targetpixelfile("WASP-12", mission="TESS", sector=20, exptime=120).download()```
113
+ - TOI-122: ```lk.search_targetpixelfile("TOI-122", mission="TESS", exptime=1800).download()```
114
+ - AUMic: ```lk.search_targetpixelfile('20:45:09.5323 -31:20:27.241')[4].download()```
115
+ - 55-Cnc: ```lk.search_targetpixelfile('55 Cnc')[6].download()```
116
+ - CoRoT-1: ```lk.search_targetpixelfile('CoRoT 1')[1].download()```
117
+ - CoRoT-10: ```lk.search_targetpixelfile('19:24:15.2868 +00:44:46.003')[1].download()```
118
+
119
+ The caption on each example was edited manually to show the name of each star.
120
+
121
+ ### Other
122
+
123
+ The directory in File Organization has its files sorted manually.
@@ -16,7 +16,7 @@ dependencies = ["numpy", "scipy", "matplotlib", "astropy", "astroquery", "lightk
16
16
  dev = ["bump-my-version", "flit"]
17
17
 
18
18
  [tool.bumpversion]
19
- current_version = "0.2.2"
19
+ current_version = "0.2.4"
20
20
  commit = false
21
21
  tag = false
22
22
  allow_dirty = true
@@ -24,6 +24,10 @@ allow_dirty = true
24
24
  [[tool.bumpversion.files]]
25
25
  filename = "src/tessapps/__init__.py"
26
26
 
27
+ [project.urls]
28
+ Homepage = "https://codeberg.org/leolip128/tessapps"
29
+ Repository = "https://codeberg.org/leolip128/tessapps"
30
+
27
31
  [project.scripts]
28
32
  tessapps = "tessapps.main:main"
29
33
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  from tessapps.main import run
4
4
 
5
- __version__ = "0.2.2"
5
+ __version__ = "0.2.4"
6
6
  __all__ = ["run"]
@@ -1,7 +1,7 @@
1
- import warnings
2
- from erfa import ErfaWarning
3
- warnings.filterwarnings("ignore", category=ErfaWarning)
4
- warnings.filterwarnings("ignore", message=".*tpfmodel submodule is not available.*")
1
+ # import warnings
2
+ # from erfa import ErfaWarning
3
+ # warnings.filterwarnings("ignore", category=ErfaWarning)
4
+ # warnings.filterwarnings("ignore", message=".*tpfmodel submodule is not available.*")
5
5
 
6
6
  import lightkurve as lk
7
7
  import numpy as np
@@ -13,7 +13,6 @@ from astropy.coordinates import SkyCoord
13
13
  from astropy.wcs.utils import proj_plane_pixel_scales
14
14
  from astroquery.mast import Catalogs
15
15
 
16
- import argparse
17
16
  import matplotlib.pyplot as plt
18
17
  from pathlib import Path
19
18
 
@@ -21,7 +20,7 @@ import tessapps.tpf_to_nearby_stars as ttns
21
20
  import tessapps.nearby_stars_to_data as nstd
22
21
  import tessapps.data_to_contamination as dtc
23
22
 
24
- def run(tpf, pixel_overshoot=1, sigma=1, digits=3, info=False, result=False, plot=False, output_directory="tessapps-results"):
23
+ def run(tpf=None, pixel_overshoot=1, sigma=1, digits=3, info=False, result=False, plot=False, output_directory="tessapps-results"):
25
24
  if tpf is None: tpf = lk.search_targetpixelfile("HAT-P-1", mission="TESS", sector=84, exptime=120).download()
26
25
  stars = ttns.tpf_to_nearby_stars(tpf, pixel_overshoot, info)
27
26
  data = nstd.data_builder(tpf, stars)
@@ -38,17 +37,4 @@ def run(tpf, pixel_overshoot=1, sigma=1, digits=3, info=False, result=False, plo
38
37
  out_path.parent.mkdir(parents=True, exist_ok=True)
39
38
  fig.savefig(out_path, dpi=200, bbox_inches="tight")
40
39
  plt.show
41
- return [float(target_contribution), float(total_error)]
42
-
43
- def main(argv=None):
44
- parser = argparse.ArgumentParser()
45
- parser.add_argument("--tpf", default=None)
46
- parser.add_argument("--overshoot", type=float, default=1)
47
- parser.add_argument("--sigma", type=float, default=1)
48
- parser.add_argument("--digits", type=int, default=3)
49
- parser.add_argument("--info", dest="info", action="store_true")
50
- parser.add_argument("--result", dest="result", action="store_true")
51
- parser.add_argument("--plot", dest="plot", action="store_true")
52
- parser.add_argument("--out_dir", default="tapps-results")
53
- args = parser.parse_args(argv)
54
- run(args.tpf, args.overshoot, args.sigma, args.digits, args.info, args.result, args.plot, args.out_dir)
40
+ return [float(target_contribution), float(total_error)]
tessapps-0.2.2/PKG-INFO DELETED
@@ -1,88 +0,0 @@
1
- Metadata-Version: 2.5
2
- Name: tessapps
3
- Version: 0.2.2
4
- Summary: TESS Aperture Photometry Pollution eStimator
5
- Author: Leonidas Liponis
6
- Requires-Python: >=3.9
7
- Description-Content-Type: text/markdown
8
- Classifier: License :: OSI Approved :: MIT License
9
- License-File: LICENSE
10
- Requires-Dist: numpy
11
- Requires-Dist: scipy
12
- Requires-Dist: matplotlib
13
- Requires-Dist: astropy
14
- Requires-Dist: astroquery
15
- Requires-Dist: lightkurve
16
- Requires-Dist: bump-my-version ; extra == "dev"
17
- Requires-Dist: flit ; extra == "dev"
18
- Provides-Extra: dev
19
- Import-Name: tessapps
20
-
21
- # TESS Aperture Photometry Pollution eStimator [![PyPI](https://img.shields.io/pypi/v/tessapps)](https://pypi.org/project/tessapps/)
22
-
23
- ## Description
24
-
25
- A python module that calculates a contamination factor for the target star in a tpf file based on the flux of background stars.
26
-
27
- <img src="https://github.com/leolip128/tessapps/blob/main/examples/HAT-P-1.png?raw=true" alt="HAT-P-1 example" style="width:500; height:auto;">
28
-
29
- ## Prerequisites
30
-
31
- Mandatory:
32
-
33
- - ```numpy``` (2.4.2): to make all calculations
34
- - ```scipy``` (1.17.1): to integrate the gaussian function
35
- - ```astropy``` (8.0.1): to build data used in this module
36
- - ```astroquery``` (0.4.11): to find stars in the target's region
37
-
38
- Optional:
39
-
40
- - ```lightkurve``` (2.6.0): to fetch tpf files
41
- - ```matplotlib``` (3.10.8): to plot the result
42
-
43
- ## Running the module
44
-
45
- To run this module, here is an example:
46
- ```
47
- import tessapps as tapps
48
-
49
- flux, error = tapps.run(tpf_file)
50
- print(flux, error)
51
- ```
52
-
53
- Here is a more complete example:
54
- ```
55
- import tessapps as tapps
56
- import lightkurve as lk
57
-
58
- tpf_file = lk.search_targetpixelfile("HAT-P-1", mission="TESS", sector=84, exptime=120).download() # example file
59
-
60
- flux, error = tapps.run(tpf_file)
61
- print(flux, error)
62
- ```
63
-
64
- ## File Organization
65
-
66
- ## Authors
67
-
68
- Leonidas Liponis
69
-
70
- ## Links
71
-
72
- Github page: https://github.com/leolip128/tessapps
73
-
74
- PyPI page: https://pypi.org/project/tessapps/
75
-
76
- Email (for contact): lliponis (at) physics.auth.gr
77
-
78
- ## AI Disclosure
79
-
80
- 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 on github made by bots will be refused, and commits made by humans will be checked: published code should be fully understandable by the authors.
81
-
82
- ## To-Do list
83
-
84
- - add description
85
- - specify dependencies' versions
86
- - add file organization
87
- - add options to run the module
88
- - add more stuff in this to-do list
tessapps-0.2.2/README.md DELETED
@@ -1,68 +0,0 @@
1
- # TESS Aperture Photometry Pollution eStimator [![PyPI](https://img.shields.io/pypi/v/tessapps)](https://pypi.org/project/tessapps/)
2
-
3
- ## Description
4
-
5
- A python module that calculates a contamination factor for the target star in a tpf file based on the flux of background stars.
6
-
7
- <img src="https://github.com/leolip128/tessapps/blob/main/examples/HAT-P-1.png?raw=true" alt="HAT-P-1 example" style="width:500; height:auto;">
8
-
9
- ## Prerequisites
10
-
11
- Mandatory:
12
-
13
- - ```numpy``` (2.4.2): to make all calculations
14
- - ```scipy``` (1.17.1): to integrate the gaussian function
15
- - ```astropy``` (8.0.1): to build data used in this module
16
- - ```astroquery``` (0.4.11): to find stars in the target's region
17
-
18
- Optional:
19
-
20
- - ```lightkurve``` (2.6.0): to fetch tpf files
21
- - ```matplotlib``` (3.10.8): to plot the result
22
-
23
- ## Running the module
24
-
25
- To run this module, here is an example:
26
- ```
27
- import tessapps as tapps
28
-
29
- flux, error = tapps.run(tpf_file)
30
- print(flux, error)
31
- ```
32
-
33
- Here is a more complete example:
34
- ```
35
- import tessapps as tapps
36
- import lightkurve as lk
37
-
38
- tpf_file = lk.search_targetpixelfile("HAT-P-1", mission="TESS", sector=84, exptime=120).download() # example file
39
-
40
- flux, error = tapps.run(tpf_file)
41
- print(flux, error)
42
- ```
43
-
44
- ## File Organization
45
-
46
- ## Authors
47
-
48
- Leonidas Liponis
49
-
50
- ## Links
51
-
52
- Github page: https://github.com/leolip128/tessapps
53
-
54
- PyPI page: https://pypi.org/project/tessapps/
55
-
56
- Email (for contact): lliponis (at) physics.auth.gr
57
-
58
- ## AI Disclosure
59
-
60
- 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 on github made by bots will be refused, and commits made by humans will be checked: published code should be fully understandable by the authors.
61
-
62
- ## To-Do list
63
-
64
- - add description
65
- - specify dependencies' versions
66
- - add file organization
67
- - add options to run the module
68
- - add more stuff in this to-do list
File without changes