Let's assume you have downloaded a set simulated TESS FFI images to a local directory called
lightkurve will assume that the files are given in time order. So we'll sort the filenames first:
from glob import glob import numpy as np
Now we use the
KeplerTargetPixelFile class and its function
from_fits_images() to create the new TPF. This will cut out around the position keyword. You can pass a pixel position in units of the original image or RA and Dec coordinates.
from lightkurve import KeplerTargetPixelFile from astropy.coordinates import SkyCoord
fnames = np.sort(glob('data/*.fits')) tpf = KeplerTargetPixelFile.from_fits_images(images=fnames, position=SkyCoord(257.13700, 24.48958, unit='deg'), size=(9,9), target_id='MyCutOut')