Improving The World Coordinate System

If necessary, Fixing the Default WCS

MOSAIC images obtained at NOAO generally have a default WCS (World Coordinate System) loaded into their header at the time the image is transfered from the instrument computer to the data reduction computer. At the same time the nominal telescope pointing (as accurate as the initial zero-pointing of the telescope and subsequent offsets allows) is loaded into the FITS header keywords TELRA, TELDEC, and TELEQUIN. If this information has been transfered to the image headers properly you should be able to generate an improved astrometric solution using the USNO-A2 (or GSC2) catalogue of object positions (other catalogues with accurate positions can in principle be used). If you suspect that there is a problem with the higher order terms of the WCS solution loaded into your images and your data were obtained using the NOAO MOSAIC cameras, then you can restore the default version of the WCS using the IRAF command mscsetwcs (More help on using this task will be provided on this page in the next edition of these notes). You will have to know the pathname to the correct data file. There should be a separate file for each filter used with a particular Mosaic camera and filter combination. If there is not a file for the filter you used, pick one of the standard filters that has a similar central wavelength.

You can see what files are available at the following link: Calibration Files For the Mosaic Imagers.

Here is an example of the parameter file for mscsetwcs with the parameters set to restore the header for a KPNO 4m MOSAIC-1 I-band image:



PACKAGE = mscred
   TASK = mscsetwcs

images  =          obj033.fits  Mosaic images
database=     Ik1005_981010.db  WCS database
(ra     =                telra) Right ascension keyword (hours)
(dec    =               teldec) Declination keyword (degrees)
(equinox=             telequin) Epoch keyword (years)
(ra_offs=                   0.) RA offset (arcsec)
(dec_off=                   0.) Dec offset (arcsec)
(extlist=                     )
(mode   =                   ql)

Correcting the Astrometric Solution using MSCCMATCH

While your images obtained with the NOAO MOSAIC cameras will have a default WCS loaded into the header that maps pixel space onto RA and DEC, the correction that is loaded, while a good start, will not take into account several effects that might cause the proper mapping to differ from the default. Example of causes of possible differences include differential atmospheric refraction or differences in the rotation of the instrument from the position of the instrument during the run used for the astrometric calibration. To improve your solution you will want to use the task msccmatch. As input for this task you need a list (for each target field) of at least a couple hundred stars for which you have accurate positions or you need to have msccmatch call mscgetcat to produce the list of input stars for you. A subset of this same list can potentially be used for the task mscimatch later in the reduction process and, if from a photometrically calibrated set of stars, can provide a first estimate of the photometric zeropoint for the frame.

For the NDWFS, we began using the USNO A2.0 catalogue (Monet et al.), obtained via the CCS (Central Computing Services) "catalogues" Web interface which is accessed using mscgetcat and will complete the reduction of our survey images using this as our reference. You can now also choose the GSC2.0 catalogue from mscgetcat. Since the field of view of the MOSAIC is roughly 36'x36' and we offset a few arcminutes during our dither pattern, we extract a listing of stars within a 20' radius of the nominal pointing of our first exposure in the dither pattern. The task mscgetcat may be used to construct the file or msccmatch can be instructed to call mscgetcat on its own. Note that if this later option is used you must still specify the magnitude range for the stars that will be extracted from the USNO A2 catalogue. For msccmatch to work properly the magnitude range of the stars should exclude saturated stars and stars too faint to be clearly above sky. For our 10 to 14 minute exposures in our Bw, R, and I-band images we generally use stars between 12.5 and 19.0 (both cut-offs depend on the band and sky brightness at the time of the exposure) in the Red magnitude of the USNO A2 catalogue. Later in the reduction process, when running mscimatch, we will need an input list of fainter stars (in the example a of our 10 to 14 minute R and I-band images, the range would be fainter than 17.5 to about 21 or 22) that are suitable for the determination of the relative flux scaling between the images in a dither sequence. One could grab the subset of the USNO catalogue for a particular field once, and then edit the file to construct appropriate subsets. Also note that including the saturated stars in msccmatch is unlikely to be a problem if you make use use of bad-pixel masks that include flagging the saturated pixels.

Here are examples of parameter files for msccmatch and mscgetcat. In these examples we edited the parameters for mscgetcat, then ran msccmatch with that task calling mscgetcat. We generally run this task interactively, using the g, x, r, s, and y keys in the graphics display window to inspect the residuals, using d to delete points, and f to generate a new fit. We generally obtain fits with rms residuals less than 0.4".




PACKAGE = mscred
   TASK = mscgetcatalog

input   =                       List of Mosaic files
output  =                       Output file of sources
(magmin =                   9.) Minimum magnitude
(magmax =                 17.5) Maximum magnitude
(catalog=         NOAO:USNO-A2) Catalog
(rmin   =                  21.) Minimum radius (arcmin)
(mode   =                   ql)



PACKAGE = mscred
   TASK = msccmatch

input   =       obj111pfs.fits  List of input mosaic exposures
coords  =     !mscgetcat $I $C  Coordinate file (ra/dec)
(outcoor=                     ) List of updated coordinate files
(usebpm =                  yes) Use bad pixel mask?
(nsearch=                   60) Maximum number of positions to use in search
(search =                  60.) Translation search radius (arcsec)
(rsearch=                  0.2) Rotation search radius (deg)
(nfit   =                   50) Min for fit (>0) or max not found (<=0)
(rms    =                  0.5) Maximum fit RMS to accept (arcsec)
(maxshif=                  3.5) Maximum centering shift (arcsec)
(fitgeom=              general) Fitting geometry
(reject =                   3.) Fitting rejection limit (sigma)
(update =                  yes) Update coordinate systems?
(interac=                  yes) Interactive?
(fit    =                  yes) Interactive fitting?
(verbose=                  yes) Verbose?
(listcoo=                  yes) List centered coordinates in verbose mode?
(graphic=             stdgraph) Graphics device
(cursor =                     ) Graphics cursor
accept  =                   no  Accept solution?
(mode   =                   ql)


Here are some example plots. The first one illustrates the spatial coverage of your data (hitting the g key). The second one shows an x-fit (x key), and the third illustrates outlier points having been deleted (d key) and then refit (f key) to generate a fit with an rms residual of less than .4".

Note that the current version of msccmatch, with the parameters specified as above, can handle initial translational offset errors as large as 60 arcseconds. If search= were set to a larger value it might handle even larger offsets. In general, however, if it can not converge to a solution you might want to use mscdisplay and msctvmark to check both your input catalogue and the initial WCS for major errors.

If msccmatch returns a :"Warning: Automatic search failed" for any particular image or field, several things could have gone wrong. The RA and DEC in the header might be in error (major problem with telescope pointing and/or population of the headers at the telescope). Sometimes just expanding your search/translation radius can solve your problem -- but pointing errors of more than about 60 arcseconds will not be fixed in this manner. You will need to identify the field and make an initial correction to the WCS using mscsetwcs, but instead of using the header keywords to read the RA and DEC into the task, explicitly enter the new RA and DEC.

The tasks mscgetcat and msctvmark can help. Use the first to get a catalogue over the region of the sky you think should include the image. Then use msctvmark to overlay the catalog positions on top of the image in the image display.


>epar mscgetcat 

PACKAGE = mscred
   TASK = mscgetcatalog

input = "obj111pfs.fits"    List of Mosaic files
output = "obj111pfs.usnoA2" Output file of sources
(magmin = 17.)              Minimum magnitude
(magmax = 22.)              Maximum magnitude
(catalog = "NOAO:USNO-A2")  Catalog
(rmin = 21.)                Minimum radius (arcmin)
(mode = "ql")           

>mscdisplay obj111pfs.fits 1
 
>epar msctvmark

PACKAGE = mscred
   TASK = msctvmark

coords = "obj111pfs.usnoA2"    List of coordinates
frame = 1                      Display frame
(output = "")                  Output file of pixel coordinates and labels
(fields = "1,2,3")             Fields for RA, DEC, and ID
(wcs = "world")                Coordinate type (logical|physical|world)
(mark = "circle")              Mark type
(radii = "10")                 Radii of concentric circles
(lengths = "0")                Lengths and width of concentric rectangles
(font = "raster")              Default font
(color = 204)                  Gray level of marks to be drawn
(label = no)                   Label the marked coordinates
(nxoffset = 0)                 X offset in display pixels of number
(nyoffset = 0)                 Y offset in display pixels of number
(pointsize = 3)                Size of mark type point in display pixels
(txsize = 1)                   Size of text and numbers in font units
(mode = "q")            
If you can't see a pattern, try increasing the magnitude range and get another catalog with mscgetcat. This will give you more stars for comparison. If you still can't match the catalogue to the field, try increasing the search radius on both mscgetcat and msccmatch (but be careful -- if your magnitude range of stars in the catalogue does not match what is in the image, you can get matches of faint catalogue stars to "noise" in your image -- or if your translation search radius is too large you will find many false matches.

If you can see a pattern, another option of adjusting the WCS, other than mscsetwcs, is msczero to adjust the WCS of the image.


PACKAGE = mscred
   TASK = msczero

input = "obj111pfs.fits"     List of mosaic exposures
coords = "obj111pfs.usnoA2"  List of coordinates
radii = "10"                 Radii of concentric circles
color = 204                  Gray level of marks to be drawn
label = no                   Label the marked coordinates
ra =                         RA (hours)
dec =                        DEC (degrees)
id =                         Identification
mag =                        Magnitude limit
update = yes                 Update WCS zero point?
updcoord = yes               Update coordinate file?
(extname = "")               Extension name pattern
(nframes = 2)                Number of frames to use
(cbox = 11)                  Centering box size (see imcntr)
(mark = yes)                 Mark display?
(logfile = "default")        Log file for measurements\n\n# MSCTVMARK Parame
(fields = "1,2,3")           Fields for RA, DEC, and ID
(wcs = "world")              Coordinate type (logical|physical|world)
(mtype = "circle")           Mark type
(nxoffset = 20)              X offset in display pixels of number
(nyoffset = 0)               Y offset in display pixels of number
(pointsize = 3)              Size of mark type point in display pixels
(txsize = 2)                 Size of text and numbers in font units
(fd1 = "")             
(fd2 = "uparm$mscdisp1") 
(mode = "ql")           

When your image is displayed, hit an m in the image to get it to overlay the catalog. Then hit an s on a red circle, and then a z on its corresponding star. Then hit another m to check the catalog overlay again. Hitting q will write your offset into your WCS. Now you'll need to re-run msccmatch which will read your updated WCS and retrieve the proper catalog and solve for an improved WCS.

In the next edition of these notes I will expand this discussion and include some example plots of the output of msccmatch.

Getting the WCS correct is critical to being able to stack/combine multiple images into a final combined image for your target field!