NAME

uvotgrblc - extracts magnitude and flux light curves from aspect corrected UVOT sky images

SYNOPSIS

uvotgrblc @skyimgs.txt @expmaps.txt @sumimgs.txt @sumexps.txt <outdir> <outstem> <RA> <Dec> <sigma>

DESCRIPTION

This task extracts calibrated magnitude, flux density and integrated flux light curves from a set of level II input sky images. For each filter, a FITS light curve is generated which contains magnitudes, fluxes and all correction factors that have been applied. By default, plots of the magnitude light curves, the integrated flux light curves, and an image of the GRB FOV obtained from the sky image with the highest S/N, are generated. If coordinates are given for the BAT and/or XRT also, then a finding chart image will be plotted also.

The light curve extraction for each filter consists of several steps:

The "best" field stars, mentioned above, used for FIELDSTARS aperture correction are selected using the following criteria:

The last requirement removes sources at the chip edges, which suffer from false detections, and poor source characterization.

If the option skysummed = 'yes', then the input list of sky images is treated a list of summed images, and the photometry is only performed on each the first extension of each image (assumed to be summed).

The flux density to flux conversion factors are as follows (units = erg cm^-2 s^-1 mJy^-1):

If dogrbsearch='yes' (EXPERIMENTAL), then the above steps are not performed. Instead, sources are detected in each snapshot of each filter, and a master list of sources for each filter is generated. This list is then compared to a simple USNO-B1 catalog search (LWP perl module and www access required). Any sources which are not cataloged have aperture photometry performed on them in the earliest snapshot of each filter. A finding chart image is produced with the GRB candidates circled. In this case, the only output is a single FITS table containing the photometry of each source from uvotsource and a single plotted image.

PARAMETERS

skyimg [filename]
Input list of aspect corrected UVOT sky images. This can be either a comma separated list of files, or an @file containing a list of files (one per line). Only one sky image per OBSID/FILTER combination is supported.

expimg [filename]
Input list of exposure maps, one for each sky image. This can be either a comma separated list of files, or an @file containing a list of files (one per line).

sumsky [filename]
Input list of summed images - these should be created with uvotimsum using the images in the skyimg parameter. This can be either a comma separated list of files, or an @file containing a list of files (one per line).

NOTE: If skysummed='yes' then this parameter is ignored!

sumexp [filename]
Input list of exposure maps, one for each summed image. This can be either a comma separated list of files, or an @file containing a list of files (one per line).

NOTE: If skysummed='yes' then this parameter is ignored!

outdir [string]
Output directory. This should not already exist, unless the clobber parameter is set to 'yes'.

outstem [string]
Stem for output filenames

srcra [HH:MM:SS.SS, HH MM SS.SS or DDD.DD]
RA of the GRB. The more accurate this is, the better.

srcdec [DD:MM:SS.SS, DD MM SS.SS or DDD.DD]
Dec of the GRB.

sigmacust [float]
Detection threshold (sigma).

(skysummed) [bool]
Are the sky images summed? If 'yes', then the list in the skyimg parameter is copied into the sumimg parameter, and similarly for the expimg and sumexp parameters. This is useful if, say, you are working with AGN, and do not care about variation from snapshot to snapshot.

(apermethod) [FIELDSTARS|CURVEOFGROWTH]
If set to 'FIELDSTARS', then the method described in DESCRIPTION is used to get the aperture correction for each. If set to 'CURVEOFGROWTH', then the curve of growth method is used (see fhelp for uvotsource).

(fixedaper) [bool]
If set to 'yes', value of aperture parameter is used for the aperture radius.

(aperture) [int (3|4|5)]
If fixedaper is set to 'yes', then the value of this parameter (in arcsec) is used for the aperture size for all source photometry.

(appendcurves) [bool]
If set to 'yes' (default), then all light curves will be merged into a multi-extension fits table, with one extension per filter.

(object) [string]
Used as object name in plotting, and OBJECT keyword in output FITS files. If set to 'DEFAULT', then the first OBJECT keyword found in the input list of sky images will be used.

(centroid) [bool]
If set to 'yes', then uvotcentroid will be called on each input summed image. If at least one good centroid is found, then the average centroided position will be used (after two rounds of 1.5-sigma rejection).

(dogrbsearch) [bool]
If set to 'yes' (EXPERIMENTAL), then instead of extracting a light curve for a single source, detected sources are compared with the USNO-B1 catalog, and aperture photometry is performed for each un-cataloged source in the earliest snapshots of each filter (see DESCRIPTION above).

NOTE: Requires LWP perl module to be in your perl library path

(autobkg) [bool]
Determine background region automatically (see DESCRIPTION section). Otherwise, use region file specified in bkgreg parameter. The default is 'yes'. Ignored if dogrbsearch='yes'.

(bkgreg) [filename]
Custom background region file. Any region file format that is supported by uvotsource and XImage can be used. Ignored if autobkg='yes'. Ignored if dogrbsearch='yes'.

(bkgfield) [bool]
If set to 'yes', then detected field sources in each filter will be excluded from the background region defined by the bkgreg parameter. Ignored if autobkg='yes' or dogrbsearch='yes'.

(extinct) [bool]
Do extinction correction? If set to 'yes', NED is queried for the E(B-V) value corresponding to the GRB coordinates. The extinction is calculated using the extinction law from Cardelli et al (1998), with R_V=3.1 and coefficients from Roming et al (2008, in preparation). Ignored if dogrbsearch='yes'.

NOTE: No correction factor will be applied to the white filter.

NOTE: Requires LWP perl module to be in your perl library path

(fldexpthresh) [real]
Minimum fraction of exposure time required for field sources. That is, if a field source has a mean exposure < fldexpthresh*total_exposure, it will not be considered a good source for the aperture correction calculation. Ignored if apermeth='CURVEOFGROWTH' or dogrbsearch='yes'.

(doplots) [bool]
Produce light curve and image plots? Default is 'yes'

(plotftype) [string]
PGPLOT device to use for plotting. Only file type devices are currently supported, e.g. /gif. Default is '/gif'.

(logxplot) [bool]
Log scale time axis for light curve plots? Ignored if dogrbsearch='yes'.

(usetargid) [bool]
If set to 'yes', then plots will be labelled with the value of the first TARGID keyword found in the input FITS images. The TARGID keyword will also be written to the output FITS light curves.

(usetrigtime) [bool]
If set to 'yes', then plots and light curves will be offset by either the value of the trigtime parameter (if > 0.0), or the first found value of the TRIGTIME keyword in the input FITS images.

(trigtime) [float]
GRB BAT trigger time, in MET [s]. If <=0.0, then the output light curve time axes will be in MET [s]. Ignored if dogrbsearch='yes'.

(trigfrombat) [bool]
Is the trigger time (either the trigtime parameter or the value of the TRIGTIME keywords) from a BAT trigger? This parameter affects plotting only.

(xrtsrcra) [HH:MM:SS.SS, HH MM SS.SS or DDD.DD]
XRT source RA. If provided, then a finding chart image will be displayed adjacent to the FOV image, in the output image file. If set to 'NONE' (default), then it will be ignored

(xrtsrcdec) [DD:MM:SS.SS, DD MM SS.SS or DDD.DD]
XRT source RA. If provided, then a finding chart image will be displayed adjacent to the FOV image, in the output image file. If set to 'NONE' (default), then it will be ignored

(xrterrrad) [real]
XRT error radius in arcminutes. Used to plot XRT error circle in finding chart, and as a constraint on GRB candidate searching if dogrbsearch='yes'.

(batsrcra) [HH:MM:SS.SS, HH MM SS.SS or DDD.DD]
BAT source RA. If provided, then a finding chart image will be displayed adjacent to the FOV image, in the output image file. If set to 'NONE' (default), then it will be ignored

(batsrcdec) [DD:MM:SS.SS, DD MM SS.SS or DDD.DD]
BAT source RA. If provided, then a finding chart image will be displayed adjacent to the FOV image, in the output image file. If set to 'NONE' (default), then it will be ignored

(baterrrad) [real]
BAT error radius in arcminutes. Used to plot BAT error circle in finding chart, and as a constraint on GRB candidate searching if dogrbsearch='yes'.

(cleanup) [bool]
Clean up temporary files and intermediate files?

(chatter) [int] [0,5]
Chattiness level. 0 means essentially nothing will be printed. 5 is debugging mode with tons of output. Default is 2.

(clobber) [bool]
Clobber output files. If outdir directory exists, and clobber is set to 'no', then this task will exit with an error.

OUTPUT

The number of output files depends on the number of filters represented in the input sky image list, the choice of the doplots parameter, and the value of the appendcurves parameter. The maximum set of output files, for outdir=./test, appendcurves='no', and outstem=GRBTEST would be:

./test/GRBTEST_uvvsrab.lc
light curve for V filter
./test/GRBTEST_ubbsrab.lc
light curve for B filter
./test/GRBTEST_uuusrab.lc
light curve for U filter
./test/GRBTEST_uw1srab.lc
light curve for UVW1 filter
./test/GRBTEST_um2srab.lc
light curve for UVM2 filter
./test/GRBTEST_uw2srab.lc
light curve for UVW2 filter
./test/GRBTEST_uwhsrab.lc
light curve for WHITE filter
./test/GRBTEST_uuve7srab.qdp
QDP/PLT file containing magnitude and integrated flux light text light curves for all filters
./test/GRBTEST_pco1.pco
PCO file containing QDP/PLT commands for plotting magnitude light curves
./test/GRBTEST_pco2.pco
PCO file containing QDP/PLT commands for plotting integrated flux light curves
./test/GRBTEST_uuve7srfb.gif
gif plot of all integrated flux light curves on a single Time-Flux plot
./test/GRBTEST_uuve7srmb.gif
gif mosaic plot of magnitude light curves
./test/GRBTEST_uuvsri1.gif
gif plot of GRB FOV.

If coordinates for the BAT or XRT are entered (see parameters batsrcra, batsrcdec, xrtsrcra, xrtsrcdec), then there will be a single extra plot of the earliest, most sensitive image named:

./test/GRBTEST_uuvsri2.gif
gif plot of earliest/most sensitive FOV

If appendcurves='yes', then instead of the seven '.lc' files above, there would be a single light curve FITS file:

./test/GRBTEST_uuvetsrab.lc
light curve for all filters, one per extension

The FITS light curves have numerous columns, nearly all of which are documented in the uvotsource fhelp file. The main differences are in how upper limits are indicated. In the output light curves from this task, an upper limit is indicated by an INDEF or NULL in the MAG_ERR, FLUX_AA_ERR, FLUX_HZ_ERR, and INT_FLUX_ERR columns. In this case, the upper limit in each unit system is the corresponding intensity column.

There are additional columns in the output light curves as well. They are as follows:

TIME
Center of time bin, measured from BAT trigger time, if available. If BAT trigger time is not specified, or not found, then this is the MET [s] time of the bin center
XAX_E
Half-width of time bin
TIMEDEL
Full-width of time bin
FRACEXP
Fraction exposure of time bin. This is simply EXPOSURE/TIMEDEL.
SIGMA
Significance of detection, or non-detection
BKG_INNER_RADIUS
Inner radius of background annulus (NULL if autobkg set to 'no')
BKG_OUTER_RADIUS
Outer radius of background annulus (NULL if autobkg set to 'no')
APERTURE
Size of GRB extraction aperture in arcsec
OBS_ID
OBS_ID that this data point came from
EXPID
Exposure ID (or range of exposure IDs) that this data point came from
AP_SRC_RA
RA of field star used for aperture correction (-999 if CURVEOFGROWTH)
AP_SRC_DEC
Dec of field star used for aperture correction (-999 if CURVEOFGROWTH)
AP_SRC_RATE5
Raw count rate of field star (count/s) used for aperture correction in 5" aperture. AP_FACTOR = AP_SRC_RATE5 / AP_SRC_RATE
AP_SRC_RATE
Raw count rate of field star (count/s) used for aperture correction in same aperture as GRB extraction. AP_FACTOR = AP_SRC_RATE5 / AP_SRC_RATE
AP_SRC_DIST
Distance of field star used for aperture correction from GRB in arcsec

NOTES

Currently a working CALDB must be setup in order to run this task.

LAST MODIFIED

Feb. 2009