Use the WCS in a FITS image, or the raw Xcent,Ycent data, and the image_catalogs table for that FITS image to build a cdfp file. The table file provides the X,Y values (Xcent,Ycent). These values are used with the WCS in the FITS image header to compute Ra,Dec via the xy2sky routine. Everything is packed into the local file: ./basename.cdfp
Note that this routine searches fro the most-updated version of FITS image so that the most recent version of WCS is used to predicte Ra,Dec for the X,Y values. A very useful tool for finding this "best" image is best_wcs_image.
% best_wcs_image /home/mcs/sco/tmp2/local_red/FIXUP/20191027T013204.9_acm_sci.fits N % cat best_wcs_image.out ./local_red/VISCAT/20191027T013204.9_acm_sci.fits % cdfp_from_imgcat0_markII ./local_red/VISCAT/20191027T013204.9_acm_sci.fits RD N Usage: cdfp_from_imgcat0_markII 20170420T101656.1_acm_sci.fits RD N arg1 = name of FITS image run through image_catalogs arg2 = Use Xcent,Ycent (XY) or Ra,Dec (RD) for basic coordinates (XY,RD): arg3 = run in debug mode? (Y/N) NOTE: It is assumed that this routine is run in the directory containing ./local_red and that the image_catalogs file has already be run. In the example here we would see: ./20191027T013204.9_acm_sci.cdfpThere is an earlier version of this code named "cdfp_from_imgcat0", but this upgraded routine uses some higher level table routines that make file assembly easier and more general.
Initially this code was setup only to use Ra,Dec values, but I altered this to enable the use of Xcent,Ycent. The reasone for the XY vs. RD choice is that sometimes we'll not have an image with WCS installed in the header, or sometimes worse, an incorrect WCS in the header. In such a case we may still wish to have a cdfp file (althought the Ra,Dec will be set to 0.0). For example, we may want to make a cdfp with cdtype=XY", then make a ds9 regions file that use these X,Y positions:
% cat extra.quantities NumPix % cdfp2reg.sh 20170420T101656.1_acm_sci.fits 5.0 cyan Xcent YcentIn this case, the "extra_quantities" files will indicate that we wish to have the radius of each detection be based of the number of pixles (NumPix) in each source. The positions of each source will be set in image coordinates based on the X,Y centroids in the catalog for the input image. In this way we can create a regions to inspect our image_catalog results without waiting for the WCS image to be created downstream in the reduction process.