Skip to content
Create individual FITS files of K2 superstamp regions.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


These scripts can be used to create individual FITS files of K2 superstamp regions from the original target pixel files. To use this version of the API and determine a WCS solution, you must have simplejson in your python path, as well as version 2 of the Kepler PyKEtools (

Follow these steps to reproduce the superstamp fits files that we have released at the MAST archive at Some example files are provided for you to see the output and text lists.

0.) Pick a superstamp for which you want fits files.

1.) Gather all target pixel files associated with the superstamp of interest and place them in a directory. Go into the appropriate assemble_fits_C*.py file and change the file path in line 13 ('filenames = ...') to reflect that directory path. Run assemble_fits_C*.py.

2.) Make a list of the resulting fits files and put them in a text file called filenames_XX.txt, where XX is your cluster (e.g., M67).

3.) To determine an accurate WCS solution for your files you need an account with astrometry net, and an associated API key. (Alternatively you can follow their instructions to do a local installation and skip this step). Go into the file fixwcs_api_C*.py and insert your API key in the cli.login() line. Do the same in the file for the variable apiKey. Run fixwcs_api_C*.py.

4.) Make a list of the results files *wcs.fits in the text file filenames_XX_wcsfinal.txt, where XX is again your cluster.

4a.) If you are interested in a very accurate WCS solution for the Lagoon region (Campaign 9), run the intermediate script You need to put the input fits files in a list filenames_M8_wcs.txt. Run the script and then save a list of the resulting *wcs2.fits files into filenames_M8_wcsfinal.txt.

5.) To do the final header clean-up that was necessary for us to meet the criteria for a High Level Science Product, run the cleanheader_c*.py script.

You can’t perform that action at this time.