# kepextract: create a light curve from a target pixel file by summing user-selected pixels¶

pyke.kepextract.kepextract(infile, outfile=None, bitmask=1114543, maskfile='ALL', bkg=False, psfcentroid=False, overwrite=False, verbose=False, logfile='kepextract.log')

kepextract – create a light curve from a target pixel file by summing user-selected pixels

kepextract calculates simple aperture photometry, from a target pixel file, for a user-supplied set of pixels. The Kepler pipeline sums a specific set of pixels to produce the standard light curves delivered to users. Termed the optimal aperture, the default pixel set is designed to maximize the signal-to-noise ratio of the resulting light curve, optimizing for transit detection. This tool provides users with a straightforward capability to alter the summed pixel set. Applications include:

• Use of all pixels in the aperture
• The Kepler pipeline does not produce a light curve for sources observed with custom or dedicated pixel masks. The user can create a light curve for these sources using kepextract.
• Construction of pixel light curves, in which the time series for a single pixel can be examined.
• Light curves for extended sources which may be poorly sampled by the optimal aperture.
$kepextract kplr008256049-2010174085026_lpd-targ.fits --maskfile ALL  One further can plot the resulted light curve by doing import matplotlib.pyplot as plt from astropy.io import fits f = fits.open('outlc.fits') plt.plot(f[1].data['TIME'], f[1].data['SAP_FLUX'])  or $ kepdraw outlc.fits