Skip banner and navigation tools.

 |  site map

Skip sidebars of related page links.

Source detection and position determination

This thread assumes that the user has already run xrtpipeline to generate the required images.

Detecting sources

In some cases, the user may wish to determine whether a source is significantly detected at given coordinates. The simplest way to do this is to use XIMAGE, which includes a sliding-cell detection algorithm. Note that, by default, the signal-to-noise threshold is set to 2-sigma. In the example below (using GRB 091029), this is changed to 3-sigma.

>ximage
>read sw00374210000xpcw3posk.img
>cpd /xtk
>disp

cpd /xtk displays the image in a window which allows the user to zoom-in or out (using buttons to the right of the window, or the left and right mouse buttons respectively) and re-centre (by clicking the middle mouse button).

field of view
>detect/snr=3
 Calculating background: Poisson statistics assumed
          16  1.29515212E-02
          32  8.65078811E-03
          64  8.10858514E-03
         128  6.72658300E-03
 >>> Optimum box size = 128
 Background box size = 128
 Background =6.7266E-03 cts/original-pixel
            =6.7266E-03 cts/image-pixel
            =2.7709E-04 cts/sqarcmin/s
            =4.2771E-07 cts/original-pixel/s
 Source box size (orig pix):    8 (image pix):    8
 >>>>> Searching for excesses
    778 excesses found
 >>>>> Removing contiguous sources
 Using fast contiguous search
         63 excesses left
 >>>>> Sort by radius
 >>>>> Applying thresholds
  Using average energy for PSF:   1.00000000
  snr threshold =    3.0000000
  bgnd fluctuation probability limit =   9.99999975E-05
 >>>>> removing duplicates


#   count/s     err     pixel         Vig    RA(2000)    Dec(2000)    Err  H-Box
                        x      y      corr                            rad  (sec)
1  1.36E-03+/-3.7E-04   504.3  527.8  1.00   04 00 41.5  -55 58 28.8  -1    18
2  1.80E-01+/-4.0E-03   501.9  557.9  1.01   04 00 42.2  -55 57 17.8  -1    18
3  6.55E-03+/-7.7E-04   516.7  548.6  1.01   04 00 38.0  -55 57 39.9  -1    18
4  1.97E-03+/-4.4E-04   476.3  557.3  1.01   04 00 49.4  -55 57 19.3  -1    18
5  1.12E-03+/-3.4E-04   476.0  572.5  1.02   04 00 49.5  -55 56 43.5  -1    15
6  9.48E-04+/-3.1E-04   430.2  542.1  1.02   04 01 02.3  -55 57 55.1  -1    18
7  1.30E-03+/-3.7E-04   485.8  577.8  1.02   04 00 46.7  -55 56 30.9  -1    15
8  1.38E-03+/-3.7E-04   372.1  538.0  1.06   04 01 18.6  -55 58 04.5  -1    20
9  2.19E-03+/-4.5E-04   629.0  559.7  1.06   04 00 06.5  -55 57 13.3  -1    22
10 9.64E-04+/-3.2E-04   574.9  621.5  1.06   04 00 21.7  -55 54 48.0  -1    20
11 1.58E-03+/-3.9E-04   413.7  378.7  1.07   04 01 07.0  -56 04 20.1  -1    20
12 9.78E-04+/-3.2E-04   617.1  601.8  1.08   04 00 09.9  -55 55 34.3  -1    18
13 1.02E-03+/-3.4E-04   297.3  531.6  1.14   04 01 39.7  -55 58 19.1  -1    18
14 1.81E-03+/-4.5E-04   587.2  228.1  1.32   04 00 18.1  -56 10 15.2  -1    20
15 3.86E-03+/-6.4E-04   727.3  677.9  1.33   03 59 39.1  -55 52 34.0  -1    25

detected sources

All the detected sources will be marked with a number on the image as above. If one of the source is particularly bright, the detection algorithm may pick up additional "sources" in the wings of the PSF, as shown below in the zoomed-in version:

detected sources zoom

This can be circumvented by using the command detect/bright/snr=3, which merges the very nearby "detections". Note, however, that if there is a real nearby source, it will not be picked up. The output from running detect/bright/snr=3 is shown here:

bright PSF

The XIMAGE/detect algorithm is not infallible: sometimes a source will appear to be detected by eye, yet detect will not pick it up. In this case, the use of XIMAGE/sosta is recommended. sosta does not, however, determine a position of the source, whereas detect does.

sosta

Sosta (source statistics) uses a local background to determine the significance of a source and its count rate, rather than the global background estimate used by detect, so is typically more accurate. The user is prompted to select the position of the source, at which point the background, source counts, count rate and significance of the detection are calculated. Continuing from the previous example (so the image has already been read into XIMAGE and displayed - typing disp again will clear any source detection boxes if you wish to remove them, along with zoom/repositioning commands), then:

>sosta
 Using MAP1
 Using a locally computed background
 Select the center of source box (Right button exits)
                    X = 501.82715    Y = 557.56610
  Using average energy for PSF:   1.00000000
 Source half-box for 0.65 EEF is    5.2 pixels
        Half-box for 0.90 EEF is   18.1 pixels
 Total # of counts 1745.0000 (in 110 elemental sq pixels)
 Background inner radius:   19.0 pixels; outer radius:   36.1 pixels
 Innerbox counts 2438.0000 in 1444 sq or pixels
 Outerbox counts 2652.0000 in 5184 sq or pixels
 Background counts 214.00000 in 3740 sq pixels
 Background/elemental sq pixel :                5.722E-02 +/- 3.9E-03
 Background/elemental sq pixel/sec :            3.638E-06 +/- 2.5E-07

 Source counts :                                1.739E+03 +/- 4.2E+01
 s.c. corrected for PSF :                       3.013E+03 +/- 7.2E+01
 s.c. corrected for PSF + sampling dead time
                                + vignetting    3.043E+03 +/- 7.3E+01
 Source intensity :                             1.106E-01 +/- 2.7E-03 c/sec
 s.i. corrected for PSF                         1.916E-01 +/- 4.6E-03 c/sec
 s.i. corrected for PSF + sampling dead time
                                + vignetting -> 1.935E-01 +/- 4.6E-03 c/sec 
 Signal to Noise Ratio             :            4.162E+01

    Exposure time                 :      15727.125 s
    Vignetting correction         :      1.010
    Sampling dead time correction :      1.000
    PSF correction                :      1.733
    Optimum half box size is      : 20.500000 orig pixels
sosta

The red box-annulus shows the region from which the background rate was determined. The detection significance is given by the "Signal to Noise Ratio" line which, in this case, is 41.62. (For a source so obviously detected, sosta is not really required!) Note that the number of counts and intensity are not corrected for any loss of counts caused by the source position overlapping bad columns. This correction factor (see the exposure map and ARF threads for details on how to calculate this value) needs to be applied separately to determining the correct count rate.

Position determination

Below we explain how to determine the position of a source in the XRT field of view, using the Swift FTools. Alternatively, the best XRT positions for GRBs are available on the Enhanced Swift-XRT positions page. Note that these positions are determined using the UVOT for an astrometric correction, so will not be perfectly centred on the apparent position of the XRT source. The online tool for building Swift-XRT products allows the user to determine an astrometrically-corrected position (where possible) for any object; where this positional enhancement fails, an improved "PSF-fitted" position will be provided.

If the user does not know the coordinates of their source of interest, xrtcentroid is one method to determine a position. The script calls the centroiding task in XIMAGE (the same function as detect calls), but also calculates the uncertainty on the position (by accessing the CALDB). Either an eventlist or a sky image can be used as an input to xrtcentroid. The output uncertainty is a combination of the systematic and statistical errors, summed in quadrature (at the 90% confidence level).

Note that the systematic error for XRT positions calculated in this way is 3.5 arcsec, so will almost always dominate the uncertainty.

This position is based on the star tracker attitude solution and can usually be improved by using the UVOT for astrometric correction (see the online XRT products tool).

Using GRB 091029 as an example:

>xrtcentroid

           Running xrtcentroid version 0.2.7 

Name of the output file or DEFAULT to use standard name [ ]: position.txt
Name of the output directory [ ]: ./
Calculate centroid position (yes/no)? [ ]: yes
Name of the input Event/Image FITS file [ ]:
sw00374210000xpcw3posk.img
Use cursor to define center and size of box (yes/no)? [ ]: yes
xrtcentroid_0.2.7: Info: Output Directory: './'
xrtcentroid_0.2.7: Info: ./sw00374210000xpcw3posk.tcl successfully written
 No of detectors read in:   25
 Telescope SWIFT XRT
 Image size = 1000 x 1000 pixels
 Image rebin = 1.
 Image center = 500.5, 500.5
 Using gti for exposure 2964.29462 s
 Reading an events file
 File contains      31714 events
 Accepted: 31714 Rejected: 0
  Image level, min = 0.0000000 max = 97.000000
 Copied MAP1 to MAP9
 Plotting image
  Min =  0. Max =   97.
 Using MAP1

 Select center of box
 Cursor is active

An image will then pop up, as when running XIMAGE (see above). The user should zoom into the burst (to do this, click on the zoom in button on the right-hand panel; unfortunately, you cannot centre the source, since clicking within the field of view starts the centroiding process). and click first as close to the centre of the target as possible and then just at the edge of the source, where the PSF fades into the background. A calculated position will then be written both to the screen and the output file (position.txt in this example):

clean centroid
 Calculated centroid:

   RA/Dec (2000) = 04 00 42.2604   -55 57 18.2172
   RA/Dec (2000) = 60.1760849778   -55.9550603321

   LII/BII = 266.83 -45.69
   X/Ypix = 501.88080 557.79865

xrtcentroid_0.2.9: Info: processing '/usr/local/swift//caldb34/data/swift/xrt/bcf/instrument/swxposerr20010101v003.fits' CALDB file
xrtcentroid_0.2.9: Info: Error radius (arcsec) = 3.53920750335502
xrtcentroid_0.2.9: Info: .//sw00374210991xpcw3posk.txt successfully written
Index