lightkurve.TessTargetPixelFile#
- class lightkurve.TessTargetPixelFile(path, quality_bitmask='default', **kwargs)[source]#
Represents pixel data products created by NASA’s TESS pipeline.
This class enables extraction of custom light curves and centroid positions.
- Parameters
- pathstr
Path to a TESS Target Pixel (FITS) File.
- quality_bitmask“none”, “default”, “hard”, “hardest”, or int
Bitmask that should be used to ignore bad-quality cadences. If a string is passed, it has the following meaning:
“none”: no cadences will be ignored (
quality_bitmask=0).“default”: cadences with severe quality issues will be ignored (
quality_bitmask=175).“hard”: more conservative choice of flags to ignore (
quality_bitmask=7407). This is known to remove good data.“hardest”: removes all data that has been flagged (
quality_bitmask=8191). This mask is not recommended.
If an integer is passed, it will be used as a bitmask, i.e. it will have the effect of removing cadences where
(tpf.hdu[1].data['QUALITY'] & quality_bitmask) > 0. See theKeplerQualityFlagsclass for details on the bitmasks.- kwargsdict
Keyword arguments passed to
astropy.io.fits.open().
Methods
__init__(path[, quality_bitmask])animate([step, interval])Displays an interactive HTML matplotlib animation.
create_threshold_mask([threshold, ...])Returns an aperture mask creating using the thresholding method.
cutout([center, size])Cut a rectangle out of the Target Pixel File.
estimate_background([aperture_mask])Returns an estimate of the median background level in the FLUX column.
estimate_centroids([aperture_mask, method])Returns the flux center of an object inside
aperture_mask.extract_aperture_photometry([aperture_mask, ...])Returns a LightCurve obtained using aperture photometry.
from_fits_images(images_flux, position[, ...])Creates a new Target Pixel File from a set of images.
get_bkg_lightcurve([aperture_mask])get_coordinates([cadence])Returns two 3D arrays of RA and Dec values in decimal degrees.
get_header([ext])Returns the metadata embedded in the file.
get_keyword(keyword[, hdu, default])Returns a header keyword value.
interact([notebook_url, max_cadences, ...])Display an interactive Jupyter Notebook widget to inspect the pixel data.
interact_sky([notebook_url, aperture_mask, ...])Display a Jupyter Notebook widget showing Gaia DR2 positions on top of the pixels.
plot([ax, frame, cadenceno, bkg, column, ...])Plot the pixel data for a single frame (i.e.
plot_pixels([ax, periodogram, ...])Show the light curve of each pixel in a single plot.
query_solar_system_objects([cadence_mask, ...])Returns a list of asteroids or comets which affected the target pixel files.
show_properties()Prints a description of all non-callable attributes.
to_corrector([method])Returns a
Correctorinstance to remove systematics.to_fits([output_fn, overwrite])Writes the TPF to a FITS file on disk.
to_lightcurve([method, corrector])Performs photometry on the pixel data and returns a LightCurve object.
Attributes
astropy_timeDeprecated since version 2.0.
background_maskReturns the background mask used by the TESS pipeline.
cadencenoReturn the cadence number for all good-quality cadences.
cameraTESS Camera number ('CAMERA' header keyword).
ccdTESS CCD number ('CCD' header keyword).
columnCCD pixel column number ('1CRV5P' header keyword).
decDeclination of target ('DEC_OBJ' header keyword).
fluxReturns the flux for all good-quality cadences.
flux_bkgReturns the background flux for all good-quality cadences.
flux_bkg_errflux_errReturns the flux uncertainty for all good-quality cadences.
hduheaderDeprecated since version 2.0.
missionnan_time_maskReturns a boolean mask flagging cadences whose time is
nan.pipeline_maskReturns the optimal aperture mask used by the pipeline.
pos_corr1Returns the column position correction.
pos_corr2Returns the row position correction.
qualityReturns the quality flag integer of every good cadence.
raRight Ascension of target ('RA_OBJ' header keyword).
rowCCD pixel row number ('2CRV5P' header keyword).
sectorTESS Sector number ('SECTOR' header keyword).
shapeReturn the cube dimension shape.
timeReturns the time for all good-quality cadences.
wcsReturns an
astropy.wcs.WCSobject with the World Coordinate System solution for the target pixel file.