TESSify
A Python package for helping with detecting exoplanet transit dips in TESS light curves.
🚀 Features
- Load and clean
.fitslight curve or target pixel files - Visualize flattened light curves and shortlist transit candidates
- Tune the flattening window and the pixel selection (
window_length,aperture_mask) to suit your targets - Records the lowest and highest relative brightness of every processed file, so graphs can be filtered by it
- Download and process data in bulk, with parallel downloads and optional multi-core processing
- Resumable at every stage: stop at any time (even with Ctrl-C) and pick up where you left off
- Failed downloads and plots are recorded and retried on the next run instead of crashing the batch
- Designed for students, researchers, and citizen scientists
📦 Installation
Requires Python 3.9 or newer.
pip install TESSify
Or install the dependencies and run from source:
pip install -r requirements.txt
Two things pip can't install for you:
curlmust be available on your PATH. It is used to run the bulk download scripts. It ships with Windows 10+, macOS, and most Linux distributions.tkinteris needed for the image viewer. It is bundled with the Windows and macOS Python installers. On Debian/Ubuntu, runsudo apt install python3-tk. Without it, downloading and processing still work; onlyfinalise()needs it.
🛠️ Usage
The typical workflow is: create → download → process → finalise → get results.
Importing TESSify
from TESSify import Project
Creating a Project
a = Project()
a.create("YOUR_PROJECT_NAME")
This makes a new folder with that name. create refuses to overwrite a project that already exists.
Restoring a Project
a = Project()
a.restore("YOUR_PROJECT_NAME")
Downloading .fits files in bulk
Get a bulk download script from the official TESS archive. You can download either Target Pixel (tp) or Light Curve (lc) files. After downloading the script, copy its path.
from TESSify import Project
a = Project()
a.create("Project1")
a.download("lc", r"C:\Users\Expert\Downloads\tesscurl_sector_89_lc.sh", 100)
# 1st argument: "lc" for light curves, "tp" for target pixel files
# 2nd argument: path to the download script
# 3rd argument: how many files to download
Optional: download several files at once (default is 4).
a.download("lc", "tesscurl_sector_89_lc.sh", 100, workers=8)
Notes:
- Running
downloadagain continues where it stopped: files that are already downloaded are skipped, and files that failed are retried. - To fetch more files from the same script, call
downloadagain with a larger amount. - A project holds one file type. To work with both
lcandtpfiles, create two projects.
Processing the files in bulk
Processing cleans each file (removes NaNs, flattens the curve) and saves a plot of it in the project's Graphs folder.
from TESSify import Project
a = Project()
a.restore("Project1")
a.process(100)
# The amount can't usefully exceed the number of files you have downloaded
Optional: use several CPU cores (default is 1).
a.process(100, workers=4)
Windows/macOS users: when using
workersgreater than 1, put your script's top-level code underif __name__ == "__main__":. This is the standard rule for Python multiprocessing. Each worker also loads its own copy of the data, so keepworkersmodest if you are short on memory.
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.
Customising the processing
Two optional settings control how each file is cleaned:
a.process(100, window_length=401, aperture_mask="pipeline")
| Setting | Default | Applies to | What it does |
|---|---|---|---|
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. |
aperture_mask |
"all" |
tp only |
Which pixels are added together to build a light curve from a target pixel file. Ignored for lc files. |
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.
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".
Files that already have a plot are skipped, so changing these settings only affects files processed afterwards (the one exception is described under Brightness range). 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.
To process a single file and get the image name back (it accepts the same settings):
image = a.indprocess("tess2019198215352-s0014-0000000261136679-0150-s_lc.fits", window_length=401)
Brightness range
Whenever a file is processed, TESSify also records the lowest and highest relative brightness of its light curve in config.json, under brightness_range, next to the rest of the project's progress. Entries are keyed by image name, like marked:
"brightness_range": {
"tess2019198215352-s0014-0000000261136679-0150-s_lc.jpeg": [0.9951, 1.0032]
}
Relative brightness is the flattened flux, which is what the y-axis of the graph shows: 1.0 is the star's typical brightness, so 0.9951 is about 0.5% fainter. The two numbers are the plain minimum and maximum of the plotted curve, so a single outlier (a flare, a bad data point) moves them. This works the same for lc and tp files.
a.get_brightness_ranges()
# {'tess2019198215352-s0014-0000000261136679-0150-s_lc.jpeg': (0.9951, 1.0032), ...}
Projects processed by an older version have no ranges yet. Run process again to fill them in: a file that already has a plot is read once more to measure its range, but its plot is not regenerated, so your review decisions stay valid. The measurement uses the window_length and aperture_mask you pass to that call, so pass the same values you used originally if the range should match the existing plot exactly. Files whose .fits file has since been deleted are skipped.
Finalising the light curves and watching out for transit dips
After processing, you can flip through the graphs and shortlist any that show dips that could indicate an exoplanet.
from TESSify import Project
a = Project()
a.restore("Project1")
a.finalise(100)
# Opens a window showing the processed graphs
Viewer controls:
| Key | Action |
|---|---|
| Right arrow | Next graph |
| Left arrow | Previous graph |
| Down arrow | Shortlist the current graph (if you see something of interest) |
| Up arrow | Remove the current graph from the shortlist |
| Escape (or closing the window) | Save and exit |
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.
Getting the list of shortlisted entities
from TESSify import Project
a = Project()
a.restore("Project1")
finalised_list = a.getresults()
# Returns unique TIC IDs in the order you shortlisted them
print(finalised_list)
# ['TIC 261136679', 'TIC 25155310']
Saving the shortlisted entities as a JSON file
from TESSify import Project
a = Project()
a.restore("Project1")
a.saveresults("shortlist.json")
# Any path works, e.g. r"C:\Users\Expert\Documents\shortlist.json" or "/home/expert/shortlist.json"
📁 Project layout
YOUR_PROJECT_NAME/
├── config.json # progress for every stage, plus each graph's brightness range (safe to leave alone)
├── LightCurves/ # downloaded .fits light curves (type "lc")
├── TargetPixels/ # downloaded .fits target pixel files (type "tp")
└── Graphs/ # plots made by process()
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.
❓ Troubleshooting
FileExistsErroroncreate: a folder with that name already exists. Userestoreinstead, or pick a new name.FileNotFoundErroronrestore: the folder doesn't contain aconfig.json. Check the name and your working directory, since projects are found relative to where you run Python.- Downloads show
FAILED: check your connection and thatcurlis installed, then re-rundownload. Failed files are retried automatically. The viewer needs tkinter and Pillow: install them as described under Installation.
🧠 Contributing
Contributions are welcome! Open an issue or submit a pull request at github.com/arpit290/TESSify.
📜 License
This project is licensed under the MIT License. See LICENSE for details.
👤 Author
Arpit Bishnoi github.com/arpit290 · bishnoiarpit29@gmail.com
Metadata
Release files for TESSify 0.6.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tessify-0.6.9.tar.gz | 21.7 kB | Without provenance | Details for tessify-0.6.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tessify-0.6.9-py3-none-any.whl | Python 3 | none | any | Details for tessify-0.6.9-py3-none-any.whl |
Total release size: 39.4 kB
Release files / tessify-0.6.9.tar.gz
| Download URL | tessify-0.6.9.tar.gz |
|---|---|
| Size | 21.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
16ecbc2c76fecf93e872e743860137d2fc66b4d74b9f2c592260ad05c4bbf303
|
|
BLAKE2b-256 checksum How to use checksums |
65dd5cafc7033d499c463d8ba9ed459eb8e2ac7ff863a0ffbcbff38a7514f500
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / tessify-0.6.9-py3-none-any.whl
| Download URL | tessify-0.6.9-py3-none-any.whl |
|---|---|
| Size | 17.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b02110ad6df43eea89e5ba90ac46c29d536d27a0b67666bfdc24913e906e12b7
|
|
BLAKE2b-256 checksum How to use checksums |
f645a25c77aeb99ff43326306eafb14ce023c492fe2a94523dc42e45589f23ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Security for TESSify 0.6.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.