Skip to main content

A backwards-incompatible, python3 compatible, pyraf-free version of PyKE: a suite of tools to analyze Kepler/K2 data

Project description

pypi-badge ci-badge doc-badge cov-badge bib-badge

Developed since 2012, PyKE offers a user-friendly way to inspect and analyze the pixels and lightcurves obtained by NASA’s Kepler, K2, and TESS missions.


Documentation is hosted at

What’s new in PyKE v3? (July 2017)

PyKE3 is the latest generation of the Kepler/K2/TESS toolkit. It provides the following key improvements:

  • PyKE is now a pip-installable package and supports both Python 2 and 3;
  • tasks are now available both as command-line tools and Python functions;
  • PyKE no longer depends on PyRAF and is TESS-ready.

Example use

With PyKE, you can directly visualize frames from a target pixel file. For example, let’s visualize target KIC008462852 (a.k.a. Taby’s Star):

$ kepmask kplr008462852-2013098041711_lpd-targ.fits.gz --maskfile tabystar.txt

kepmask is an interactive tool that allows one to create an arbitrary aperture mask which can be subsequently be used in another pyke tool, such as kepextract.

kepextract performs simple aperture photometry in the pixels given by the mask created by kepmask:

$ kepextract kplr008462852-2013098041711_lpd-targ.fits.gz tabys-lc.fits --maskfile tabystar.txt

To visualize the light curve, you may want to use kepdraw:

$ kepdraw taby-lc.fits


If you have a working version of Python 2 or 3 on your system (we recommend Anaconda Python), you can simply install the latest stable release of PyKE using pip:

$ pip install pyketools

Alternatively, if you want to experiment with the latest development version of PyKE, you can install it straight from GitHub:

$ git clone
$ cd PyKE
$ pip install -e .

Note: PyKE version 2 and older, which was in use between 2012 and 2016 and required PyRAF, is available in the branch py27-pyraf. If you want to use PyKE2 within PyRAF, we recommend getting it through the AstroConda channel.


If you find this code useful in your research, please consider citing:

Title: PyKE: Reduction and analysis of Kepler Simple Aperture Photometry data
Authors: Still, Martin; Barclay, Tom
Publication: Astrophysics Source Code Library, record ascl:1208.004
Publication Date: 08/2012

This package is developed by Martin Still, Tom Barclay, Ze Vinicius, Geert Barentsen, Michael Gully-Santiago, Ann Marie Cody, and Christine Hedges for the Kepler/K2 GO Office.


Users are welcome to open issues or pull requests. You can also contact the development team via

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyketools, version 3.0b2
Filename, size File type Python version Upload date Hashes
Filename, size pyketools-3.0b2.tar.gz (155.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page