rawtran(1) RAW to FITS converter


rawtran [options] file


Rawtran is an utility to convert of raw photos in .CR2, .CRW, MRW, NEF, RAF, etc. formats to the general astronomical FITS image format [4]. The identification of raw photo type and decoding itself is done via DCRAW utility by D.Coffin [2]. Dcraw needs to be available independently.

Rawtran produces following kinds of FITS files:

Type: color (-t 0)
The output image is the color FITS image (as specified by Munipack [3]). It is intended for representation of color images.
Type: instrumental (-t 1)
The type provides absolutely raw access to data in FITS format. According to astronomical terminology, the single bands are in instrumental photometric system.
Type: single spectral band (-t . -c .)
The type is intended for representation of the brightness in the selected color band.

All produced data are RELATIVE quantities only.

Rawtran internally uses 4-byte (float) data representation for all operations.


-t [0|1]
Specify a type of conversion. 0 for the standard spectral band(s) (default). 1 for Instrumental spectral band(s).
-c [X|Y|Z|R|V|B|u|s] or [Ri,Gi,Gi1,Gi2,Bi]
Select a color band. Wrong specification is silently ignored.
-B [8|16|32|-32]
Select bits per pixel of an output image. Possible values are: 8 (0-255), 16 (0-65535), 32 (0-4294967296) and -32 (-10^38 .. 10^38), (values in braces indicates numerical range). An optimal bitpix for raw (instrumental) data is 16 (default) which covers a full range of digital cameras. The representation occupies width*height*2 bytes. Some out of range (rare) values will suppressed (cut off). The representing by float numbers (eg. -32) is recommended value for images intended for further processing because saves numerical precision and their numerical range (but occupies of twice more space with respect to 16). 8 bits reduces range (eg. suppress dynamical range) and 32 wastes a lot of storage place only.
-o filename
Specify an output file name. If the option is not used, the output is stored as rawtran.fits. Use dash '-' for redirection to the standard output. Precede the filename with exclamation point(!) to overwrite existing file.
-X options
Specify additional options to dcraw itself. If you passed an option with parameter or more options, please, enclose ones to quotes or apostrophes. In doubts, use -X "-v" to show detailed description of conversion by dcraw.
Show summary of options.
Display software version.


The zero indicates successful conversion. A non-zero value is returned when an error occurs during conversion. If the utility is launched without options or with -h switch, zero means that rawtran's internal checker can run dcraw binary and non-zero value otherwise.


Convert an image to be equivalent to humans eye brightness sensitivity at day:
bash$ rawran IMG_0666.CR2 -o IMG_0666.fits
Convert an image to be equivalent to Landolt's B filter:
bash$ rawran -c B IMG_0666.CR2 -o IMG_0666.fits
Produce a color FITS and show it in xmunipack:

$ rawran IMG_0666.CR2 -o IMG_0666.fits

$ xmunipack IMG_0666.fits

Get green component of RAW:
$ rawran -t 1 -c Gi IMG_0666.CR2 -o IMG_0666.fits
Overwrite an output file:
$ rawran IMG_0666.CR2 -o '!IMG_0666.fits'
A large set of RAW images can be converted with help of shell:
$ for A in *.CR2; do rawtran $A -o ${A%CR2}fits; done


Filip Hroch ([email protected])