This notebook tutorial demonstrates how to load and display a TESS full frame image (FFI). We will display the image with the world coordinate system (WCS) overlayed on top.
%matplotlib inline
from astropy.io import fits
from astropy.wcs import WCS
import matplotlib.pyplot as plt
import numpy as np
TESS periodically reads out the entire frame of all four cameras, nominally every 30 minutes, and stores them as full frame images. Each camera covers ~24x24 degrees on the sky. These images can be used to construct light curves at 30-minute cadence for any object within the camera's field of view, in contrast to the subset of targets chosen by the mission to be read-out at shorter cadence (nominally two minutes) that receive mission-produced light curves.
This tutorial will refer to a couple TESS-related terms that we define here.
We will read the full frame image from Sector 1 using the MAST URL location. So that we can get started with understanding the file contents without reviewing how to automatically search for and retrieve TESS files, we won't show how to search and retrieve TESS FFIs in this tutorial. Consult other TESS tutorials in the TESS Archive Handbook for much more information on how to search for TESS data using MAST services.
# For the purposes of this tutorial, we just know the MAST URL location of the file we want to examine.
fits_file = "https://archive.stsci.edu/missions/tess/ffi/s0001/2018/206/4-2/tess2018206192942-s0001-4-2-0120-s_ffic.fits"
TESS FFI FITS files contain a primary HDU with metadata stored in the header. The first extension HDU contains more metadata in the header, and stores the full frame image. The second extension HDU contains the uncertainty values for the image. Let's examine the structure of the FITS file using the astropy.fits info
function, which shows the FITS file format in more detail.
fits.info(fits_file)
Now that we have the file, let's store the world coordinate system information for use later. We can use the astropy.wcs WCS
function to store the information from the image extension HDU's header.
The following command opens the file, extracts the WCS and Image data and then closes the file. Note this file is quite large and may take a few moments to dowload.
with fits.open(fits_file, mode = "readonly") as hdulist:
wcs_info = WCS(hdulist[1].header)
cal_image = hdulist[1].data
header = hdulist[1].header
# Use the header to determine the mid-point of the exposure time for this FFI.
mid_time = (header['TSTOP'] + header['TSTART']) / 2
We show the 2048x2048 image, adjusting the scale so that we can see more of the stars. We also imprint the WCS on top of the image.
plt.figure(figsize = (12,12))
plt.subplot(111, projection = wcs_info)
plt.imshow(cal_image, vmin = np.percentile(cal_image,4),vmax = np.percentile(cal_image, 98),origin = "lower")
plt.xlabel('RA')
plt.ylabel('Dec')
plt.title("TESS Calibrated FFI for Sector 1, Camera 4, CCD 2, Timestamp %f BTJD" % mid_time)
cal_image.shape
We describe some of the details you see on this FFI. For more detailed information please see the TESS Instrument Handbook (Section 4.1). Notice that our image is (2078, 2136) in size. Calibration row and columns are read-out in addition to the image data. These rows and columns remain in the calibrated image.
There are 4 sets of 11 columns (44 columns in total) that make up the leading and trailing black. Each CCD is read in 4 slices and each slice has an 11 column leading black and an 11 column trailing black. All of the leading black are placed in the first 44 columns while the trailing black are the last 44 columns.
The top 30 rows are, from the top, 10 virtual rows, 10 smear rows and 10 buffer rows.
Data annomalies are discussed in the TESS Setor 1 Data Release Notes. This bright area may be caused by some scattered light.
Authors: Scott W. Fleming and Susan E. Mullally, STScI Archive Scientists
Updated On: 2018-12-05