Create both a ds9 regions file and a cdfp file based on the contents of an image source catalog from built with image_catalogs. In this verison, unlike the related routine name photom2_prep, we use only the X,Y (centroids Xcent,Ycent) to build the files. Hence, no Ra,Dec will be bresent in the cdfp, but these files can be constructed whether or not the image contains a valid WCS in the header.
% reg_from_imgcat --help usage: reg_from_imgcat a.fits [-v] [-h] [-n NumPixMin] [-far ApRadPix] [-fmin MinApPix] Additional options: -v = print verbose comments and run in debug mode -h = show a help file and then exit -n = minimum (integer) number of pixels for imgcat0 sources -far = fixed aperture radius in pixel units (can be "none") -fmin = minimum allowed fixed aperture radius in pixel units (can be "none") EXAMPLES: # All sources have apertures scaled to NumPix % reg_from_imgcat 20191018T024545.3_acm_sci.fits # Same as above, but a minimum of radius=6.0 is imposed % reg_from_imgcat 20191018T024545.3_acm_sci.fits -fmin 6.0This routine was established after I relaized that we will frequently want to perform an early profile analysis of bright objects on images (acm) that have useful WCS in the image headers. By using the -n and =far command options above we can control the size of the objects selected and the maximum size of of the aperture to bee used for profile calculation and/or aperture photometry.
In June2020 I modified the cdfp2reg routine so that a MINIMUM aperture size can be specified for the basename.cdfp.reg file and its associated regions files. By following the cdfp2reg links just shown you can view a nice figure that demonstrates this capability.
This routine is related to the photom2_prep in that its primaray role is to provide a way of visualizing and using the sources in an image detected with image_catalogs.
![]() |
Here is an example that demonstrates how we can change aperture
sizes as well as the objects selected to have apertures.
To see the whole thing, eben with tiny apertures: ds9_open 1000 1000; ds9_view /home/sco/AUTO_match_for_wcs/S/20191018T024545.3_acm_sci.fits zscale n 1 reg_from_imgcat /home/sco/AUTO_match_for_wcs/S/20191018T024545.3_acm_sci.fits cat 20191018T024545.3_acm_sci.cdfp.reg | xpaset ds9 regions -format ds9 Remove the small stuff ds9_open 1000 1000; ds9_view /home/sco/AUTO_match_for_wcs/S/20191018T024545.3_acm_sci.fits zscale n 2 reg_from_imgcat /home/sco/AUTO_match_for_wcs/S/20191018T024545.3_acm_sci.fits -n 8 cat 20191018T024545.3_acm_sci_apertures.cdfp.reg | xpaset ds9 regions -format ds9 Remove the small stuff and have minimum allowed aperture be 4pix ds9_open 1000 1000; ds9_view /home/sco/AUTO_match_for_wcs/S/20191018T024545.3_acm_sci.fits zscale n 3 reg_from_imgcat /home/sco/AUTO_match_for_wcs/S/20191018T024545.3_acm_sci.fits -mia 4.0 -n 8 cat 20191018T024545.3_acm_sci_apertures.cdfp.reg | xpaset ds9 regions -format ds9 Remove the small stuff with Nmin=3 and have minimum allowed aperture be 12pix ds9_open 1000 1000; ds9_view /home/sco/AUTO_match_for_wcs/S/20191018T024545.3_acm_sci.fits zscale n 4 reg_from_imgcat /home/sco/AUTO_match_for_wcs/S/20191018T024545.3_acm_sci.fits -mia 12.0 -n 3 cat 20191018T024545.3_acm_sci_apertures.cdfp.reg | xpaset ds9 regions -format ds9Basically, any use of the options shows up in the *_apertures.cdfp.reg version of the regions file. Tsename.cdfp.reg file will always have the full number of sources in the catalog. However, the one exception is the "-mia" flag. If we request that the minumum aperture be 12 pixels, then both region filese will impose this rule: both region sets will have the smallest aperture have a radius of 12 pixels. |