NASA - National Aeronautics and Space Administration Follow this link to skip to the main content + Contact NASA
Kepler Guest Observer Program

Contributed Software - PyKE

Software: PyKE
Version: 2.2.1
Contributors:

DESCRIPTION
The Kepler archive contains time-series data that have been calibrated and reduced from detector pixels. This pipelined reduction includes the removal of time-series trends systematic to the spacecraft and its environment rather than the targets. For every target there is a level of subjectivity required to reduce systematics. Differing scientific goals are likely to have differing requirements for systematic mitigation. Systematic reduction in the Kepler pipeline is optimized to yield the highest number of potentially-detectable exoplanet transits from a sample of 160,000 stars. PyKE, on the other hand, is a group of python tasks developed for the reduction and analysis of Kepler Simple Aperture Photometry (SAP) data of individual targets with individual characteristics. PyKE was developed to provide alternative data reduction, tun-able to the user's specific science goals. The main purposes of these tasks are to i) re-extract light curves from manually-chosen pixel apertures and ii) cotrend and/or detrend the data in order to reduce or remove systematic noise structure using methods tun-able to user and target-specific requirements. Tasks to perform data analysis developed for the author's science programs are also included. PyKE is an open source project. Contributions of new tasks or enhanced functionality of existing tasks by the community are welcome.

DISCLAIMER
In Jan 2011 (target pixel files) and Jul 2011 (light curves), the Kepler data content at MAST was transferred from v1.0 to v2.0 of the Kepler FITS file format. The PyKE tools are designed for FITS v2.0. While tools currently support both FITS format versions, no future maintenance or development support from the PyKE tools can be provided for FITS v1.0 files.

CONTENT

Task
Description
Time invariant algebra on light curve data
Remove unwanted time ranges from Kepler time series data
Convert Kepler FITS time series to or from a different file format
Remove systematic trends in photometry using cotrending basis vectors
Detrend systematic features from Simple Aperture Photometry (SAP) data
Difference imaging of pixels within a target mask
Interactive plotting of Kepler time series data
Construct a dynamic (time-dependent) power spectrum from Kepler time series data
Derive a light curve from a target pixel file, with user-defined apertures
Plot sub-areas of Kepler Full Frame Images and define custom target apertures
Low bandpass or high bandpass signal filtering
Remove low frequency variability from time-series, preserve transits and flares
Fold data on a linear ephemeris
Calculate and store a Fourier Transform from a Kepler time series
Search for and list FITS keywords in Kepler data files
plots, creates or edits custom light curve extraction masks for target pixel files
Remove or replace data outliers from a time series
Individual time series photometry for all pixels within a target mask
Interactively define and store time ranges via a GUI
Smooth Kepler light curve data by convolution
Append multiple month short cadence and/or multiple quarter long cadence data
Calculate best period and error estimate from Fourier transform
Calculate and store the window function for a Kepler time series

PYRAF INSTALLATION
PyKE is a python-based PyRAF package. In order to install and run this package on your Mac or Linux platform you will need PyRAF and IRAF to be pre-installed.

We recommend using the STScI python distribution. If using a Macintosh running OSX 10.5 (Leopard), 10.6 (Snow Leopard) or 10.7 (Lion), installation of all the dependencies requires only acquiring the appropriate DMG file for your version of OSX (for 10.7 - Lion, use Snow Leopard). Files are available from the stsci_python download page. Full instructions are given here.

Note for Mac users. The latest Mac distribution provided in the iraf.intel.snow_leopard.dmg bundle at the stsci_python v2.12 download page installs without trouble but contains a bug that prevents the PyRAF Kepler package from executing. The scipy.optimize module is not available by default and several of our data fitting tasks rely upon it. If Mac users have downloaded and installed this version, we recommend that they install a stand-alone version of the gfortran compiler to fix the problem, as described on the stsci_python download page linked above.

If running Linux, the stsci_python package will need to be compiled from source. The dependencies will need to be installed first. Instructions are available at the STScI python installation instructions page.

A PyRAF tutorial is provided, explaining functionality and the evolution of IRAF into a python-based scripting language. The Kepler tools have been tested against IRAF version 2.12.2 and PyRAF version 1.10. Please report any deviant behavior using later versions of these packages

  1. To install the Kepler package first create an empty directory to contain the PyKE package files. The most uniform place for this directory is alongside similar packages in the IRAF tree such as stsdas/ and tables/. If IRAF and PyRAF have been installed using the instruction on the STScI python page then create a directory called /usr/stsci/kepler. Doing this will likely require administrator privileges. The command to create a new directory will be sudo mkdir /usr/stsci/kepler.

  2. Edit the extern.pkg file in the hlib directory to define the package within the PyRAF system. The location of this file will typically be /usr/stsci/iraf/iraf/unix/hlib/extern.pkg. Within the file, define the environment variable kepler to be the pathname to the kepler root directory. UNIX/Linux-based pathnames must be terminated with a '/'. Edit extern.pkg to include the two lines (again administrator privileges will likely be needed here):

    reset kepler = /usr/stsci/kepler/
    task kepler.pkg = kepler$kepler.cl


  3. Change directories to the PyKE root directory created above and unpack the downloaded file PyKE.tar:

    % sudo cd /usr/stsci/kepler
    % sudo tar xvf path/PyKE.tar

    where path is the location of the downloaded file.

  4. Change directory to where your iraf login script 'login.cl' is located (for example, your home directory), and rerun the 'mkiraf' script, which re-initializes the uparm parameter files.

  5. PyRAF requires that you be using cshell or tcshell. If you are not running cshell or tshell change to cshell by typing:

    % csh

    If using OSX, then edit the file in your home directory named .cshrc to include the lines:

    source /usr/stsci/envconfig.mac/cshrc
    iraf


PYRAF EXECUTION
For a full description on getting started go to chapter 2 of the PyRAF tutorial. Here's the short version:

  1. Before running this package for the first time create some files for the storage of IRAF/PyRAF environment variables and arguments: Within the working shell type 'mkiraf' and choose 'xterm'.

  2. Fire up PyRAF by typing 'pyraf'.

  3. Load the Kepler package by typing 'kepler'. You should see a welcome message and a list of available tasks.

STANDALONE INSTALLATION
There are pros and cons to using PyKE as an IRAF package. Users can rely on GUI operation and retention of input parameters previously used. On the other hand, installation of IRAF and PyRAF on linux machines can often be challenging. Users unwilling to attempt IRAF installation can still use PyKE from within a unix/linux shell on the command line. GUI and parameter retention features are however lost in this operating mode and command line calls to PyKE can often be character strings of long length. A positive however is that calls to PyKE can be easily included within shell scripts. Find installation and execution instructions for shell-based PyKE here.

HISTORY

Date
Version
Description
2010-06-29
1.0.0
Initial software release (MS)
2011-07-03
2.0.0
Added support for FITS v2.0 archive files (MS)
2011-07-21
2.1.0
Added kepcotrend tool to package (TB)
2011-08-30
2.1.1
Trapped new behavior of STSCI_PYTHON 2.12 in reading multi-dimension FITS columns (MS)
2011-09-22
2.1.2
Plot style updates to kepdraw and kepsmooth (MS)
2011-10-20
2.1.3
Added short cadence functionality to basis vector cotrending in kepcotrend. Added simple light curve algebra tool kepartih to package (TB)
2012-06-09
2.2.0
Provided greater plotting stability on linux/unix operating systems. Tasks can be executed from within the PyRAF environment or from within a linux/unix shell without compiling against PyRAF or IRAF. Added the kepflatten tool to the task list (MS,TB).
2012-07-02
2.2.1
keparith bug addressed. Fatal error upon PDCSAP photometry arithmetic fixed (TB).


Questions concerning Kepler's science opportunities and open programs, public archive or community tools? Contact us via the email address.
FirstGov - Your First Click to the US Government
+ Freedom of Information Act
+ Budgets, Strategic Plans and Accountability Reports
+ The President's Management Agenda
+ NASA Privacy Statement, Disclaimer,
and Accessibility Certification

+ Inspector General Hotline
+ Equal Employment Opportunity Data Posted Pursuant
to the No Fear Act

+ Information-Dissemination Priorities and Inventories
NASA - National Aeronautics and Space Administration
Editor: Martin Still
NASA Official: Jessie Dotson
Last Updated: Jan 6, 2012
+ Contact NASA