WIRE DA Tool: imhdrboresightcorr


Description

Perl script imhdrboresightcorr modifies FITS keywords CRVAL1, CRVAL2, and CROTA2 of specified FITS files by applying an input set of correction quaternions. This tool is useful for correcting image headers that have been processed by ingest with unknown star-tracker/telescope correction quaternions. In general, the star-tracker/telescope boresight correction quaternions are WIRE band dependent, so this tool must be executed separately for each band.

Recently, the tool has been upgraded with additional capabilities that make it more general than its name suggests. The tool can be used to modify FITS keywords CDELT1 and CDELT2, which specify the image plate scales. It can also rotate and/or flip the image data, independent of any FITS header changes.

The tool is now under both CVS version control (/proj/wire/cvsroot/da/russ/acs), and make control (makefile.p-bin). The executables have been delivered to /proj/wire/dev/bin. The source code is located in /proj/wire/russ/acs.

Required and Optional Inputs

Command-line input Definition
-q1corr or -q1c value Correction quaternion #1 for rotation from star-tracker boresight to telescope boresight.
-q2corr or -q2c value Correction quaternion #2 for rotation from star-tracker boresight to telescope boresight.
-q3corr or -q3c value Correction quaternion #3 for rotation from star-tracker boresight to telescope boresight.
-q4corr or -q4c value Correction quaternion #4 for rotation from star-tracker boresight to telescope boresight.
-cdelt1 or -cd1 value Pixel size in degrees along dimension 1 of the image. The adopted convention for WIRE images is that CDELT1 is negative (a condition not enforced by this tool).
-cdelt2 or -cd2 value Pixel size in degrees along dimension 2 of the image.
-flip or -fi or -flipimages Switch to enable image flipping and/or rotating
-flipargs or -fa value1,value2,value3 The first two values should be set to either 0 or 1; the third value should be set to an integer in the 0-3 range. The first value causes the image to be flipped about image dimension 2 (i.e., for symmetry along dimension 1), the second value causes the image to be flipped about image dimension 1, and the third value causes the image to be rotated counter-clockwise value3 times 90 degrees.
-list or -listimages path and file name In addition to any input FITS filenames specified at the end of the command line, a text file containing a list of FITS filenames whose headers are to be modified can be specified here. Each filename in the list file should be on a separate line.
-verbose or -v Enable verbose mode.

Usage

Example of how to execute imhdrboresightcorr for the case where the input FITS files are specified on the command line:

imhdrboresightcorr -v -q1corr 0.000447116167687021 \
-q2corr -0.000503139715692272 -q3corr 0.971954636816144 \
-q4corr 0.235167536423043 -cd1 -0.004 -cd2 0.004 -flip -fa 0,0,3 ws*.fits

The above example causes FITS keywords CRVAL1, CRVAL2, CROTAT2, CDELT1, and CDELT2 to be modified, as well as the image data to be rotated counter-clockwise 270 degrees in all ws*.fits files.

Example of how to execute imhdrboresightcorr for the case where the input FITS files are specified in a file:

imhdrboresightcorr -v -q1corr 0.000447116167687021 \
-q2corr -0.000503139715692272 -q3corr 0.971954636816144 \
-q4corr 0.235167536423043 -list save.tmp

The file save.tmp in the example above simply contains a list FITS files:
ws3005k00201.fits 
ws3005k00202.fits 
ws3005k00203.fits 
ws3005k00204.fits 
ws3005k00205.fits 
ws3005k00206.fits 
ws3005k00207.fits 
ws3005k00208.fits 
ws3005k00209.fits


Last revised: October 26, 1998

Software developer: Russ Laher (laher@ipac.caltech.edu)

URL: http://spider.ipac.caltech.edu/staff/laher/imhdrboresightcorr.html

Return to Home Page