The Neil Gehrels Swift Observatory

Search for GRB Afterglows in UVOT Data

Overview:

This thread gives quick & dirty instructions on how to look for a GRB afterglow in either TDRSS, Quick-Look, or archival UVOT data.

Read this thread if you want to: Search for GRB afterglows in UVOT data.

Last update: Jan 31, 2013

You can search for optical/UV afterglows of GRBs in both TDRSS, Quick-Look, or archival UVOT data.

1. Download UVOT Data:

1.1 Download UVOT TDRSS Data:

If you have subscribed to the distribution of GCN Notices you will get the locations of GRBs per email sent to the email address you have provided. The email with subject line "GCN/SWIFT_BAT_POSITION" contains the BAT position ("GRB_RA", "GRB_DEC") and the statistical error to the position ("GRB_ERROR"), which is typically on the order of 3-arcmin.

If the GRB is detected in X-rays with the XRT you will find an email with subject line "GCN/SWIFT_XRT_POSITION" which contains the XRT position ("GRB_RA", "GRB_DEC") and the statistical error to the position ("GRB_ERROR"), which is typically on the order of 6-arcsec.

The email with subject line "GCN/SWIFT_UVOT_IMAGE_PROCESSED" will have the following files attached:

uvot_sky_image.img.gz
UVOT v-band image in sky coordinates (the so-called "GeNI" image; FITS)
uvot_sources_image.fits.gz
UVOT source list (FITS)
uvot_catalog_image.fits.gz
List of catalogued sources (FITS)
uvot_field_image.ps.gz
UVOT finding chart in PostScript

1.2 Download QuickLook Data:

Go to the Swift Quick Look data archive, search for data matching your criteria (e.g., GRB 050525) and download the following files:

swXXXXXXXXXXXuYY_sk.img
UVOT sky coordinate images (FITS), where
"XXXXXXXXXXX" is the 11-digit sequence #
"YY" is the 2-digit filter identifier
(vv: V, bb: B, uu: U, w1: UVW1, m2: UVM2, w2: UVW2)
swXXXXXXXXXXXpsu.html
processing summary page (HTML)
swXXXXXXXXXXXuir.html
UVOT exposure report (HTML)
swXXXXXXXXXXXsat.fits
Spacecraft attitude file (FITS)

Open the processing summary page and the UVOT exposure report in your browser to get information on many UVOT exposures were obtained and how long each exposure was.

1.3 Download Archival data:

Go to the Swift data archive, the HEASARC data archive, or to the anonymous FTP download area, search for data matching your criteria (e.g., GRB050525 or the date 2005-05-25) and download the following files:

swXXXXXXXXXXXuYY_sk.img.gz
UVOT sky coordinate images (FITS)
"XXXXXXXXXXX" is the 11-digit sequence #
"YY" is the 2-digit filter identifier
(vv: V, bb: B, uu: U, w1: UVW1, m2: UVM2, w2: UVW2)
swXXXXXXXXXXXpsu.html
processing summary page (HTML)
swXXXXXXXXXXXuir.html
UVOT exposure report (HTML)
swXXXXXXXXXXXsat.fits
Spacecraft attitude file (FITS)

Open the processing summary page and the UVOT exposure report in your browser to get information on many UVOT exposures were obtained and how long each exposure was.

2. Apply Aspect Correction:

If you notice either a significant offset of the UVOT images from cataloged (such as DSS) images, or notice offsets of individual exposures in summed images (see below) you need to apply an aspect correction. Aspect correction is highly recommended to conclusively identify an afterglow.

The UVOT Aspect Correction Thread explains how to apply an aspect correction to UVOT images.

3. Sum Individual Exposures:

Open the v-band image with FV to check how many individual exposure it contains. In our example:

$ fv sw00130088000uvv_sk.img &

In the example data (GRB050525A) you will see that the v-band image (sw00130088000uvv_sk.img) contains 21 individual exposures. The first two exposures were taken in "EVENT" mode (header DATAMODE= "EVENT") before the satellite has settled ("settling images") on the final position. These exposures can be disregarded.

The exposures 3-21 are the images obtained in &q1uot;IMAGE" mode (header DATAMODE= "IMAGEEVENT"). You can add all exposures while exclude the settling images (exposures 1 and 2) by running the command "uvotimsum"

$ uvotimsum sw00130088000uvv_sk.img uvv_sum.fits exclude=1,2 chatter=1
$ uvotimsum sw00130088000ubb_sk.img ubb_sum.fits exclude=1,2 chatter=1
$ uvotimsum sw00130088000uuu_sk.img uuu_sum.fits exclude=1,2 chatter=1
$ uvotimsum sw00130088000uw1_sk.img uw1_sum.fits exclude=1,2 chatter=1
$ uvotimsum sw00130088000um2_sk.img um2_sum.fits exclude=1,2 chatter=1
$ uvotimsum sw00130088000uw2_sk.img uw2_sum.fits exclude=1,2 chatter=1

These commands will create the summed images called "uYY_sum.fits" where the "YY" is the 2-digit filter identifier. Running "uvotimsum" with "exclude=DEFAULT" will automatically exclude settling exposures from the summed image.

TDRSS UVOT data only contain one short v-band image (~200-sec; "uvot_sky_image.fits") and no exposures can be added.

4. Create Region files for the BAT and XRT Error Positions:

In the TDRSS emails sent to your account, as well as in published GCNs you will find the error positions for the BAT and XRT instruments (if a GRB was detected in X-rays with the XRT). For our example data set (GRB 050525A) the region files will look like this

BAT error position region file "bat.reg":

# Region file format: DS9 version 3.0
global color=green font="helvetica 10 normal" select=1 edit=1 move=1 delete=1 include=1 fixed=0 source
fk5;circle(278.144,26.34,180") # color=green

XRT error position region file "xrt.reg":

# Region file format: DS9 version 3.0
global color=green font="helvetica 10 normal" select=1 edit=1 move=1 delete=1 include=1 fixed=0 source
fk5;circle(278.13458,26.338194,6") # color=yellow

These two region files will be used to search for matching UVOT sources.

5. Display Images:

Display the summed UVOT sky image using DS9:

$ ds9 uvv_sum.fits &

or the original sky coordinate image in case you work on TDRSS data:

$ ds9 uvot_sky_image.img &

Load and display the region files for the BAT (bat.reg) and XRT (xrt.reg) error positions by clicking on "Region", "Load" and clicking on the region file names. Your DS9 display will look like this:

UVOT image with BAT and XRT GRB positions

The green circle (with a radius of 3-arcmin) in the image above gives the BAT error position, the yellow circle (with radius 6-arcsec) gives the XRT error position for GRB 050525A.

Next, load a DSS image to see if there is a new source in the UVOT image. In DS9, click on "Analysis", "DSS Server", and "Retrieve" in the pop-up window. Zoom into the v-band image and match the two images by clicking on "Frame", "Match Frames", and "WCS". Your DS9 display will look like this:

Aspect-corrected UVOT image and matching DSS image

Click on "Frame", "Blink Frames" to search for an apparent new source in the UVOT v-band image within the error positions. In our example you can see a point-like optical/UV source in each of the filters at the eastern edge of the XRT source position. This source is not visible in the (pre-burst) DSS image.

Congratulation! You have detected a candidate afterglow for GRB 050525A!

6. Calculate Magnitudes and Upper Limits:

To calculate the optical/UV magnitudes of a matched UVOT source, or compute upper limits in case of a non-detection, you need to create two region files for each filter:

source.reg
Region file with a circle of radius 5-arcsec for all UVOT filters.
back.reg
Background region file. This background region file should be placed in a source-free region and can have any radius.

UVOT image with source counts extraction regions

The above summed UVOT v-band image gives the XRT error position (yellow), the source counts extraction region (red), as well as the region used to extract the background level (green) for GRB 050525A.

To extract counts from within the source and background apertures run the command:

$ uvotsource <UVOT IMAGE> srcreg=source.reg bkgreg=back.reg sigma=5 output.fits cleanup=yes chatter=1

The "sigma" paramter gives the detection threshold in terms of Gaussian sigma. Setting "sigma=N" will return a magnitude if the source is detected at N sigma above the noise and an N-sigma upper limit if it is not. "Output.fits" is the name of the FITS file (which will be created automatically) that the results are written to.

Applied to our example observation of GRB050525A

$ uvotsource uvv_sum.fits srcreg=source.reg bkgreg=back.reg sigma=5 output.fits cleanup=yes chatter=1

gives a v-band magnitude of V = (17.62 ± 0.02) mag (49.4-sigma significance of detection). Please note that this is the statistical error only (unless if the "syserr" flag is set to "syserr=YES"). There is an additional systematic error of a few hundredths of a magnitude associated with the photometric zero points.

You can also use the Swift UVOT FTools "uvotmaghist" and "uvotproduct" to do photometry and to create light curves. Please see their help files for instructions:

$ fhelp uvotmaghist

$ fhelp uvotproduct

Happy GRB afterglow hunting!