Skip to main content
Release file added late

1 file was added to this release more than 14 days after its initial publication. Inspect the release files before installing.

K2flix: Kepler pixel data visualizer

Create beautiful quicklook movies from the pixel data observed by NASA’s Kepler spacecraft.

PyPI PyPI Downloads Travis status MIT license DOI ADS Bibcode

K2flix makes it easy to inspect the CCD pixel data obtained by NASA’s Kepler space telescope. The need for this tool arises from the fact that the two-wheeled extended Kepler mission, K2, is affected by new sources of noise – including pointing jitter and foreground asteroids – which are more easily spotted by eye than by algorithm.

This tool takes Kepler’s Target Pixel Files (TPF) as input and turns them into contrast-stretched animated gifs or MPEG-4 movies. These TPF files are publically available from the Kepler archive and the K2 archive.

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

Example

Asteroids commonly pass in front of Kepler/K2 targets. We can use k2flix to create a two-day animation of pixel data to count the number of asteroids whizzing past:

$ k2flix --start 545 --stop 680 --step 1 --fps 12 http://archive.stsci.edu\
/missions/k2/target_pixel_files/c1/201500000/72000/ktwo201572338-c01_lpd-targ.fits.gz
k2flix output example

To see many more examples, follow @KeplerBot on Twitter!

Installation

If you have a working installation of Python on your system, you can install k2flix using pip:

$ pip install k2flix

Alternatively, you can get the latest version by installing from source:

$ git clone https://github.com/barentsen/k2flix.git
$ cd k2flix
$ python setup.py install

K2flix has been tested under Linux. Get in touch if you encounter issues on OS X or Windows.

Using k2flix

After installation, the k2flix tool will be available on the command line. You can then use it as follows.

Converting a Kepler pixel file to an animated gif:

$ k2flix tpf-file.fits.gz

Converting a Kepler pixel file to an MPEG-4 movie:

$ k2flix -o movie.mp4 tpf-file.fits.gz

K2flix supports reading from web URLs, so you can generate a movie directly from the data archive:

$ k2flix https://archive.stsci.edu/missions/k2/target_pixel_files/c1/201400000/00000/ktwo201400022-c01_lpd-targ.fits.gz

To see all the options, use the –help argument to see the full usage information:

$ k2flix --help
usage: k2flix [-h] [--output FILENAME] [--start START] [--stop STOP]
              [--step STEP] [--fps FPS] [--dpi DPI] [--min_cut MIN_CUT]
              [--max_cut MAX_CUT] [--min_percent %] [--max_percent %]
              [--cmap CMAP] [--raw] [--flags]
              [--ut | --jd | --mjd | --bkjd | --cadence]
              tpf_filename [tpf_filename ...]

Converts a Target Pixel File (TPF) from NASA's Kepler/K2 spacecraft into an
animated gif (default) or MPEG-4 movie.

positional arguments:
  tpf_filename       path to one or more Kepler Target Pixel Files (TPF)

optional arguments:
  -h, --help         show this help message and exit
  --output FILENAME  .gif or .mp4 output filename (default: gif with the same
                     name as the input file)
  --start START      first frame to show. Give the frame number (default 0),
                     or a Julian Day if --jd/--mjd is set, or a cadence number
                     if --cadence is set.
  --stop STOP        final frame to show. Give the frame number (default: -1),
                     or a Julian Day if --jd/--mjd is set, or a cadence number
                     if --cadence is set.
  --step STEP        spacing between frames (default: show 100 frames)
  --fps FPS          frames per second (default: 15)
  --dpi DPI          resolution of the output in dots per K2 pixel (default:
                     choose a dpi that produces a 440px-wide image)
  --min_cut MIN_CUT  minimum cut level (default: use min_percent)
  --max_cut MAX_CUT  maximum cut level (default: use max_percent)
  --min_percent %    minimum cut percentile (default: 1.0)
  --max_percent %    maximum cut percentile (default: 95)
  --cmap CMAP        matplotlib color map name (default: gray)
  --raw              show the uncalibrated pixel data ('RAW_CNTS')
  --flags            show the quality flags
  --ut               use Universal Time
  --jd               use Julian Day for annotation and --start/--stop
  --mjd              use Modified Julian Day for annotation and --start/--stop
  --bkjd             use Kepler Julian Day for annotation and --start/--stop
  --cadence          use Cadence Number for annotation and --start/--stop

Citing

If you use this tool in an academic publication, please include a citation. The code has been registered in the Astrophysics Source Code Library [ascl:1503.001] and the preferred BibTeX entry is:

@MISC{2015ascl.soft03001B,
  author        = {{Barentsen}, G.},
  title         = "{K2flix: Kepler pixel data visualizer}",
  howpublished  = {Astrophysics Source Code Library},
  year          = 2015,
  month         = mar,
  archivePrefix = "ascl",
  eprint        = {1503.001},
  adsurl        = {http://adsabs.harvard.edu/abs/2015ascl.soft03001B},
  adsnote       = {Provided by the SAO/NASA Astrophysics Data System},
  doi           = {10.5281/zenodo.15576},
  url           = {http://dx.doi.org/10.5281/zenodo.15576}
}

Contributing

To report bugs and request features, please use the issue tracker. Code contributions are very welcome.

License

Copyright 2016 Geert Barentsen. K2flix is free software made available under the MIT License. For details see the LICENSE file.

Metadata

Release files for k2flix 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

File added late

1 file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release files before installing.

Source distribution (sdist)

Source distribution for k2flix 2.1.0
File Size Uploaded Provenance Actions
k2flix-2.1.0.tar.gz 15.1 kB Without provenance Details for k2flix-2.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for k2flix 2.1.0
File Interpreter ABI Platform Actions
k2flix-2.1.0-py2.7.egg Legacy Egg format - - Details for k2flix-2.1.0-py2.7.egg

Total release size: 39.6 kB

Release files / k2flix-2.1.0.tar.gz

Download URL k2flix-2.1.0.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ef7674c5e68826dc2410c978d30fd957abdc69d3d79c7112b27ce6df07eef57b
BLAKE2b-256 checksum
How to use checksums
f8b44e23904dcc8b40f23a3d36e88570943a51c511a1d919d740ce7aa4d339cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / k2flix-2.1.0-py2.7.egg

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL k2flix-2.1.0-py2.7.egg
Size 24.5 kB
Tags Egg
SHA-256 checksum
How to use checksums
8caa3a0d8966bebeabf5031688896105ba7472ddb878471a3216315eb23e7d8a
BLAKE2b-256 checksum
How to use checksums
58e933d1a0a9ee6fd1cbcf0603835f550df127f8ab410823785402b0c88f1938
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for k2flix 2.1.0

Upload timing

Release file added late

1 file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.


Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page