Warning: this page is no longer updated and may contain outdated information.

Please refer to the new Kepler/K2 science website at http://keplerscience.arc.nasa.gov

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.6.2
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 200,000 stars. PyKE, on the other hand, is a group of python tasks developed for the reduction and analysis of Kepler pixel-level data and Simple Aperture Photometry (SAP) data of individual targets with individual characteristics. PyKE was developed to provide alternative data reduction, tunable 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.

CONTENT

Task
Description
Time-invariant algebra on light curve data
Box Least-Square planet transit detection
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
Superimpose photometric mask and source positions over a target pixel image
Remove low frequency variability from time-series, preserve transits and flares
Low bandpass or high bandpass signal filtering
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
Create a series of separate FITS image files from a Target Pixel File
plots, creates or edits custom light curve extraction masks for target pixel files
Remove or replace data outliers from a time series
Pixel-level principal component analysis of time series
Individual time series photometry for all pixels within a target mask
Fit a PSF model to a specific image within a Target Pixel File
Fit a PSF model to time series observations within a Target Pixel File
Interactively define and store time ranges via a GUI
Correct aperture photmetry using target motion
Smooth Kepler light curve data by convolution
Calculate Combined Differental Photometric Precision for time series light curve
Append multiple month short cadence and/or multiple quarter long cadence data
Correct time stamps in Target Pixel Files to TDB system
Fit planet trasit models to Kepler time-series
Calculate best period and error estimate from Fourier transform
Trim pixels from Target Pixel Files
Calculate and store the window function for a Kepler time series

PYRAF INSTALLATION
PyKE is a python-based PyRAF package which can also be executed without PyRAF on the command line of a shell. In order to install and run PyKE as a PyRAF package on your Mac or Linux platform you will need PyRAF to be pre-installed following these instructions. We recommend the Ureka binary install option.

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 PyRAF version 2.1.6. Please report any deviant behavior using later versions of these packages.

  1. Download the PyKE package tarball by clicking the button at the top-right of the webpage.
  2. 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 PyRAF has been installed e.g. on a mac using the Ureka instructions on the STScI python page then create a directory called /usr/local/Ureka/variants/common/iraf/kepler. Doing this may require administrator privileges. The command to create a new directory will be sudo mkdir /usr/local/Ureka/variants/common/iraf/kepler.

  3. The folder /usr/local/Ureka/variants/common/iraf/kepler may already exist. If so, it was installed by the Ureka build and more often than not will contain an older version of the PyKE tools. We recommend you delete the content of that folder before continuing.

  4. Edit the extern.pkg file to define the package within the PyRAF system. The location of this file will typically be /usr/local/Ureka/variants/common/extern.pkg. Edit extern.pkg to include the two lines (again administrator privileges may be needed here):

    reset kepler = /usr/local/Ureka/variants/common/iraf/kepler/
    task kepler.pkg = kepler$kepler.cl


  5. Change directories to the PyKE root directory /usr/local/Ureka/variants/common/iraf/kepler and unpack the downloaded file PyKE.tar:

    % cd /usr/local/Ureka/variants/common/iraf/kepler/
    % tar xvf path/PyKE.tar

    where path is the location of the downloaded file. The tar operation may require root privilege.

  6. If you are an existing IRAF or PyRAF user, 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.

  7. PyRAF requires that you be using csh or tcsh. If you are not running csh or tcsh change to cshell by typing:

    % csh

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 add the Ureka executable files to your path by typing: eval `/Users/still/.ureka/ur_setup !*`. Tip - if you look in your startup file e.g. .cshrc in your home directory, you will find that the Ureka install process has made you a handy alias for this ugly command.
  2. Then create files for the storage of PyRAF environment variables and arguments: Within the working shell type 'mkiraf' and choose 'xterm'.

  3. Fire up PyRAF by typing 'pyraf'.

  4. 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 a PyRAF package. Users can rely on GUI operation and retention of input parameters previously used. On the other hand, installation of PyRAF on linux machines can occassionally be challenging. Users unwilling to attempt PyRAF 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.

CITING PYKE IN PUBLICATIONS
Those wishing to cite PyKE in a publication may wish to reference Still & Barclay (2012). An appropriate statementment to include in the acknowledgements is: "This work made use of PyKE (Still & Barclay 2012), a software package for the reduction and analysis of Kepler data. This open source software project is developed and distributed by the NASA Kepler Guest Observer Office".

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).
2012-10-01
2.2.2
kepflatten bug addressed: light curve fits no longer tapered after 4,000 timestamps. NaN handling in kepdraw improved for speed. Two options now provided in kepdraw - fast and ugly - slow and pretty (MS).
2012-10-09
2.2.3
kepdraw bug addressed: plottype functionality added to shell-mode operation (MS)
2012-10-12
2.2.4
kepbls task for transit searching added to package (MS)
2012-10-23
2.2.5
kepsmooth bug addressed: fscale and plotlab functionality added to shell-mode operation (MS)
2012-12-09
2.3.0
Added tasks keptransit and keppca (TB, MS)
2013-02-07
2.3.1
Added kepffi and kepmask functionality to load existing pixel mask defintion. Bug in pixel selection within both tasks and keprange fixed. kepffi adapted in response to format changes to the target tables at MAST (MS)
2013-08-06
2.4.0
Added kepfield and keptimefix tasks. Bug corrections in kepfold (MS,TB)
2013-09-30
2.5.0
Added kepprf, kepprfphot, kepstddev and keptrim tasks. Bug correction to kepcotrend and functionality change to keptimefix (MS,TB)
2014-03-26
2.5.1
Minor adaptations for two-wheel engineering data. Added keptrim (MS)
2014-06-26
2.5.2
Corrected all tasks for the deprecation of ascardlist() in pyfits 3.1 (MS)
2014-09-10
2.6.2
New tools like kepsff (MS)

DISCLAIMERS
No Warranty: THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF ANY KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR FREEDOM FROM INFRINGEMENT, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL BE ERROR FREE, OR ANY WARRANTY THAT DOCUMENTATION, IF PROVIDED, WILL CONFORM TO THE SUBJECT SOFTWARE. THIS AGREEMENT DOES NOT, IN ANY MANNER, CONSTITUTE AN ENDORSEMENT BY GOVERNMENT AGENCY OR ANY PRIOR RECIPIENT OF ANY RESULTS, RESULTING DESIGNS, HARDWARE, SOFTWARE PRODUCTS OR ANY OTHER APPLICATIONS RESULTING FROM USE OF THE SUBJECT SOFTWARE. FURTHER, GOVERNMENT AGENCY DISCLAIMS ALL WARRANTIES AND LIABILITIES REGARDING THIRD-PARTY SOFTWARE, IF PRESENT IN THE ORIGINAL SOFTWARE, AND DISTRIBUTES IT "AS IS."

Waiver and Indemnity: RECIPIENT AGREES TO WAIVE ANY AND ALL CLAIMS AGAINST THE UNITED STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT. IF RECIPIENT'S USE OF THE SUBJECT SOFTWARE RESULTS IN ANY LIABILITIES, DEMANDS, DAMAGES, EXPENSES OR LOSSES ARISING FROM SUCH USE, INCLUDING ANY DAMAGES FROM PRODUCTS BASED ON, OR RESULTING FROM, RECIPIENT'S USE OF THE SUBJECT SOFTWARE, RECIPIENT SHALL INDEMNIFY AND HOLD HARMLESS THE UNITED STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT, TO THE EXTENT PERMITTED BY LAW. RECIPIENT'S SOLE REMEDY FOR ANY SUCH MATTER SHALL BE THE IMMEDIATE, UNILATERAL TERMINATION OF THIS AGREEMENT.

NOTICES
Copyright © 2010-2011 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved.

NASA OPEN SOURCE AGREEMENT


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 11, 2013
+ Contact NASA