Apply wavdetect to locate sources

This is applied to a 2n portion of the image because FFTs are involved. Wavdetect may take 1 CPU hour of Ultra 60 time for a 512x512 region. We have found that wavdetect performs impressively in locating sources with nearly-uniform sensitivity across the ACIS-I field and without producing spurious ghost sources around off-axis sources. We have not evaluated its performance on extended structures, though it definitely can find compact sources within diffuse emission.

The scellfile image plots the source positions with integer values increasing with right ascension. The imagefile is more interesting, with sources plotted with values scaled to intensity and size scaled to wavelet scale. The defnbkgfile shows the background variations not included in the wavlet sources, shown as little circles. These can all be examined using ds9. The outfile is a FITS table file giving many parameters associated with each source. It can be examined using fv or fdump, and is used in later analyis.
Note 1. For unknown reason, the command has failed unless all output files are explicitly defined.
Note 2. Three variations on the parameters have been used within the ACIS Team. First, we generally follow the recommendation of the CIAO manual to increase the density of wavelet scales as follows (excerpt from the wavdetect parameter file): Of course, even larger scales are needed to locate and model diffuse features. Second, sometimes wavdetect is run on two or three bands separately (e.g. 0.5-2 keV, 2-8 keV) and sometime on a unified band. No quantitative study of the efficacy has been made. Third, the detection threshold has been run at 10^-5, 10^-6 and 10^-7 in different circumstances. Recall that is it wise to make a local copy of the wavdetect.par parameter file if parameters are changed, so that future runs are not affected.
Note 3. Wavdetect is remarkably successful in discovering pointlike sources in a sensitive and uniform fashion across the ACIS-I field. It does not divide strong off-axis sources into multiple sources, as celldetect does. Nonetheless, occasional failures occur and the scientist must check the results visually. The following problems are noted by E. Feigelson from study of the Orion Nebula field with ~1000 sources having stellar identifications. False negatives include: missing some sources if they lie within 2.5" of another (particularly brighter) source; missing some sources around its sensitivity limit. False positives include: detecting spurious sources on the readout trails of bright sources; and detecting noise, particularly off-axis when the detection threshold is set below 10-6.
This last problem deserves some discussion. The faint spurious sources located with wdetect are characterized by wrecon to have virtually no source counts; e.g. NET_COUNTS + background = 2 or 3 events when the overall source limit is ~7 counts. Examination shows this can happen under three circumstances: the background map has unusually high values (>1 count); there is a chance nearby void in the distribution of background events; or when the photons are distributed over an extremely large area (NPIXSOU > 200). False positive detection may improve when the option of a constant, rather than variable, background map is implemented.
Note 4: The "exposure map" in units s*cm2 map (recall this is map produced by mkexpmap times the CCD-dependent EXPOSUR? time in the header; see the exposure Recipe page) may be passed to wavdetect under the "expfile" parameter, so that the NET_RATE column of the wavdetect source catalog has units events/s/cm2 (despite the fact that the TUNIT keyword of that column is "count/s").
Note 5: The wavdetect output unfortunately does not state which sources where detected at which spatial scales. However, we believe one can infer this from the parameter NPIXSOU in the Region_wav_srclst.fits file. NPIXSOU values around 10-20 are typical for unresolved sources near the field center, while values can rise to 102-103 for large extended features.
Note 6: Beware running more than one wavdetect simultaneously on the same event file, even if they run on different CPUs. Bad interactions can ensue.
Note 7: There appears to be a bug in wrecon: if one runs the program with very large wavelet scales to find diffuse structures, the reconstructed image frequently shows truncated large wavelets which produce oddly shaped arclike structure that are clearly spurious.

---ooo---

To apply wavdetect to an entire chip or array, T. Maeda has written a Perl script Large_detect.pl to automatically conduct a series of 1024x1024 wavdetect runs that scan across a chip or any array of chips, producing a consolidated source list. It also runs celldetect across the array, though we do not recommend using celldetect results. The command is:

where input.evt is the input event list, outroot is used in the names of output files, and binfactor is the pixel binning used by the detect programs (usually = 1). The user may reset the parameter $imgsize setting the size of regions for each run of wavdetect. It is currently set at 1024 and must be a power of 2. The parameter $margin, currently set at 128, may also be changed. It causes adjacent wavdetect segments to overlap so sources are not missed at the edges. (Duplicate sources from overlapping regions are removed later in the script.) The output file of interest is the merged wavelet source list with source characteristics: Many other files are produced, and it is recommended this be run in a separate directory. This program typically takes >10 CPU hours to run on a Sun Ultra 60 workstation for the ACIS-I array.
Note 1: This program has occasionally crashed with error messages from celldetect about a missing PSF file. Cause and cure are unknown.
Note 2: The off-axis point-spread function seems to be too wide to find with the standard scale of 1-16 and the 1 bin size. Hence, it may be wise to run it separately with binsize=1 near-axis and binsize=4 far off-axis.
Note 3: The background level between FI and BI could be very different, and it is recommended to run wavdetect separately for these types of chips.