Skip to main content

Utilities for FITS files: safe (de)compression, exporting to images/movies, parallelized ops on collections, and QA

Project description

FITSbits is a Python package that contains various utilities for handling FITS files.

To install fitsbits from the Python Package Index (PyPI):

$ pip install fitsbits

See the installation instructions below for details.

This package requires Python >= 3.6.

Package contents

  • contains functions to perform safe and atomic compression and decompression of FITS files in gzip and fpack formats. Requires the GNU gzip and CFITSIO fpack/funpack utilities.

  • contains functions to export FITS images as JPEGs, generating stamps for FITS images and exporting these as PNGs, and turning collections of FITS JPEGs into movies.

  • contains functions to work on collections of FITS files: parallelized extraction of header information (including regex matching), sorting and filtering by FITS header keys; group frames by pointing, observed object, image type, or file name patterns; and parallel compression and uncompression for FITS file lists or directories.

  • contains functions to perform various header and data extraction operations on FITS files.

  • contains functions that help assess the quality of FITS images: including extracting image backgrounds, tiling images, checking for image curvature and vignetting, and calculating image statistics.

Command-line utilities

  • command-line utility available as fitsbits-export when this package is installed; exports a FITS image to a full JPEG or PNG, stamp PNG, or JPEGs/PNGs of specified regions (RA/Dec or x/y coordinate boxes).

  • command-line utility available as fitsbits-movie when this package is installed; converts a series of FITS images to a MP4 movie. Requires FFmpeg.

  • command-line utility available as fitsbits-header when this package is installed; extracts and dumps a FITS file's header to stdout.


Please see for a list of changes applicable to tagged release versions.



This package requires the following other packages:

  • numpy
  • scipy
  • astropy
  • Pillow
  • filelock
  • tenacity
  • scikit-learn

Installing with pip

You can install fitsbits with:

(venv)$ pip install fitsbits

Other installation methods

Install the latest version (may be unstable at times):

$ git clone
$ cd fitsbits
$ python install
$ # or use pip install . to install requirements automatically
$ # or use pip install -e . to install in develop mode along with requirements


fitsbits is provided under the MIT License. See the LICENSE file for the full text.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for fitsbits, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size fitsbits-0.1.4-py3-none-any.whl (431.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size fitsbits-0.1.4.tar.gz (440.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page