Convert DSLR RAW Images to Astronomical FITS Images
Pull request Compare This branch is 3 commits ahead, 2 commits behind eaydin:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


cr2fits version 1.0.3

A script to convert RAW images (canon, nikon etc.) to FITS images. I think this'll be useful for professional or amateur astronomers who happen to work with DSLR cameras and want to process their images with some astronomical tool (IRAF?). It extracts only one color channel of the RAW image, and writes the necessary EXIF information to the FITS header.

Dependencies :

  • Python 2.6.x or later. (Including Python 3.2)
  • PyFITS : You can get it with your package manager, or here :
  • dcraw : Try getting the latest version of this. Usually the ones in repositories is not the latest so it's possible that it'll convert your RAW images differently, corrupted. Get the latest version here :

Usage : <cr2-filename> <color-index>

  • cr2-filename : This will obviously be the name of the file to convert.
  • color-index : Can take three values, either 0, 1, 2 which represent Red, Green, Blue respectively.

Outputs :

The script will output 2 files. One PPM file, and one FITS file. The PPM file is useless if you don’t need it, but the script doesn’t delete it. I’ve left it on purpose, since the script you’re going to call cr2fits can easily handle the job. (ex: your shell script?) The FITS file is what we need, the color channel is also added to the name of the output file.