How to align radio images with HST data (when you have no common point sources). Kristy Dyer kdyer@nrao.edu 7/1/99 Get HST data from http://cadcwww.hia.nrc.ca if possible. They do extremely good image re-processing. If you cannot get it from there, then get the data from http://archive.stsci.edu. Both sites require an account name and password which takes 1-2 days. You can get a fits file with the mosaiced image (all four chips) from the preview image without a password. If you get the single chips you should mosaic them in iraf since there might not be enough stars on a single chip to get a good solution. Read the fits image into AIPS and edit the header using PUTH. I named it HST.FULL.1 in this example. CDELT1 and CDELT2 should be 1.1111e-5 (0.04" in deg) for the Planetary Camera and 2.7778e-5 (0.1" in deg) for the Wide Field chip or a mosaiced image. CROTA1 should be zero. EQUINOX should be 2000. Your header should look something like this: AIPS 1: Image=HST.FULL (MA) Filename=HST .FULL . 1 AIPS 1: Telescope= Receiver=WFPC2 AIPS 1: Observer= User #= 2150 AIPS 1: Observ. date=12-APR-1997 Map date=25-JUN-1999 AIPS 1: Minimum=-6.71739502E+02 Maximum= 3.65440156E+04 AIPS 1: ---------------------------------------------------------------- AIPS 1: Type Pixels Coord value at Pixel Coord incr Rotat AIPS 1: RA 1600 10 21 33.600 577.79 -0.100008 0.00 AIPS 1: DEC 1600 -58 05 45.600 999.85 0.100008 -0.81 AIPS 1: ---------------------------------------------------------------- AIPS 1: Coordinate equinox 2000.00 Rotate the image to as close to north-up as possible. It helps to have a published optical image with the north-east arrows on it. We suspect XTRAN works better if it does not have to rotate very much. Make a half-size image to use as a finding chart using LGEOM with aparm(4)=0.5 I called this HST.HALF.1 in this example. Go to http:\\www.nofs.navy.mil and then to Data & Software. Choose "All the Options" Fill in - Field Name: Catalogue: UA - USNO + ACT RA: DEC: Width of field: File Format: AS-Ascii then Retrieve Print out the postscript plot and copy the list of stars to a text file named USNO.STARS in the FITS area. Use the following gawk file to put the list in XTRAN format: ## mpr.gawk -- converts USNO-A2.0 stars into XTRAN format ## (NF>0) { i=i+1 ; printf "%4s %6.2f %6.2f %02d %02d %05.2f %03d %02d %04.1f\n", i, 666.66, 666.66, $1,$2,$3,$4,$5,$6; } use it at the unix command prompt like this: gawk -f mpr.gawk < USNO.STARS > XTRAN.STARS1 Do not change this format at all -- an extra decimal place will cause XTRAN to screw up -- without any error messages! This will number your stars. Now you have to figure out which stars are which using the USNO star chart and your image. The USNO chart is not plotted on the same coordinate grid but between the image you are going to make and the USNO star chart you should be able to figure out which star is which. Now run a gawk file to change the XTRAN format into a STAR format: ## make a star file for AIPS ## (NF>0) { print $4,$5,$6,$7,$8,$9,1,1,0,1,$1; } with the unix command: gawk -f star.gawk < XTRAN.STARS1 > STAR1 Run STARS in AIPS to bring in the position of the stars into a table on your half-size image AIPS 1: STARS: Task to generate an ST ext. file with star positions * AIPS 1: Adverbs Values Comments AIPS 1: ---------------------------------------------------------------- AIPS 1: USERID 0 User ID. 0 => current user AIPS 1: 32000 => any user. AIPS 1: INNAME 'HST ' Image name(name). AIPS 1: INCLASS 'HALF ' Image name(class). AIPS 1: INSEQ 1 Image name(seq. #). 0=>high AIPS 1: INDISK 4 Disk drive #. 0=>any AIPS 1: OUTVERS 0 STar file version number. AIPS 1: INFILE 'FITS:STAR1 File with star positions AIPS 1: AIPS 1: ' AIPS 1: X 0 Input Star Coordinate epoch AIPS 1: 1: 1900; 2: B1950; 3: J2000 AIPS 1: 4: Galactic; 5: OHLSSON Gal. AIPS 1: 6: VAN TULDER Galactic AIPS 1: 7: Super Galactic; 0=> 3 AIPS 1: Y 0 Output Star Coordinate epoch Run GREYS on the half-size image with AIPS 1: INVERS 1 STar file version number. AIPS 1: STFACTOR -1 Scale star sizes: 0 => none. This will create a plot with your labeled stars NEAR the real star positions. Print this out and use it to find your way through the stars. Get your full HST image (HST.FULL.1). Set txinc 2, tyinc 2 so that it will fit on the tv. Load the image. Now use TVWIN and JMFIT (with DOWIDTH=-1) to get the x and y position of your stars -- cut and paste them into the XTRAN file replacing "666.66 666.66". If a star shows clear diffraction spikes use IMPOS to place the cursor where the spikes cross, rather than using JMFIT. Now enter a guess for the RA and DEC at the center of your image into the XTRAN.STARS1 file on the first line. I used IMPOS and clicked near the center. This must be lined up with the other RAs and DECs. XTRAN.STARS1 should look like this: 10 21 30.54 -58 06 01.9 5 1437.1 468.52 10 21 22.04 -58 06 25.5 6 1504.4 1247.8 10 21 22.59 -58 05 08.5 7 1322.0 060.86 10 21 22.78 -58 07 07.8 9 1440.4 996.99 10 21 22.91 -58 05 33.6 10 1382.7 750.33 10 21 23.16 -58 05 58.5 The first number is the star labels. After you have finished transferring all the x and y coordinates to the correct star in XTRAN.STAR1 run XTRAN AIPS 1: XTRAN: Task to create an image with transformed coordinates AIPS 1: Adverbs Values Comments AIPS 1: ---------------------------------------------------------------- AIPS 1: USERID 0 User ID. 0=>current user AIPS 1: 32000=>all users AIPS 1: INNAME 'HST ' Input image name. blank=>any AIPS 1: INCLASS 'FULL ' Input name(class). blank=>any AIPS 1: INSEQ 1 Input name(seq. #). 0=>any AIPS 1: INDISK 1 Input disk drive #. 0=>any AIPS 1: OUTNAME ' ' Output name(name). AIPS 1: blank=>INNAME AIPS 1: OUTCLASS ' ' Output name(class). AIPS 1: blank=>INCLASS AIPS 1: OUTSEQ 0 Output name(seq. #). AIPS 1: 0=>lowest unique AIPS 1: OUTDISK 4 Output image disk drive # AIPS 1: 0 => highest with space AIPS 1: BLC *all 0 Bottom left corner of input AIPS 1: TRC *all 0 Top right corner of input AIPS 1: DOGRIDCR 1 Find x,y to RA,Dec transform. AIPS 1: (1 => True). AIPS 1: NPOINTS 3 Number of parameters to fit. AIPS 1: (Only 3 or 6 allowed) AIPS 1: DOALIGN -1 Transform coordinates AIPS 1: (1 => True). AIPS 1: ROTATE 0 Angle (degrees) to rotate CCW AIPS 1: SHIFT 0 0 Fractional pixel offsets AIPS 1: FACTOR 0 Expansion factor (0 => 1) AIPS 1: INFILE 'FITS:XTRAN.STAR1 File with star positions. AIPS 1: AIPS 1: ' This will put out something like: XTRAN1 ZTXOP2: /DATA/JEMEZ_1/FITS/PCSTAR XTRAN1 Fit and residuals from the calibration: XTRAN1 Name X X Resid Y Y Resid XTRAN1 (deg) (secs) (deg) (secs) XTRAN1 4 155.3377 -2.50 -58.1145 -0.10 XTRAN1 5 155.3418 -0.11 -58.1071 -0.10 XTRAN1 6 155.3441 -0.01 -58.0855 0.58 XTRAN1 7 155.3447 -0.65 -58.1187 0.42 XTRAN1 Axis Coord value at pixel Coord incr Rotat XTRAN1 X 1.5537722D+02 8005.00 -0.1008 -9.464 XTRAN1 Y -5.8100314D+01 8005.00 0.0991 -9.464 XTRAN1 Appears to have ended successfully Throw out stars that are really big (burnt into the chip -- lots of diffraction spikes) and stars that wind up in between two really close binaries. Also throw out stars that have large residuals -- nearby stars can have large proper motions that show up as shifts in position between the plate observations used to make the USNO list and your HST observations. You want to be left with tens of stars to fit to. Copy XTRAN.STAR1 to XTRAN.STAR2 removing the worst star each time until you are satisfied with the residuals. Now run XTRAN with both DOGRIDCR 1 and DOALIGN 1 This will create an output file called HST.XTRAN.1 which is supposed to have corrected the output image. Run star.gawk on your latest list USNO.STARS# and run STARS to bring in your good stars on the HST.XTRAN.1 map and GREYS to see if they show up where you expect them. If for some reason you get good residuals, but the stars are in the wrong places on the XTRAN image, you can use puthead to fix the header information in the original image. XTRAN puts out: XTRAN1 Axis Coord value at pixel Coord incr Rotat XTRAN1 X 1.5537722D+02 8005.00 -0.1008 -9.464 XTRAN1 Y -5.8100314D+01 8005.00 0.0991 -9.464 XTRAN1 Create R22.PCALL .XTRAN . 2 (MA) on disk 1 cno 74 in this example you would: set CRVAL1 to 1.5537722D+02 (separate into two fields to retain precision) set CRVAL2 to -5.8100314D+01 (see above, watch the sign in the second field) set CRPIX1 to 800.5 set CRPIX2 to 800.5 set CROTA1 to 0 set CROTA2 to -9.464 set CDELT1 to -0.1008 set CDELT2 to 0.0991 One way or the other this should get the circles indicating the location of the stars on top of the stars. Read Eric W. Deutsch's paper "Empirical Uncertainty Estimators for Astrometry from Digital Databases" to get a feel for the overall errors in this method. You can now use LGEOM to straighten the image to north with: aparm(3)=-(-9.464) (number is from the above XTRAN output) You can run XTRAN iteratively if you like, using TVWIN and JMFIT on HST.XTRAN.1 to get new x and y coordinates for the stars, and solving again. You can also set NPOINTS to 6 in XTRAN -- this allows it to skew the images as well as shift and rotate it. NPOINTS 6 requires more stars to get a solution. If NPOINTS 3 is working you probably don't need NPOINTS 6. THE END