procedure hdf_wcs_fix (pc1,wf2,wf3,wf4,wcsup) # Update WCS in HDF version 2 release images to match the # coordinate system (RA, Dec) used for the HDF catalog published # in Williams et al. 1996, AJ 112, 1335. # # M. Dickinson, 30 Oct. 1996 # requires that the 'proto' package be loaded. string pc1 {prompt="HDF v2 PC1 image(s) for WCS correction"} string wf2 {prompt="HDF v2 WF2 image(s) for WCS correction"} string wf3 {prompt="HDF v2 WF3 image(s) for WCS correction"} string wf4 {prompt="HDF v2 WF4 image(s) for WCS correction"} bool wcsup {yes,prompt="Update RA, Dec zeropoint to match HDF v2 catalog?"} struct *fread begin string pc1im, wf2im, wf3im, wf4im string tempfile, image bool dowcsup print (" ") print ("This program will modify the world coordinate system (WCS)") print ("in the image headers of the selected files. These images") print ("MUST be the HDF version 2 drizzled images as obtained from") print ("STScI, or at least must have the same pixel coordinates and") print ("orientations as those STScI version 2 release images.") print (" ") # Get query parameters pc1im = pc1 wf2im = wf2 wf3im = wf3 wf4im = wf4 dowcsup = wcsup # Correct PC1 images tempfile = mktemp("tmp$hdfwcsfix") sections (pc1im,option="fullname",>tempfile) fread = tempfile while (fscan(fread,image) != EOF) { hedit (image,"CTYPE1","RA---TAN",add+,ver-,up+,show+) hedit (image,"CTYPE2","DEC--TAN",add+,ver-,up+,show+) if (dowcsup) { wcsedit (image,"crval","189.18491442038","1","", wcs="world",inter-,verbose+,up+) wcsedit (image,"crval","62.219760477133","2","", wcs="world",inter-,verbose+,up+) } } delete (tempfile,ver-) # Correct WF2 images tempfile = mktemp("tmp$hdfwcsfix") sections (wf2im,option="fullname",>tempfile) fread = tempfile while (fscan(fread,image) != EOF) { hedit (image,"CTYPE1","RA---TAN",add+,ver-,up+,show+) hedit (image,"CTYPE2","DEC--TAN",add+,ver-,up+,show+) if (dowcsup) { wcsedit (image,"crval","189.21043170410","1","", wcs="world",inter-,verbose+,up+) wcsedit (image,"crval","62.231066368033","2","", wcs="world",inter-,verbose+,up+) } } delete (tempfile,ver-) # Correct WF3 images tempfile = mktemp("tmp$hdfwcsfix") sections (wf3im,option="fullname",>tempfile) fread = tempfile while (fscan(fread,image) != EOF) { hedit (image,"CTYPE1","RA---TAN",add+,ver-,up+,show+) hedit (image,"CTYPE2","DEC--TAN",add+,ver-,up+,show+) if (dowcsup) { wcsedit (image,"crval","189.22912064331","1","", wcs="world",inter-,verbose+,up+) wcsedit (image,"crval","62.212189763997","2","", wcs="world",inter-,verbose+,up+) } } delete (tempfile,ver-) # Correct WF4 images tempfile = mktemp("tmp$hdfwcsfix") sections (wf4im,option="fullname",>tempfile) fread = tempfile while (fscan(fread,image) != EOF) { hedit (image,"CTYPE1","RA---TAN",add+,ver-,up+,show+) hedit (image,"CTYPE2","DEC--TAN",add+,ver-,up+,show+) if (dowcsup) { wcsedit (image,"crval","189.18661365727","1","", wcs="world",inter-,verbose+,up+) wcsedit (image,"crval","62.203675138200","2","", wcs="world",inter-,verbose+,up+) } } delete (tempfile,ver-) fread = "" end