Skip to main content

TESSify

A Python package for helping with detecting exoplanet transit dips in TESS light curves.


🚀 Features

  • Load and clean .fits light 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
  • 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:

  • 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.
  • 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.

🛠️ 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 download again 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 download again with a larger amount.
  • A project holds one file type. To work with both lc and tp files, 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 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.

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. 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)

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 (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

  • FileExistsError on create: a folder with that name already exists. Use restore instead, or pick a new name.
  • 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.
  • Downloads show FAILED: check your connection and that curl is installed, then re-run download. 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.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for TESSify 0.6.7
File Size Uploaded Provenance Actions
tessify-0.6.7.tar.gz 18.9 kB Without provenance Details for tessify-0.6.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for TESSify 0.6.7
File Interpreter ABI Platform Actions
tessify-0.6.7-py3-none-any.whl Python 3 none any Details for tessify-0.6.7-py3-none-any.whl

Total release size: 34.2 kB

Release files / tessify-0.6.7.tar.gz

Download URL tessify-0.6.7.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5fc3e7206f30edbe6f7c4ba21f9a89082db3e1cf232da88abf0e7157ad2a8e99
BLAKE2b-256 checksum
How to use checksums
84964b3923feac6e63fa767a0e27957a6871296a1668193abb5cf2a55fd41d87
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.7-py3-none-any.whl

Download URL tessify-0.6.7-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78f3e2a1d2a48d43956989d81f8f888221cc4c97be36802f2651a034839fa11f
BLAKE2b-256 checksum
How to use checksums
41786d1a90fdd8fdd7e706ebf7c770df2a3ab15ed387e28539aa131f0712c9a2
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.7

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page