NAME

fixregion -- image region file converter from the image file it was extracted, to another instrument/detector system.


USAGE

        regfile 1 imgfile convfile[extnum] out_regfile 

or

     regfile 2 cdelt1 cdelt2 crpix1 crpix2 crval1 crval2 crota2 ctype1 convfile[extnum] out_regfile


DESCRIPTION

This task converts a region from one system (system1) of observation to another (system2) based on the reference coordinates in the FITS files of the two systems of observations. The region file is produced by SAOimage and save the image file before exiting SAOimage. This image file is then input file for the converter. The convfile is the file containing the coordinate information (CDELT*, CRPIX*, CRVAL*, CROTA*, CTYPE*) to be converted to. NOTE: BE SURE WHILE RUNNING FIXREGION, THIS FILE SHOULD BE SUPPLIED WITH APPROPRIATE EXTENSION NUMBER (e.g. filename[extnum]). The usefulness of the region converter is that selected region from one image file can be used in another system, provided the reference coordinates in both systems are known. The maximum no. of regions to be selected in the region file is 40. This task is introduced to mask nearby sources. The acceptable shapes for the regions are the following:

     circle
     box
     ellipse
     point
     annulus

The following reference keywords and their values are read from the FITS files.

They are passed to the ftwldp.f and xy2sky.f routines which compute the new coordinates.

     CRPIX1  =  X axis reference pixel
     CRPIX2  =  Y axis reference pixel
     CRVAL1  =  Sky coord of X ref pixel (degrees)
     CRVAL2  =  Sky coord of Y ref pixel (degrees)
     CDELT1  =  X axis increment (degrees)
     CDELT2  =  Y axis increment (degrees)
     CROTA2  =  Rotation angle
     CTYPE1  =  RA projection type 

If the input system1 file (imgfile) is not present then it asks for these relevant keywords from the user.


PARAMETERS

regfile [character string]
The region file containing region file data to be converted.

option [integer]
Either 1 or 2 depending on if one has the image file (option=1) or if one supplies the coordinates CRPIX*, CRVAL*, CDELT*, CROTA2, CTYPE1 (option=2) of the image file from which region is being extracted.

imgfile [character string]
The input FITS file for system1 coordinate system to be converted from.

convfile [character string]
The input FITS file for system2 coordinate system to be converted to WITH EXTENSION NUMBER.

out_regfile [character string]
The output file containing converted region file data.

cdelt1 [real]
X-axis increment value.

cdelt2 [real]
Y-axis increment value.

crpix1 [real]
X-axis reference pixel

crpix2 [real]
Y-axis reference pixel

crval1 [real]
Sky coordinate of X reference pixel in degrees

crval2 [real]
Sky coordinate of Y reference pixel in degrees

crota2 [real]
Rotation angle

ctype1 [character string]
Type of projection for RA. e.g. -TAN,-SIN etc.

(chatter=9) [integer]
Flag to set the chattyness at execution. Default value is set to 9, which gives the user the task version and few warnings. Lower/higher values produces quieter/verbose output on the screen.

(clobber = false) [boolean]
Flag specifying whether or not a pre-existing file with the same name as that requested as the output file from this task will be overwritten.


BUGS

None known. The convfile should be used with its extension number where the coordinate information to be found.


SEE ALSO

help on fregcon, ftwldp.f, xy2sky.f


EXAMPLE

For example, if the region filename is REG.IN, image filename is REG.IMG, the convfile name is CONV.FITS with primary extension for coordinate information, the outfile name REG.OUT, then the command line

     fixregion reg.in 1 reg.img[0] convfile=conv.fits out_regfile=reg.out
     

LOG OF SIGNIFICANT CHANGES:

v1.1.0 (July, 1996) provision to handle any type of convfile v1.0.0 (May, 1996) created PRIMARY AUTHOR: Banashree Mitra Seifert HEASARC, NASA/GSFC http://heasarc.gsfc.nasa.gov/cgi-bin/ftoolshelp

CATEGORY

Feb96 ftools.heasarc