Target Pixel Files¶
The lightkurve
documention has awesome resources for playing with
Target Pixel Files (TPFs) from Kepler or TESS. Go look
there! However, we added a few small
wrappers to make it very slightly easier to download a simple Target
Pixel File for either Kepler, K2, or TESS. Here’s the scoop:
In [ ]:
import henrietta as hsl
Downloading TPFs¶
For Kepler, you’ll need to specify a Kepler quarter, a period of roughly 90 days. Remember that the pixels rotate on the sky 4 times a year, so you can’t seamlessly stitch together multiple TPFs.
In [ ]:
tpf_kepler = hsl.download_kepler_tpf('Kepler-7', quarter=2)
For K2, you can include a star name or an EPIC ID number (which can often be found on the NASA Exoplanet Archive).
In [ ]:
tpf_k2 = hsl.download_k2_tpf(206103150)
For TESS, only a tiny fraction of the data is available right now, all located at MAST. Still, here’s a wrapper to download a star, based on its TESS Input Catalog (TIC) identification number.
In [ ]:
tpf_tess = hsl.download_tess_tpf(25155310)
Simple TPF Procedures¶
This is just a tiny sample of things you can do with a TPF. Again, you
should go read the lightkurve
documentation and
tutorials for TPFs! You can make an
imshow plot of a single frame, where you specify which image you want in
the movie via the frame
keyword.
In [ ]:
tpf_k2.plot(frame=0)
tpf_k2.plot(frame=100);
You can make a light curve from the TPF.
In [ ]:
lc =tpf_k2.to_lightcurve(aperture_mask='all')
lc.scatter();
You can access the times and the array of fluxes directly.
In [ ]:
time = tpf_k2.time
movie = tpf_k2.flux
print('This TPF has {} times and an array of pixels with shape {}.'.format(len(time), movie.shape))