The Neil Gehrels Swift Observatory

Source Detection for Low-Counts UVOT Images

Overview:

Detecting sources with "uvotdetect" can give wrong results if the input UVOT sky image has few source counts. This thread gives two simple workarounds.

Read this thread if: You are running UVOT source detection on sky images with few source counts.

Last update: March 29, 2013

1. Background Information:

The UVOT source detection FTOOLS "uvotdetect" is a wrapper that internally calls "SExtractor" (Bertin & Arnouts 1996, AApS, 117, 393) to build a catalog of candidate sources. Most of SExtractor's configuration parameters can be specified by the user in a "sexfile" (*.sex) parameter file. The special value "sexfile=DEFAULT" tells uvotdetect to use a default set of parameters that depend on the details of the input image. See the SExtractor and uvotdetect help files for more info:

http://www.astromatic.net/software/sextractor
http://heasarc.gsfc.nasa.gov/ftools/caldb/help/uvotdetect.html

SExtractor was originally developed to reduce large-scale optical survey data with high photon statistics. As a consequence, it can fail and give false source detections if the total number of counts in a sky image is low. When UVOT sky images are created, those few counts are redistributed (fractionally) across pixels. When uvotdetect is run, it performs prep work then hands the image off to SExtractor which does the real work of detecting sources. SExtractor is having difficulties with the low count rate images which have been resampled, and gives wrong output.

Example: While uvotdetect runs fine on the UVOT optical images (v, b, u filters) of OBSID 00035763001, it fails on the UV images (uvw1, uvm2, uvw2 filters) due to the low number of total counts in the sky images:

$ uvotdetect plotsrc=yes infile=sw00035763001uw1_sk.img.gz+1 expfile=sw00035763001uw1_ex.img.gz threshold=5 outfile=uw1.fits

produces the sky image below with (false) source detections:

2.1. Work-Around 1:

The work-around is to pass SExtractor sky images with integer counts. UVOT sky images can be created such that the counts are not fractionally redistributed. This is done by running swiftxform with the parameter method=EVENTS. Once you have the low count rate sky image, you can invoke SExtractor directly. In order to run SExtractor, you need a configuration file. The simplest way to get an appropriate configuration file will be to run uvotdetect on the sky image with cleanup=no. This will leave a SExtractor configuration file named uvotdetect.*.sex in the working directory (along with other files to clean up). Keep/rename this file as you wish. If you choose the name my.sex, edit this file and set the CATALOG_NAME (the first parameter in the file) value to the name of the output table you want. Now you can run SExtractor. The (tweaked) SExtractor tool distributed with HEASoft is named uvotsex. You can invoke it by running:

$ uvotsex –c my.sex um2_e.img

Next, you can run uvotsource on the output source positions for photometry.

2.2 Work-Around 2:

An even simpler solution is to multiply the low-counts sky image with an integer number that is sufficiently large to increase the total number of counts:

$ ftcopy infile='sw00035763001uw1_sk.img.gz+1[pixi 4*x]' outfile=out.img copyall=no

where the imput sky image is multiplied by a factor of 4 and written into an output sky image.

$ uvotdetect plotsrc=yes clobber=yes infile=out.img expfile=NONE threshold=5 outfile=uw1.fits chatter=5 cleanup=no

which produces a clean source list (below). Vary the correction factor until you get plausible source detections. Next, you can run uvotsource on the output source positions for photometry. Don't forget to correct the magnitudes/fluxes for your correction factor.