Once you have extracted an image using XSELECT, and defined relevant extraction regions, source and background counts can be estimated using XIMAGE (first introduced for source detection and position determination).
>ximage >read sw00374210005xpcw3posk.img >cpd /xtk >disp
Here we have read in an image corresponding to ObsID 00374210005 - a later observation of GRB 091029, where there are fewer counts in the whole ~10 ks observation. The source is not piled-up at this point, so we have defined a circular extraction region centred on the source, and can determine the number of counts in it thus:
> counts circle.reg Using MAP1 Total Area Area Average Average (count) (img-pix) (det-pix) (per img-pix) (per det-pix) # 37 707.00000 707.00000 0.0523338 0.0523338
The region will be overlaid on the image (here we have zoomed in a little, to make it clearer); you can also run the detect command as explained in the earlier thread if you wish to ensure the source really is detected - not really necessary when it's still this bright, though! The output to the screen shows there are 37 counts detected in this region, which has an area of 707 pixels. (In this example, the region was defined to have a radius of 15 pixels.)
The same can be done for the background region; as previously mentioned, this should typically be a larger area than the source region. Unlike in XSELECT, you do not need to 'remove' the source region first; the counts
command only considers the region you explicitly type on the command line.
> counts back.reg Using MAP1 Total Area Area Average Average (count) (img-pix) (det-pix) (per img-pix) (per det-pix) # 56 11311.000 11311.000 0.0049509 0.0049509
So, in this case, we have 37 source counts in 707 pixels squared, and 56 background counts in 11311 pixels squared - which equates to
56 * (707/11311) = 3.5 counts
in a region the same size as the source extraction. Note that this measurement is for the raw source counts, not yet corrected for PSF losses, as covered at the bottom of the ARFs thread. For this example, the PSF correction factor is 1.4, so the corrected, and background-subtracted, count rate would be [(37*1.4) - 3.5] / 9912] = 0.0049
(since the exposure time is 9912 s from the top of the displayed image).