<jupyter_start><jupyter_text><jupyter_code>pip install lightkurve
#using local path or remote url to load KeplerTargetPixelFile
from lightkurve import KeplerTargetPixelFile
tpf = KeplerTargetPixelFile("https://archive.stsci.edu/pub/kepler/target_pixel_files/0069/006922244/kplr006922244-2010078095331_lpd-targ.fits.gz")
#searches mast directory for kepler and k2 data
from lightkurve import search_targetpixelfile
tpf = search_targetpixelfile('KIC 6922244', quarter=4).download()
tpf #object type
tpf.mission #mission name
tpf.quarter #quarter the data was taken from
tpf.time #time stamps of the observations
tpf.astropy_time #converts from Barycentric Kepler Julian Day format (BKJD) to Astropy time objects
tpf.astropy_time.iso #human readable iso timestamps
tpf.astropy_time.utc.iso #to use a different time scale (i.e utc)
tpf.flux.shape #actual image data
%matplotlib inline
tpf.plot(frame=0); #frame used to check a particular flux point for thruster firings, cosmic rays or asteroids
tpf.flux[0] #values of the image as an array
tpf.pipeline_mask #measure the standard pipeline aperture
tpf.plot(aperture_mask=tpf.pipeline_mask); #plot the aperture
tpf.header[:10] #raw metadata
tpf.hdu[1].header['TTYPE*']<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08118971061093247, 'fraction_numerical': 0.03938906752411576, 'mean_word_length': 6.732919254658385, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '442649', 'license': 'MIT', 'n_tokens_mistral': 460, 'n_tokens_neox': 409, 'n_words': 124, 'path': 'Interns/Sarah/What_are_TargetPixelFile_objects?.ipynb', 'repo_name': 'sarahrdk/EscapeEarth', 'size': '1244'}