TESSify 0.4.1__tar.gz → 0.6.7__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.
- tessify-0.4.1/LICENSE.txt → tessify-0.6.7/LICENSE +21 -21
- tessify-0.6.7/PKG-INFO +267 -0
- tessify-0.6.7/README.md +232 -0
- tessify-0.6.7/TESSify/__init__.py +730 -0
- tessify-0.6.7/TESSify.egg-info/PKG-INFO +267 -0
- {tessify-0.4.1 → tessify-0.6.7}/TESSify.egg-info/SOURCES.txt +1 -3
- tessify-0.6.7/TESSify.egg-info/requires.txt +3 -0
- tessify-0.6.7/pyproject.toml +22 -0
- tessify-0.4.1/PKG-INFO +0 -171
- tessify-0.4.1/README.md +0 -143
- tessify-0.4.1/TESSify/__init__.py +0 -1
- tessify-0.4.1/TESSify/main.py +0 -182
- tessify-0.4.1/TESSify.egg-info/PKG-INFO +0 -171
- tessify-0.4.1/TESSify.egg-info/requires.txt +0 -4
- tessify-0.4.1/pyproject.toml +0 -3
- tessify-0.4.1/setup.py +0 -25
- {tessify-0.4.1 → tessify-0.6.7}/TESSify.egg-info/dependency_links.txt +0 -0
- {tessify-0.4.1 → tessify-0.6.7}/TESSify.egg-info/top_level.txt +0 -0
- {tessify-0.4.1 → tessify-0.6.7}/setup.cfg +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 arpit290
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 arpit290
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
tessify-0.6.7/PKG-INFO
ADDED
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: TESSify
|
|
3
|
+
Version: 0.6.7
|
|
4
|
+
Summary: A Python package for detecting exoplanet transit dips in TESS light curves.
|
|
5
|
+
Author-email: Arpit Bishnoi <bishnoiarpit29@gmail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 arpit290
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Requires-Python: >=3.10
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Requires-Dist: lightkurve>=2.0
|
|
32
|
+
Requires-Dist: matplotlib>=3.5
|
|
33
|
+
Requires-Dist: pillow>=9.0
|
|
34
|
+
Dynamic: license-file
|
|
35
|
+
|
|
36
|
+
# TESSify
|
|
37
|
+
A Python package for helping with detecting exoplanet transit dips in TESS light curves.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 🚀 Features
|
|
42
|
+
|
|
43
|
+
- Load and clean `.fits` light curve or target pixel files
|
|
44
|
+
- Visualize flattened light curves and shortlist transit candidates
|
|
45
|
+
- Tune the flattening window and the pixel selection (`window_length`, `aperture_mask`) to suit your targets
|
|
46
|
+
- Download and process data in bulk, with parallel downloads and optional multi-core processing
|
|
47
|
+
- Resumable at every stage: stop at any time (even with Ctrl-C) and pick up where you left off
|
|
48
|
+
- Failed downloads and plots are recorded and retried on the next run instead of crashing the batch
|
|
49
|
+
- Designed for students, researchers, and citizen scientists
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 📦 Installation
|
|
54
|
+
|
|
55
|
+
Requires **Python 3.9 or newer**.
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install TESSify
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Or install the dependencies and run from source:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pip install -r requirements.txt
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Two things pip can't install for you:
|
|
68
|
+
|
|
69
|
+
- **`curl`** must be available on your PATH. It is used to run the bulk download scripts. It ships with Windows 10+, macOS, and most Linux distributions.
|
|
70
|
+
- **`tkinter`** is needed for the image viewer. It is bundled with the Windows and macOS Python installers. On Debian/Ubuntu, run `sudo apt install python3-tk`. Without it, downloading and processing still work; only `finalise()` needs it.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## 🛠️ Usage
|
|
75
|
+
|
|
76
|
+
The typical workflow is: **create → download → process → finalise → get results**.
|
|
77
|
+
|
|
78
|
+
### Importing TESSify
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
from TESSify import Project
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Creating a Project
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
a = Project()
|
|
88
|
+
a.create("YOUR_PROJECT_NAME")
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
This makes a new folder with that name. `create` refuses to overwrite a project that already exists.
|
|
92
|
+
|
|
93
|
+
### Restoring a Project
|
|
94
|
+
|
|
95
|
+
```python
|
|
96
|
+
a = Project()
|
|
97
|
+
a.restore("YOUR_PROJECT_NAME")
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Downloading `.fits` files in bulk
|
|
101
|
+
|
|
102
|
+
Get a bulk download script from the official [TESS archive](https://archive.stsci.edu/tess/bulk_downloads/bulk_downloads_ffi-tp-lc-dv.html). You can download either Target Pixel (`tp`) or Light Curve (`lc`) files. After downloading the script, copy its path.
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
from TESSify import Project
|
|
106
|
+
|
|
107
|
+
a = Project()
|
|
108
|
+
a.create("Project1")
|
|
109
|
+
|
|
110
|
+
a.download("lc", r"C:\Users\Expert\Downloads\tesscurl_sector_89_lc.sh", 100)
|
|
111
|
+
# 1st argument: "lc" for light curves, "tp" for target pixel files
|
|
112
|
+
# 2nd argument: path to the download script
|
|
113
|
+
# 3rd argument: how many files to download
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Optional: download several files at once (default is 4).
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
a.download("lc", "tesscurl_sector_89_lc.sh", 100, workers=8)
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Notes:
|
|
123
|
+
|
|
124
|
+
- Running `download` again continues where it stopped: files that are already downloaded are skipped, and files that failed are retried.
|
|
125
|
+
- To fetch more files from the same script, call `download` again with a larger amount.
|
|
126
|
+
- A project holds one file type. To work with both `lc` and `tp` files, create two projects.
|
|
127
|
+
|
|
128
|
+
### Processing the files in bulk
|
|
129
|
+
|
|
130
|
+
Processing cleans each file (removes NaNs, flattens the curve) and saves a plot of it in the project's `Graphs` folder.
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
from TESSify import Project
|
|
134
|
+
|
|
135
|
+
a = Project()
|
|
136
|
+
a.restore("Project1")
|
|
137
|
+
|
|
138
|
+
a.process(100)
|
|
139
|
+
# The amount can't usefully exceed the number of files you have downloaded
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Optional: use several CPU cores (default is 1).
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
a.process(100, workers=4)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
> **Windows/macOS users:** when using `workers` greater than 1, put your script's top-level code under `if __name__ == "__main__":`. This is the standard rule for Python multiprocessing. Each worker also loads its own copy of the data, so keep `workers` modest if you are short on memory.
|
|
149
|
+
|
|
150
|
+
Files that can't be read (for example, a corrupt download) are skipped, reported in the console, and listed under `process_failed` in `config.json`. Re-running `process` retries them.
|
|
151
|
+
|
|
152
|
+
#### Customising the processing
|
|
153
|
+
|
|
154
|
+
Two optional settings control how each file is cleaned:
|
|
155
|
+
|
|
156
|
+
```python
|
|
157
|
+
a.process(100, window_length=401, aperture_mask="pipeline")
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
| Setting | Default | Applies to | What it does |
|
|
161
|
+
|---------|---------|------------|--------------|
|
|
162
|
+
| `window_length` | `101` | `lc` and `tp` | Size, in data points, of the smoothing window `flatten()` uses to remove slow brightness drift. Must be an odd integer of 3 or more. |
|
|
163
|
+
| `aperture_mask` | `"all"` | `tp` only | Which pixels are added together to build a light curve from a target pixel file. Ignored for `lc` files. |
|
|
164
|
+
|
|
165
|
+
**`window_length`:** the flattening filter smooths away anything shorter than its window, and a transit is a short dip. At the default of 101 points (about 3.4 hours for 2-minute data), a long transit can be partly flattened away. Use a window several times longer than the transits you are looking for, for example `401` or `1001` for 2-minute data. If the window is too large, slow stellar variability stays in the curve; if it is too small, real dips get erased. Longer cadences (10 or 30 minutes) need fewer points to cover the same time span.
|
|
166
|
+
|
|
167
|
+
**`aperture_mask`:** `"all"` adds up every pixel in the cutout, including faint, noisy ones. Other options are `"pipeline"` (the pixels chosen by the TESS mission pipeline, usually cleaner) and `"threshold"` (only pixels above a brightness threshold). If your target pixel plots look noisy, try `"pipeline"`.
|
|
168
|
+
|
|
169
|
+
Files that already have a plot are skipped, so changing these settings only affects files processed afterwards. To re-plot everything with new settings, delete the images in `Graphs/`, then set `"processed"` to `[]` and `"reviewed"` to `0` in `config.json`. Your shortlist (`"marked"`) is kept.
|
|
170
|
+
|
|
171
|
+
To process a single file and get the image name back (it accepts the same settings):
|
|
172
|
+
|
|
173
|
+
```python
|
|
174
|
+
image = a.indprocess("tess2019198215352-s0014-0000000261136679-0150-s_lc.fits", window_length=401)
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Finalising the light curves and watching out for transit dips
|
|
178
|
+
|
|
179
|
+
After processing, you can flip through the graphs and shortlist any that show dips that could indicate an exoplanet.
|
|
180
|
+
|
|
181
|
+
```python
|
|
182
|
+
from TESSify import Project
|
|
183
|
+
|
|
184
|
+
a = Project()
|
|
185
|
+
a.restore("Project1")
|
|
186
|
+
|
|
187
|
+
a.finalise(100)
|
|
188
|
+
# Opens a window showing the processed graphs
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Viewer controls:
|
|
192
|
+
|
|
193
|
+
| Key | Action |
|
|
194
|
+
|-----|--------|
|
|
195
|
+
| **Right arrow** | Next graph |
|
|
196
|
+
| **Left arrow** | Previous graph |
|
|
197
|
+
| **Down arrow** | Shortlist the current graph (if you see something of interest) |
|
|
198
|
+
| **Up arrow** | Remove the current graph from the shortlist |
|
|
199
|
+
| **Escape** (or closing the window) | Save and exit |
|
|
200
|
+
|
|
201
|
+
The title bar shows your position and whether the current graph is shortlisted. Your shortlist is saved as you go, and the next call to `finalise` starts after the last graph you reached.
|
|
202
|
+
|
|
203
|
+
### Getting the list of shortlisted entities
|
|
204
|
+
|
|
205
|
+
```python
|
|
206
|
+
from TESSify import Project
|
|
207
|
+
|
|
208
|
+
a = Project()
|
|
209
|
+
a.restore("Project1")
|
|
210
|
+
|
|
211
|
+
finalised_list = a.getresults()
|
|
212
|
+
# Returns unique TIC IDs in the order you shortlisted them
|
|
213
|
+
|
|
214
|
+
print(finalised_list)
|
|
215
|
+
# ['TIC 261136679', 'TIC 25155310']
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Saving the shortlisted entities as a JSON file
|
|
219
|
+
|
|
220
|
+
```python
|
|
221
|
+
from TESSify import Project
|
|
222
|
+
|
|
223
|
+
a = Project()
|
|
224
|
+
a.restore("Project1")
|
|
225
|
+
|
|
226
|
+
a.saveresults("shortlist.json")
|
|
227
|
+
# Any path works, e.g. r"C:\Users\Expert\Documents\shortlist.json" or "/home/expert/shortlist.json"
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## 📁 Project layout
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
YOUR_PROJECT_NAME/
|
|
236
|
+
├── config.json # progress for every stage (safe to leave alone)
|
|
237
|
+
├── LightCurves/ # downloaded .fits light curves (type "lc")
|
|
238
|
+
├── TargetPixels/ # downloaded .fits target pixel files (type "tp")
|
|
239
|
+
└── Graphs/ # plots made by process()
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
`config.json` is written safely, so a crash can't leave it half-written. Projects created with older versions of TESSify load automatically. Re-run `process` on them, because plot names created by older versions may not match.
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## ❓ Troubleshooting
|
|
247
|
+
|
|
248
|
+
- **`FileExistsError` on `create`:** a folder with that name already exists. Use `restore` instead, or pick a new name.
|
|
249
|
+
- **`FileNotFoundError` on `restore`:** the folder doesn't contain a `config.json`. Check the name and your working directory, since projects are found relative to where you run Python.
|
|
250
|
+
- **Downloads show `FAILED`:** check your connection and that `curl` is installed, then re-run `download`. Failed files are retried automatically.
|
|
251
|
+
- **`The viewer needs tkinter and Pillow`:** install them as described under [Installation](#-installation).
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## 🧠 Contributing
|
|
256
|
+
Contributions are welcome! Open an issue or submit a pull request at [github.com/arpit290/TESSify](https://github.com/arpit290/TESSify).
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## 📜 License
|
|
261
|
+
This project is licensed under the MIT License. See `LICENSE` for details.
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## 👤 Author
|
|
266
|
+
Arpit Bishnoi
|
|
267
|
+
[github.com/arpit290](https://github.com/arpit290) · bishnoiarpit29@gmail.com
|
tessify-0.6.7/README.md
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
# TESSify
|
|
2
|
+
A Python package for helping with detecting exoplanet transit dips in TESS light curves.
|
|
3
|
+
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## 🚀 Features
|
|
7
|
+
|
|
8
|
+
- Load and clean `.fits` light curve or target pixel files
|
|
9
|
+
- Visualize flattened light curves and shortlist transit candidates
|
|
10
|
+
- Tune the flattening window and the pixel selection (`window_length`, `aperture_mask`) to suit your targets
|
|
11
|
+
- Download and process data in bulk, with parallel downloads and optional multi-core processing
|
|
12
|
+
- Resumable at every stage: stop at any time (even with Ctrl-C) and pick up where you left off
|
|
13
|
+
- Failed downloads and plots are recorded and retried on the next run instead of crashing the batch
|
|
14
|
+
- Designed for students, researchers, and citizen scientists
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 📦 Installation
|
|
19
|
+
|
|
20
|
+
Requires **Python 3.9 or newer**.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install TESSify
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or install the dependencies and run from source:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install -r requirements.txt
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Two things pip can't install for you:
|
|
33
|
+
|
|
34
|
+
- **`curl`** must be available on your PATH. It is used to run the bulk download scripts. It ships with Windows 10+, macOS, and most Linux distributions.
|
|
35
|
+
- **`tkinter`** is needed for the image viewer. It is bundled with the Windows and macOS Python installers. On Debian/Ubuntu, run `sudo apt install python3-tk`. Without it, downloading and processing still work; only `finalise()` needs it.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 🛠️ Usage
|
|
40
|
+
|
|
41
|
+
The typical workflow is: **create → download → process → finalise → get results**.
|
|
42
|
+
|
|
43
|
+
### Importing TESSify
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from TESSify import Project
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Creating a Project
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
a = Project()
|
|
53
|
+
a.create("YOUR_PROJECT_NAME")
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
This makes a new folder with that name. `create` refuses to overwrite a project that already exists.
|
|
57
|
+
|
|
58
|
+
### Restoring a Project
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
a = Project()
|
|
62
|
+
a.restore("YOUR_PROJECT_NAME")
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Downloading `.fits` files in bulk
|
|
66
|
+
|
|
67
|
+
Get a bulk download script from the official [TESS archive](https://archive.stsci.edu/tess/bulk_downloads/bulk_downloads_ffi-tp-lc-dv.html). You can download either Target Pixel (`tp`) or Light Curve (`lc`) files. After downloading the script, copy its path.
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from TESSify import Project
|
|
71
|
+
|
|
72
|
+
a = Project()
|
|
73
|
+
a.create("Project1")
|
|
74
|
+
|
|
75
|
+
a.download("lc", r"C:\Users\Expert\Downloads\tesscurl_sector_89_lc.sh", 100)
|
|
76
|
+
# 1st argument: "lc" for light curves, "tp" for target pixel files
|
|
77
|
+
# 2nd argument: path to the download script
|
|
78
|
+
# 3rd argument: how many files to download
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Optional: download several files at once (default is 4).
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
a.download("lc", "tesscurl_sector_89_lc.sh", 100, workers=8)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Notes:
|
|
88
|
+
|
|
89
|
+
- Running `download` again continues where it stopped: files that are already downloaded are skipped, and files that failed are retried.
|
|
90
|
+
- To fetch more files from the same script, call `download` again with a larger amount.
|
|
91
|
+
- A project holds one file type. To work with both `lc` and `tp` files, create two projects.
|
|
92
|
+
|
|
93
|
+
### Processing the files in bulk
|
|
94
|
+
|
|
95
|
+
Processing cleans each file (removes NaNs, flattens the curve) and saves a plot of it in the project's `Graphs` folder.
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
from TESSify import Project
|
|
99
|
+
|
|
100
|
+
a = Project()
|
|
101
|
+
a.restore("Project1")
|
|
102
|
+
|
|
103
|
+
a.process(100)
|
|
104
|
+
# The amount can't usefully exceed the number of files you have downloaded
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Optional: use several CPU cores (default is 1).
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
a.process(100, workers=4)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
> **Windows/macOS users:** when using `workers` greater than 1, put your script's top-level code under `if __name__ == "__main__":`. This is the standard rule for Python multiprocessing. Each worker also loads its own copy of the data, so keep `workers` modest if you are short on memory.
|
|
114
|
+
|
|
115
|
+
Files that can't be read (for example, a corrupt download) are skipped, reported in the console, and listed under `process_failed` in `config.json`. Re-running `process` retries them.
|
|
116
|
+
|
|
117
|
+
#### Customising the processing
|
|
118
|
+
|
|
119
|
+
Two optional settings control how each file is cleaned:
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
a.process(100, window_length=401, aperture_mask="pipeline")
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
| Setting | Default | Applies to | What it does |
|
|
126
|
+
|---------|---------|------------|--------------|
|
|
127
|
+
| `window_length` | `101` | `lc` and `tp` | Size, in data points, of the smoothing window `flatten()` uses to remove slow brightness drift. Must be an odd integer of 3 or more. |
|
|
128
|
+
| `aperture_mask` | `"all"` | `tp` only | Which pixels are added together to build a light curve from a target pixel file. Ignored for `lc` files. |
|
|
129
|
+
|
|
130
|
+
**`window_length`:** the flattening filter smooths away anything shorter than its window, and a transit is a short dip. At the default of 101 points (about 3.4 hours for 2-minute data), a long transit can be partly flattened away. Use a window several times longer than the transits you are looking for, for example `401` or `1001` for 2-minute data. If the window is too large, slow stellar variability stays in the curve; if it is too small, real dips get erased. Longer cadences (10 or 30 minutes) need fewer points to cover the same time span.
|
|
131
|
+
|
|
132
|
+
**`aperture_mask`:** `"all"` adds up every pixel in the cutout, including faint, noisy ones. Other options are `"pipeline"` (the pixels chosen by the TESS mission pipeline, usually cleaner) and `"threshold"` (only pixels above a brightness threshold). If your target pixel plots look noisy, try `"pipeline"`.
|
|
133
|
+
|
|
134
|
+
Files that already have a plot are skipped, so changing these settings only affects files processed afterwards. To re-plot everything with new settings, delete the images in `Graphs/`, then set `"processed"` to `[]` and `"reviewed"` to `0` in `config.json`. Your shortlist (`"marked"`) is kept.
|
|
135
|
+
|
|
136
|
+
To process a single file and get the image name back (it accepts the same settings):
|
|
137
|
+
|
|
138
|
+
```python
|
|
139
|
+
image = a.indprocess("tess2019198215352-s0014-0000000261136679-0150-s_lc.fits", window_length=401)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Finalising the light curves and watching out for transit dips
|
|
143
|
+
|
|
144
|
+
After processing, you can flip through the graphs and shortlist any that show dips that could indicate an exoplanet.
|
|
145
|
+
|
|
146
|
+
```python
|
|
147
|
+
from TESSify import Project
|
|
148
|
+
|
|
149
|
+
a = Project()
|
|
150
|
+
a.restore("Project1")
|
|
151
|
+
|
|
152
|
+
a.finalise(100)
|
|
153
|
+
# Opens a window showing the processed graphs
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Viewer controls:
|
|
157
|
+
|
|
158
|
+
| Key | Action |
|
|
159
|
+
|-----|--------|
|
|
160
|
+
| **Right arrow** | Next graph |
|
|
161
|
+
| **Left arrow** | Previous graph |
|
|
162
|
+
| **Down arrow** | Shortlist the current graph (if you see something of interest) |
|
|
163
|
+
| **Up arrow** | Remove the current graph from the shortlist |
|
|
164
|
+
| **Escape** (or closing the window) | Save and exit |
|
|
165
|
+
|
|
166
|
+
The title bar shows your position and whether the current graph is shortlisted. Your shortlist is saved as you go, and the next call to `finalise` starts after the last graph you reached.
|
|
167
|
+
|
|
168
|
+
### Getting the list of shortlisted entities
|
|
169
|
+
|
|
170
|
+
```python
|
|
171
|
+
from TESSify import Project
|
|
172
|
+
|
|
173
|
+
a = Project()
|
|
174
|
+
a.restore("Project1")
|
|
175
|
+
|
|
176
|
+
finalised_list = a.getresults()
|
|
177
|
+
# Returns unique TIC IDs in the order you shortlisted them
|
|
178
|
+
|
|
179
|
+
print(finalised_list)
|
|
180
|
+
# ['TIC 261136679', 'TIC 25155310']
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Saving the shortlisted entities as a JSON file
|
|
184
|
+
|
|
185
|
+
```python
|
|
186
|
+
from TESSify import Project
|
|
187
|
+
|
|
188
|
+
a = Project()
|
|
189
|
+
a.restore("Project1")
|
|
190
|
+
|
|
191
|
+
a.saveresults("shortlist.json")
|
|
192
|
+
# Any path works, e.g. r"C:\Users\Expert\Documents\shortlist.json" or "/home/expert/shortlist.json"
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## 📁 Project layout
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
YOUR_PROJECT_NAME/
|
|
201
|
+
├── config.json # progress for every stage (safe to leave alone)
|
|
202
|
+
├── LightCurves/ # downloaded .fits light curves (type "lc")
|
|
203
|
+
├── TargetPixels/ # downloaded .fits target pixel files (type "tp")
|
|
204
|
+
└── Graphs/ # plots made by process()
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
`config.json` is written safely, so a crash can't leave it half-written. Projects created with older versions of TESSify load automatically. Re-run `process` on them, because plot names created by older versions may not match.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## ❓ Troubleshooting
|
|
212
|
+
|
|
213
|
+
- **`FileExistsError` on `create`:** a folder with that name already exists. Use `restore` instead, or pick a new name.
|
|
214
|
+
- **`FileNotFoundError` on `restore`:** the folder doesn't contain a `config.json`. Check the name and your working directory, since projects are found relative to where you run Python.
|
|
215
|
+
- **Downloads show `FAILED`:** check your connection and that `curl` is installed, then re-run `download`. Failed files are retried automatically.
|
|
216
|
+
- **`The viewer needs tkinter and Pillow`:** install them as described under [Installation](#-installation).
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## 🧠 Contributing
|
|
221
|
+
Contributions are welcome! Open an issue or submit a pull request at [github.com/arpit290/TESSify](https://github.com/arpit290/TESSify).
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## 📜 License
|
|
226
|
+
This project is licensed under the MIT License. See `LICENSE` for details.
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## 👤 Author
|
|
231
|
+
Arpit Bishnoi
|
|
232
|
+
[github.com/arpit290](https://github.com/arpit290) · bishnoiarpit29@gmail.com
|