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

Software: PyKE
Version: 1.0.0

keptransit -- fit a transit model to a Kepler light curve

keptransit   inputfile   outputfile   datacol   errcol   period   scaled_planet_radius   epoch   eccentricity   scaled_semimajor_axis   inclination   argument_of_periastron   limb_darkening_parameters   secondary_eclipse_depth   fix_period   fix_scaled_planet_radius   fix_epoch   fix_eccentricity   fix_scaled_semimajor_axis   fix_inclination   fix_argument_of_periastron   fix_secondary_eclipse_depth   fix_flux_offset   remove_flagged_data   fit_tolerance   fitter   normalize   clobber   plot   verbose   logfile   status

inputfile = string
The name of a MAST standard format FITS file containing a Kepler light curve within the first data extension.

outputfile = string
The name of the output FITS file. outputfile will be an amended version of inputfile with two extra columns called TRANSIT_MODL and PHASE. These columns contain the transit model determined each times stamp and the orbital phase which ranges between zero and one.

datacol = string
The column in extension one of the FITS file which contains the flux data to be fit. If the data is product from the kepflatten tool then the flux column will be DETSAP_FLUX (Detrended Simple Aperture Photometry fluxes). The tool will also accept SAP_FLUX (Simple Aperture Photometry), PDCSAP_FLUX (Pre-search Data Conditioning fluxes) and CBVSAP_FLUX (SAP_FLUX corrected for systematic artifacts by the PyKE tool kepcotrend). However none of these latter three options are recommended because the flux data contain either astrophysical variability, spacecrafy systematics, or both.

errcol = string
The column in the FITS file which contains the uncertainty on the flux time series data. Typically this name is DETSAP_FLUX_ERR.

period = float
An initial guess value for the orbital period of the transiting planet in days.

scaled_planet_radius = float
An initial guess value for the ratio of the planet radius to the stellar radius.

epoch = float
An initial guess value for the mid-time of the first transit. The time should be given in BKJD (BJD - 2454833)

eccentricity = float
An initial guess value for the eccentricity of the planet's orbit.

scaled_semimajor_axis = float
An initial guess value for the ratio of the planet radius to the orbital semi-major axis of the planet.

inclination = float
An initial guess value for the inclination of the planetary orbit in degrees relative to the line of sight. 90 degrees equates to a central transit.

argument_of_periastron = float
An initial guess value for the periastron angle of the planetary orbit in degrees.

limb_darkening_parameters = string
Values for the limb darkening parameters. The code allows for four different limb darkening laws: uniform, linear, quadratic and non-linear. The version of the limb darkening law used depends on the number of values given here: if no values are given a uniform disk model is used; if one value is given a linear law is used; if two parameters are given a quadratic law is used; and if four parameters are given a non-linear law is used. The definitions of the different laws are given in Mandel and Agol (2002). The format that these parameters should be given in is as values separated by spaces, for example '0.372 0.278' if you wished to use a quadratic limb darkening law appropriate for the exoplanet host star TrES-2A. Limb darkening is always fixed in this version of the code. We reccommend that you do not use the four-parameter limb darkening law as this is very slow for limited gain.

secondary_eclipse_depth = float
An initial guess value for the fractional secondary eclipse depth.

fix_period = boolean
Should the period be fixed to the guess value.

fix_scaled_planet_radius = boolean
Should the planet to star radius ratio be fixed to the guess value.

Should the mid-time of first transit be fixed to the guess value.

Should the eccentricity of the planet's orbit be fixed to the guess value.

Should the planet radius to semi-major axis ratio be fixed to the guess value.

fix_inclination = boolean
Should the inclination be fixed to the guess value.

fix_argument_of_periastron = boolean
Should the argument of periastron be fixed to the guess value.

fix_argument_of_periastron = boolean
Should the argument of periastron be fixed to the guess value.

fix_secondary_eclipse_depth = boolean
Should the secondary eclipse depth be fixed to the guess value.

fix_flux_offset = boolean
If this parameter is yes, the code will assume that the data has been appropriately normalized and the model will have a fixed out-of-transit value of one. If this parameter is set to no an additional parameter is fit for: the out-of-transit flux level. The initial guess value is always 1.0 and the output value from the fit is given as an offset from one.

remove_flagged_data = boolean
Before any fitting occurs, should data with a quality flag greater than zero be removed. A quality flag not equal to zero indicates there may be issues with the data.

fit_tolerance = float
The iterative change in the chi-squared value required for the fitting algorithm to be considered as converged.

fitter = float
Currently the only stable fitting algorithm is fmin.

normalize = boolean
Normalizes the light curve by dividing the flux time series by the median value of the time series. Before the median is calculated, outliers further than 3-sigma from the median of the flux values are removed.

clobber = boolean
Option to overwrite the output file. If clobber = no and an existing file has the same name as outfile then the task will stop with an error.

plot = boolean
Plot the fitted transit model and the flux time series

verbose = boolean (optional)
Option for verbose mode, in which informative messages and warnings to the shell and a logfile.

logfile = string (optional)
Name of the logfile containing error and warning messages.

status = integer
Exit status of the script. It will be non-zero if the task halted with an error. This parameter is set by the task and should not be modified by the user.

keptransit allows you to fit a Mandel and Agol (2002) limb darkened transit model to a Kepler light curve. The algorithm allows for eccentric orbits, secondary eclipses and for the various fitting parameters to be kept fixed. The output file is a FITS file containing two additional columns relative to the input file: the transit model values and the orbital phase of the planet, which runs from zero to one. Before running this algorithm it is expected that the data has been treated to remove stellar and instrumental variability and that the out-of-transit data has been normalized to one. Additionally, accurate inital guesses for the period and time of first transit are required. A good method to find some of these (period, epoch, transit duration) is using the kepbls tool. We have found that a good way to get a reasonable fit is to initally fix everything but the period and epoch. Once the best fitting epoch and period are found, fix these and free the other parameters. The tool allows for several different limb darkening laws. Limb darkening parameters appropriate for the Kepler bandpass can be found in Claret and Bloemen (2011). We highly rerecommendhat you do not use the four-parameter non-linear limb darkening law owing to the computational intensity of this algorithm and the nenegligible improvement over the quadratic law.


  • keptransit inputfile=kplr011446443-2010355172524_llc.fits   outputfile=tres2.fits   datacol=DETSAP_FLUX errcol=DETSAP_FLUXERR   period=2.47   scaled_planet_radius=0.1   epoch=631.7   eccentricity=0.0   scaled_semimajor_axis=7.0   inclination=90.0   argument_of_periastron=0.0   limb_darkening_parameters='0.4330 0.3552 0.0450 -0.1022'   secondary_eclipse_depth=0.0   fix_period=no   fix_scaled_planet_radius=yes   fix_epoch=no   fix_eccentricity=yes   fix_scaled_semimajor_axis=yes   fix_inclination=yes   fix_argument_of_periastron=yes   fix_secondary_eclipse_depth=yes   fix_flux_offset=no   remove_flagged_data=yes   fit_tolerance=0.01   fitter=fmin   normalize=yes   clobber=yes   plot=yes   verbose=0   logfile='keptransit.log'   status=0

Execution of this program for 1 quarter of long cadence data using a 3.06 GHz Intel Core 2 Duo Mac running OS 10.6.4 takes a few minutes.

The Kepler PyRAF package is privately-developed software made available to the community through the contributed software page of the GO program at http://keplerscience.arc.nasa.gov/ContributedSoftware.shtml. It is not an official software product of the Kepler mission. Bugs and errors are not the responsibility of NASA or the Kepler Team. Please send bug reports and suggestions to keplergo@mail.arc.nasa.gov.


Initial software release (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 11, 2013
+ Contact NASA