I have downloaded the calibrated ffi(full field image) for the Kepler field, aside from the primary HDU which contains the metadata, they contain 84 channels, each in the form of an image HDU, representing a small part of the field - I want to plot the full field in astropy, how would I go about it?

The Kepler ffi file can be found in the link below



1 Answer 1


Yes! I can do it for K2 and I'm guessing it should be similar.

You can see with fits.info(fits_file) that it has the 84 extensions (21 modules * 4 channels per module) you mention.

Then you can select a channel, e.g. 65, and prepare also the wcs coordinates so you get the RA and dec associated with the image for the axis.

n = 65

with fits.open(fits_file, mode = "readonly") as hdulist:
    wcs_info = WCS(hdulist[n].header)
    cal_image = hdulist[n].data
    header = hdulist[n].header 

Then you can just plot:

plt.figure(figsize = (15,15))

fig = plt.figure(figsize=(12, 8))
ax = fig.add_subplot(1, 1, 1, projection=wcs_info)
im = ax.imshow(cal_image, vmin = np.percentile(cal_image,1),vmax = np.percentile(cal_image, 98), origin='lower')

ax.coords[0].grid(color='white', ls='dotted')
ax.coords[1].grid(color='white', ls='dotted')

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .