TargetPixelFile

The lightkurve.targetpixelfile module provides classes which represent FITS files that store the original pixel data (images) obtained by the Kepler or TESS telescopes. These classes provide methods to visualize these data and extract custom light curves.

Constructor

KeplerTargetPixelFile(path[, quality_bitmask])

Class to read and interact with the pixel data products (“Target Pixel Files”) created by NASA’s Kepler pipeline.

TessTargetPixelFile(path[, quality_bitmask])

Represents pixel data products created by NASA’s TESS pipeline.

KeplerTargetPixelFile.hdu

KeplerTargetPixelFile.ra

Right Ascension of target (‘RA_OBJ’ header keyword).

KeplerTargetPixelFile.dec

Declination of target (‘DEC_OBJ’ header keyword).

KeplerTargetPixelFile.column

CCD pixel column number (‘1CRV5P’ header keyword).

KeplerTargetPixelFile.row

CCD pixel row number (‘2CRV5P’ header keyword).

KeplerTargetPixelFile.pos_corr1

Returns the column position correction.

KeplerTargetPixelFile.pos_corr2

Returns the row position correction.

KeplerTargetPixelFile.pipeline_mask

Returns the optimal aperture mask used by the pipeline.

KeplerTargetPixelFile.shape

Return the cube dimension shape.

KeplerTargetPixelFile.time

Returns the time for all good-quality cadences.

KeplerTargetPixelFile.cadenceno

Return the cadence number for all good-quality cadences.

KeplerTargetPixelFile.nan_time_mask

Returns a boolean mask flagging cadences whose time is nan.

KeplerTargetPixelFile.flux

Returns the flux for all good-quality cadences.

KeplerTargetPixelFile.flux_err

Returns the flux uncertainty for all good-quality cadences.

KeplerTargetPixelFile.flux_bkg

Returns the background flux for all good-quality cadences.

KeplerTargetPixelFile.flux_bkg_err

KeplerTargetPixelFile.quality

Returns the quality flag integer of every good cadence.

KeplerTargetPixelFile.wcs

Returns an astropy.wcs.WCS object with the World Coordinate System solution for the target pixel file.

KeplerTargetPixelFile.get_coordinates([cadence])

Returns two 3D arrays of RA and Dec values in decimal degrees.

KeplerTargetPixelFile.to_lightcurve([…])

Performs photometry on the pixel data and returns a LightCurve object.

KeplerTargetPixelFile.create_threshold_mask([…])

Returns an aperture mask creating using the thresholding method.

KeplerTargetPixelFile.estimate_background([…])

Returns an estimate of the median background level in the FLUX column.

KeplerTargetPixelFile.estimate_centroids([…])

Returns the flux center of an object inside aperture_mask.

KeplerTargetPixelFile.query_solar_system_objects([…])

Returns a list of asteroids or comets which affected the target pixel files.

KeplerTargetPixelFile.plot([ax, frame, …])

Plot the pixel data for a single frame (i.e.

KeplerTargetPixelFile.to_fits([output_fn, …])

Writes the TPF to a FITS file on disk.

KeplerTargetPixelFile.interact([…])

Display an interactive Jupyter Notebook widget to inspect the pixel data.

KeplerTargetPixelFile.interact_sky([…])

Display a Jupyter Notebook widget showing Gaia DR2 positions on top of the pixels.

KeplerTargetPixelFile.to_corrector([method])

Returns a Corrector instance to remove systematics.

KeplerTargetPixelFile.cutout([center, size])

Cut a rectangle out of the Target Pixel File.

KeplerTargetPixelFile.from_fits_images(…)

Creates a new Target Pixel File from a set of images.

KeplerTargetPixelFile.plot_pixels([ax, …])

Show the light curve of each pixel in a single plot.

KeplerTargetPixelFile.get_header([ext])

Returns the metadata embedded in the file.

KeplerTargetPixelFile.get_keyword(keyword[, …])

Returns a header keyword value.