Skip to content
forked from KeplerGO/kadenza

Converts raw cadence target data from the Kepler space telescope into astronomer-friendly FITS files.

License

Notifications You must be signed in to change notification settings

rodluger/kadenza

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kadenza: Kepler/K2 Cadence Data Reader

Converts raw cadence data from the Kepler spacecraft into astronomer-friendly FITS files.

Travis status MIT license astropy DOI

Kadenza allows the raw cadence pixel data from the Kepler space telescope to be inspected as soon as they arrive on Earth; bypassing the (time-consuming) standard pipeline processing to enable time-critical data analyses to be carried out quickly.

The primary motivation for creating this tool is to enable the K2 Campaign 9 microlensing science team to use the raw spacecraft data to identify microlensing events as soon as possible. Most users of Kepler/K2 data will not require this tool however, because it does not produce fully-calibrated data products at this stage.

Kadenza can be used both as a command-line tool or using its Python API.

Example

For K2 Campaign 9, the data archive at MAST provides access to the raw cadence data files. There is one such file per long cadence, named kplrYYYYDDDHHMMSS_lcs-targ.fits, which provides the pixel counts in that cadence for all those pixels which were pre-selected to be downlinked from the spacecraft (roughly 3% of the 95-megapixel camera). The timestamp that is recorded in the filename refers to the end of the long cadence, which is a period of 0.4904h during which the spacecraft summed 270 exposures of 6.02s each.

To reconstruct two-dimensional images from the cadence data files, we need an additional file called the pixel mapping reference file. This file specifies the (column, row) CCD coordinates for each value in the one-dimensional cadence data arrays. This information is kept in a separate file to avoid having to repeat the pixel coordinates in each cadence file. For K2 Campaign 9a the mapping file you need is called kplr2016068153039-085-085_lcm.fits and can be obtained from the archive.

One you have obtained the raw data, you can then use Kadenza to convert them into two-dimensional images. Once intalled (see below), Kadenza adds the kadenza-ffi tool to your command-line which you simply call as follows:

$ kadenza-ffi cadence-data-file pixel-mapping-file

In our example, we'd execute:

$ kadenza-ffi kplrYYYYDDDHHMMSS_lcs-targ.fits kplr2016068153039-085-085_lcm.fits

This will create a new file called kplrYYYYDDDHHMMSS_kadenza_ffi_raw.fits which is a FITS file with 84 image extensions, each corresponding to the different Kepler CCD channels. The units are counts and unobserved pixels are set to "-1". Timestamps refer to the end of each cadence can be obtained from the filename or the DATE-END keyword in the header.

You can also convert the raw cadence data into TPF files using kadenza-tpf, e.g.:

$ kadenza-tpf --target 200049143 cadence-data-list.txt pixel-mapping-file.fits

Installation

If you have a working installation of Python on your system, you can download and install the latest version as follows:

$ git clone https://github.com/KeplerGO/kadenza.git
$ cd kadenza
$ python setup.py install

Kadenza has only been tested under Linux with Python 3 at present.

Usage

$ kadenza-ffi --help
usage: kadenza-ffi [-h] cadence_file pixelmap_file

Turns a raw Kepler Cadence Data file into an uncalibrated Full Frame Image
(FFI).

positional arguments:
  cadence_file   path to the '*_lcs-targ.fits' cadence data file
  pixelmap_file  path to the '*_lcm.fits' pixel mapping reference file

optional arguments:
  -h, --help     show this help message and exit
$ kadenza-tpf --help
usage: kadenza-tpf [-h] [-t [target_id]] cadencefile_list pixelmap_file

Turn raw Kepler Cadence Data into uncalibrated Target Pixel Files (TPF).

positional arguments:
  cadencefile_list      path to a text file that lists the '*_lcs-targ.fits'
                        cadence data files to use
  pixelmap_file         path to the '*_lcm.fits' pixel mapping reference file

optional arguments:
  -h, --help            show this help message and exit
  -t [target_id], --target [target_id]
                        only produce a TPF file for a specific EPIC/KIC
                        target_id

Caveats

There are two main caveats to be aware of:

  • The present version does not set all header keywords exactly as they would appear in an official product. In particular, the WCS keywords are untested.
  • This tool does not calibrate the data at all, it merely serves to transform the raw pixel counts into a FITS format that is similar to, but not at all identical, to the official pipeline products.

Contributing

To report bugs and request features, please use the issue tracker or open a pull request.

License

Kadenza is made available under the MIT License. For details see the LICENSE file.

Citation

kadenza was created by Geert Barentsen for NASA's Kepler/K2 Guest Observer Office. If this tool aided your research, please consider offering co-authorship to the Kepler/K2 team, or at the very least, cite this tool using the DOI identifier or the following BibTeX entry:

@misc{geert_barentsen_2017_344973,
  author       = {Geert Barentsen},
  title        = {KeplerGO/kadenza: v2.0.2},
  month        = mar,
  year         = 2017,
  doi          = {10.5281/zenodo.344973},
  url          = {https://doi.org/10.5281/zenodo.344973}
}

About

Converts raw cadence target data from the Kepler space telescope into astronomer-friendly FITS files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%