loopfits

NAME

loopfits -- Convert a reference file to fits format

USAGE

loopfits file [file ...]

DESCRIPTION

This task is run by entering the name of the task followed by a blank separated list of the reference files you wish to convert to fits files. For example,

loopfits a3d1145dy.cy0 d9g1458cu.r2h

Wildcard patterns can be used in the list of filenames. The output of the task is a fits file for each reference file in the argument. The names of the output files are generated by appending the filename extension on the root separated by an underscore and adding a new extension of .fits. In the case of images, the last letter of the original extension is also changed to f. Loopfits generates no output messages on its own, all output is generated by the underlying call to stwfits.

PARAMETERS

ALGORITHM

The code code consists of two subroutines called in a loop. The first function, makeoutname, creates the output filename from the input filename. Since the rule for generating output filename differs between tables and images, it calls another subroutine, is_image to determine if the file is an image. It does this by reading the first nine characters of the file and if they are SIMPLE =, it says the file is an image. The second function, makefits, generates a temporary parameter file for stwfits, calls it, deletes the temporary file, and checks to see if the fits file was created.

INSTALLATION DEPENDENCIES

The variable fitsio at the top of the script contains the name of the executable for stwfits and the assignment statement which sets it must be modified for the system stwfits is installed on. Similarly the first line of the script must be set to the Perl interpreter executable.

EXAMPLES

The script can be executed on any of the reference files in the test/data subdirectory. For example,

loopfits a3d1145dy.cy0 d9g1458cu.r2h