gwcs

An early OTW script that uses the ds9_2f script so that the user can locate the positions and identities of of known stars in the CCD image to be calibrated.


% % gwcs a.fits Y 

arg1 - name of fits image file
arg2 - Y/N for file cleaning

The wcs_setup.sh is called near the end of gwcs to construct an input file for various of WCS tasks.



The XY files: image1.XY and image2.XY

Recall that gwcs runs the ds9_2f code so that the user can view the image being calibrated (Image1) in the left-hand frame (#1) and the DSS image of the same field (Image2) in the right-hand frame (#2). In the very simplest mode of operation, which gwcs was desigend for, the use may have no source of catalogued astrometric positions. We may have to simply identify matching stars (or targets) in the two frames, and then use the WCS of the DSS image itself to predict Ra,Dec for these sources. We must also gather the X,Y of the sources in Image1 (these are what we wish to convert!). Hence, at the base level, the first job of gwcs is to produce files of the X,Y positions in each frame. After gwcs runs the ds9_2f script , two files are built for this purpose. These files, named img1.reg and img2.reg, are the region files dumped by a ds9 regions dump performed with xpa (specifically with the xpaget facility). To extract the X,Y locations of each reagion, we used the OTW code xyds9. The section of code in gwcs that does this is show here: # Use the xyds9.sh script (otw) to extract XY # from the two image regions files xyds9.sh img1.reg any any > image1.XY xyds9.sh img2.reg any any > image2.XY The image1.XY and image2.XY are simple ASCII lists of the XY positions of the targets identified in each image frame of the ds9 gui. Finally, we must use the xy2sky script (wcstools) to convert the image2.XY coordinates to Ra,Dec on the sky: # Produce RA,DEC values from DSS image using xy2sky xy2sky dss.fits @image2.XY > image2.RaDec



The Ra,Dec file: image2.RaDec_degrees

Using the wcstools facility xy2sky (shown above) we convert the DSS X,Y values, viw the DSS image WCS in the header, to Ra,Dec positions in the sky. These Ra,Dec are written in sexigecimal format. For various downstream tasks, we desire Ra,Dec in floating point format in units of dgerees. For this we use the python script rd_degs_list.py to create the file "image2.RaDec_degrees". Finally, the file image2.RaDec_degrees is our third input to the wcs_setup script. Using the Ra,Dec in this file, we can now combine the 3 input files to create a file for our WCS codes that lists, for each star:

 
Star_name
X_pixels  Y_pixels,  RA_degrees  DEC_degrees
The output file always named: wcs_setup.out, and just for completeness we show an example of a wcs_setup.out file here:
 

% cat wcs_setup.out
{1}                           
     729.000      556.000   190.505569458   41.001049042
{2}                           
     666.000      795.000   190.535110474   41.090896606
{3}                           
     403.000      691.000   190.665115356   41.050914764
{4}                           
     866.000     1538.000   190.432510376   41.369430542
{5}                           
    1483.000     1494.000   190.123840332   41.351387024
{6}                           
    1469.000     1320.000   190.130340576   41.286621094
{7}                           
     979.000     1394.000   190.377288818   41.314800262




Back to SCO CODES page