tessapps 0.2.2__tar.gz → 0.2.3__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,144 @@
1
+ Metadata-Version: 2.5
2
+ Name: tessapps
3
+ Version: 0.2.3
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
+ <p align="center">
28
+ <img src="examples/HAT-P-1.png" alt="HAT-P-1 example" style="width:63.21%; height:auto;">
29
+ </p>
30
+
31
+ ## Prerequisites
32
+
33
+ Mandatory:
34
+
35
+ - ```numpy``` (2.4.2): to make all calculations
36
+ - ```scipy``` (1.17.1): to integrate the gaussian function
37
+ - ```astropy``` (8.0.1): to build data used in this module
38
+ - ```astroquery``` (0.4.11): to find stars in the target's region
39
+
40
+ Optional:
41
+
42
+ - ```lightkurve``` (2.6.0): to fetch tpf files
43
+ - ```matplotlib``` (3.10.8): to plot the result
44
+
45
+ A future version will include minimum working versions (these are the only tested so far)
46
+
47
+ ## Running the module
48
+
49
+ 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:
50
+ ```
51
+ import tessapps as tapps
52
+
53
+ tapps.run()
54
+
55
+ >>> [0.42325, 0.00191]
56
+ ```
57
+
58
+ 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):
59
+
60
+ ```
61
+ import lightkurve as lk
62
+ import tessapps as tapps
63
+
64
+ tpf_CoRoT_1 = lk.search_targetpixelfile('CoRoT 1')[1].download()
65
+ flux, error = tapps.run(tpf_CoRoT_1, result=True)
66
+
67
+ >>> The target star contributes (97.751 ± 0.020)% of the total flux.
68
+ ```
69
+
70
+ ## File Organization
71
+
72
+ ### All files in ```/src``` are these:
73
+
74
+ ```bash
75
+ src
76
+ └── tessapps
77
+ ├── __init__.py
78
+ ├── __main__.py
79
+ ├── main.py
80
+ ├── tpf_to_nearby_stars.py
81
+ ├── nearby_stars_to_data.py
82
+ └── data_to_contamination.py
83
+
84
+ 2 directories, 6 files
85
+ ```
86
+
87
+ ### File description
88
+
89
+ - ```__init__.py```: makes it so that the user can run ```tessapps.run(...)```
90
+ - ```__main__.py```: executes main.py
91
+ - ```main.py```: the file that runs all other relevant files
92
+ - ```tpf_to_nearby_stars.py```: produces a list of stars near the target star only using the tpf file
93
+ - ```nearby_stars_to_data.py```: builds a data table containing all relevant information about stars, in a format readable by this module
94
+ - ```data_to_contamination.py``` constructs the gaussian fields and calulates the contamination filter
95
+
96
+ ## Possible Issues
97
+
98
+ - ```ConnectionResetError```: happens sometimes due to ```urllib3```. Run again and it should compile normally.
99
+
100
+ ## Authors
101
+
102
+ Leonidas Liponis
103
+
104
+ ## Links
105
+
106
+ Github page: https://github.com/leolip128/tessapps
107
+
108
+ PyPI page: https://pypi.org/project/tessapps/
109
+
110
+ Email (for contact): lliponis (at) physics.auth.gr
111
+
112
+ ## AI Disclosure
113
+
114
+ 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.
115
+
116
+ ## To-Do list
117
+
118
+ - add description
119
+ - specify dependencies' versions
120
+ - add file organization
121
+ - add options to run the module
122
+ - add more stuff in this to-do list
123
+
124
+ ## Notes
125
+
126
+ ### Examples
127
+
128
+ 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).
129
+
130
+ All examples provided were generated with the following tpfs:
131
+
132
+ - HAT-P-1: ```lk.search_targetpixelfile("HAT-P-1", mission="TESS", sector=84, exptime=120)[0].download()```
133
+ - WASP-12: ```lk.search_targetpixelfile("WASP-12", mission="TESS", sector=20, exptime=120).download()```
134
+ - TOI-122: ```lk.search_targetpixelfile("TOI-122", mission="TESS", exptime=1800).download()```
135
+ - AUMic: ```lk.search_targetpixelfile('20:45:09.5323 -31:20:27.241')[4].download()```
136
+ - 55-Cnc: ```lk.search_targetpixelfile('55 Cnc')[6].download()```
137
+ - CoRoT-1: ```lk.search_targetpixelfile('CoRoT 1')[1].download()```
138
+ - CoRoT-10: ```lk.search_targetpixelfile('19:24:15.2868 +00:44:46.003')[1].download()```
139
+
140
+ The caption on each example was edited manually to show the name of each star.
141
+
142
+ ### Other
143
+
144
+ The directory in File Organization has its files sorted manually.
@@ -0,0 +1,124 @@
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
+ <p align="center">
8
+ <img src="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
23
+ - ```matplotlib``` (3.10.8): to plot the result
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
+ ### All files in ```/src``` are these:
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 file organization
101
+ - add options to run the module
102
+ - add more stuff in this to-do list
103
+
104
+ ## Notes
105
+
106
+ ### Examples
107
+
108
+ 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).
109
+
110
+ All examples provided were generated with the following tpfs:
111
+
112
+ - HAT-P-1: ```lk.search_targetpixelfile("HAT-P-1", mission="TESS", sector=84, exptime=120)[0].download()```
113
+ - WASP-12: ```lk.search_targetpixelfile("WASP-12", mission="TESS", sector=20, exptime=120).download()```
114
+ - TOI-122: ```lk.search_targetpixelfile("TOI-122", mission="TESS", exptime=1800).download()```
115
+ - AUMic: ```lk.search_targetpixelfile('20:45:09.5323 -31:20:27.241')[4].download()```
116
+ - 55-Cnc: ```lk.search_targetpixelfile('55 Cnc')[6].download()```
117
+ - CoRoT-1: ```lk.search_targetpixelfile('CoRoT 1')[1].download()```
118
+ - CoRoT-10: ```lk.search_targetpixelfile('19:24:15.2868 +00:44:46.003')[1].download()```
119
+
120
+ The caption on each example was edited manually to show the name of each star.
121
+
122
+ ### Other
123
+
124
+ 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.3"
20
20
  commit = false
21
21
  tag = false
22
22
  allow_dirty = true
@@ -2,5 +2,5 @@
2
2
 
3
3
  from tessapps.main import run
4
4
 
5
- __version__ = "0.2.2"
5
+ __version__ = "0.2.3"
6
6
  __all__ = ["run"]
@@ -21,7 +21,7 @@ import tessapps.tpf_to_nearby_stars as ttns
21
21
  import tessapps.nearby_stars_to_data as nstd
22
22
  import tessapps.data_to_contamination as dtc
23
23
 
24
- def run(tpf, pixel_overshoot=1, sigma=1, digits=3, info=False, result=False, plot=False, output_directory="tessapps-results"):
24
+ def run(tpf=None, pixel_overshoot=1, sigma=1, digits=3, info=False, result=False, plot=False, output_directory="tessapps-results"):
25
25
  if tpf is None: tpf = lk.search_targetpixelfile("HAT-P-1", mission="TESS", sector=84, exptime=120).download()
26
26
  stars = ttns.tpf_to_nearby_stars(tpf, pixel_overshoot, info)
27
27
  data = nstd.data_builder(tpf, stars)
@@ -38,17 +38,4 @@ def run(tpf, pixel_overshoot=1, sigma=1, digits=3, info=False, result=False, plo
38
38
  out_path.parent.mkdir(parents=True, exist_ok=True)
39
39
  fig.savefig(out_path, dpi=200, bbox_inches="tight")
40
40
  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)
41
+ 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