STScI logoSTSDAS Help Pages
fitswrite compression fitswrite

NAME · USAGE · PARAMETERS · DESCRIPTION · EXAMPLES · TIME_REQUIREMENTS
BUGS · SEE_ALSO

NAME

fitswrite -- Create a compressed FITS file from an IRAF image.

USAGE

fitswrite images fitsfiles [bscale] [bzero]

PARAMETERS

images
List of input IRAF images.
fitsfiles
List of output FITS files. A ".Z" is appended automatically to the compressed file names.
bscale
This parameters has the same meaning as the bscale parameter of wfits. The FITS bscale parameter, defined as p = i * bscale + bzero, where p and i are the physical and tape data values respectively. The bscale parameters is only requested if the scale switch is set and the autoscale switch is turned off.
bzero
This parameters has the same meaning as the bzero parameter of wfits. The FITS bzero parameter (see bscale for a definition). Bzero is only requested if the scale switch is set and the autoscale switch is turned off.
bitpix = 0
This parameters has the same meaning as the bitpix parameter of wfits. A bitpix of 8, 16, or 32 will produce either an unsigned byte, twos-complement 16 bit integer, or twos-complement 32 bit integer FITS image. If bitpix is -32 or -64 IEEE real or double precision floating point FITS images are produced. If bitpix is set to 0 (the default), wfits will choose one of 8, 16, 32, -32 or -64 based on the data type of the IRAF image. For example a short integer and real image will default to bitpix 16 and -32 respectively. Users should be wary or overriding the default value of bitpix as loss of precision in their data may result. In this case wfits will issue a warning message and an estimate of the maximum loss of precision to be expected.
scale = yes
This parameters has the same meaning as the scale parameter of wfits. If the scale switch is set, the IRAF image will be scaled before output. Two types of scaling are available. The scaling parameters bscale and bzero may be entered by the user (autoscale = no ), or the program can calculate the appropriate bscale and bzero factors (autoscale = yes ). If the scale switch is turned off, the IRAF image data is converted directly to integers of the specified bitpix with possible loss of precision.
autoscale = yes
This parameters has the same meaning as the autoscale parameter of wfits. If the autoscale switch is set, wfits calculates the appropriate bscale and bzero factors based on the IRAF image data type, and the maximum and minimum values of the data.
verbose = no
Verbose operation ?. If this switch is set to yes then the task will output information about the IRAF to FITS conversion and the compress operation.
flist1, flist2
Used internally by the task.

DESCRIPTION

This is a CL script that, for each image file in the input list, it converts the IRAF image into a FITS file, and then compresses the FITS file. A ".Z" suffix is added to the compressed FITS file. The compress operation is performed by the UNIX utility compress , called as a foreign task, and the IRAF to FITS conversion is performed by the wfits task.

EXAMPLES

Create a compressed FITS file from an IRAF image, using verbose output.


co> fitswrite image fits 1.0 0.0 verbose=yes
fits.Z:  -- replaced with fits
File: image  m51  B  600s          Size = 512 x 512
	2 Header 183 Data logical (2880 byte) records written
fits: Compression: 53.46% -- replaced with fits.Z

TIME REQUIREMENTS

It takes about fifteen seconds to generate a compressed FITS file for a 512x512 short image, on a Sparcstation-1 with a SCSI disk.

BUGS

The task might leave some temporary files in the current directory if it's aborted by the user before it completes.

SEE ALSO

compression.fitsread, dataio.wfits, (UNIX) compress.


Source Code · Search Form · STSDAS

Maintained by the Science Software Group at STScI
This file last updated on 21 Jan 1992