Quickstart#

The easiest way to install tesscube and all of its dependencies is to use the pip command.

To install tesscube, run the following command in a terminal window:

$ python -m pip install tesscube --upgrade

The --upgrade flag is optional, but recommended if you already have tesscube installed and want to upgrade to the latest version.

Depending on the specific Python environment, you may need to replace python with the correct Python interpreter, e.g., python3.

Load an FFI cube#

You can work with an FFI cube by loading it using a sector, camera, and CCD number.

from tesscube import TESSCube
cube = TESSCube(sector=1, camera=1, ccd=4)

Obtain an FFI Using tesscube#

You can obtain an FFI image by indexing into a cube

from tesscube import TESSCube
cube = TESSCube(sector=1, camera=1, ccd=4)
ffi = cube[300]

This will return an astropy.fits.HDUList

Obtain a TPF#

You can obtain a TPF in two ways, either you can either pass a pixel position

from tesscube import TESSCube
from astropy.coordinates import SkyCoord
corner = (1282, 1750)
cube = TESSCube(sector=1, camera=1, ccd=4)
tpf = cube.get_tpf(corner, shape=(10, 11))

Or you can pass an astropy SkyCoord object containing the RA and Dec of the target

from tesscube import TESSCube
from astropy.coordinates import SkyCoord
coord = SkyCoord.from_name("AU Mic")
cube = TESSCube(sector=1, camera=1, ccd=4)
tpf = cube.get_tpf(coord, shape=(10, 11))

Alternatively, you can index into the cube like so:

from tesscube import TESSCube
cube = TESSCube(sector=1, camera=1, ccd=4)
tpf = cube[:, 401:410, 503:510]

Both will return an astropy.fits.HDUList, with a file format similar to the official mission products.

Obtain a lower time resolution TPF#

You can obtain a lower time resolution by either passing in a frame_bin parameter, which will downsample the resultant TPF,

from tesscube import TESSCube
from astropy.coordinates import SkyCoord
corner = (1282, 1750)
cube = TESSCube(sector=1, camera=1, ccd=4)
tpf = cube.get_tpf(corner, shape=(10, 11), frame_bin=10)

Or you can slice the cube, which will return a downsampled TPF

from tesscube import TESSCube
cube = TESSCube(sector=1, camera=1, ccd=4)
tpf = cube[::10, 401:410, 503:510]

Both will return an astropy.fits.HDUList, with a file format similar to the official mission products, with the time resolution reduced by a factor of 10.