Skip banner and navigation tools.

 |  site map

Skip sidebars of related page links.

Introduction to XSELECT

XSELECT is a command line interface to extractor and can be used to extract images, light-curves and spectra (among other things) from the eventlists. The following is intended as a brief introduction to the usage of XSELECT. The user's guide should be consulted for more details. See also the threads about extracting images, spectra and light-curves. GRB 091029 is used as an example below.


               **  XSELECT V2.2a  ** 

> Enter session name >[xsel]
xsel:ASCA >read event
> Enter the Event file dir >[./]
> Enter Event file list >[ ] sw00374210000xwtw2po_cl.evt

Got new mission: SWIFT
> Reset the mission ? >[yes]

Multiple eventlists can be read in, providing they were taken in the same mode (WT or PC, but not a combination):

      > read event sw00374210001xwtw2po_cl.evt
      > read event sw00374210002xwtw2po_cl.evt

If multiple eventlists are read in, the complete dataset will be used for subsequent analysis, unless additional filtering (see below) is used. In the following examples, only the first eventlist has been read in.

> extract image
extractor v5.11    11 May 2009
 Getting FITS WCS Keywords
 Doing file: /home/work/kpa/2009/grb091029/00374210000-xrt/sw00374210000xwtw2po_cl.evt
100% completed

          Total      Good    Bad: Time     Phase     Grade       Cut
           1621      1621            0         0         0         0
    Grand Total      Good    Bad: Time     Phase     Grade       Cut
           1621      1621            0         0         0         0
   in  140.80     seconds

 Image            has     1621 counts for  11.51     counts/sec

The number of counts and count-rate given here are for the entire field of view, since no further filtering has yet been applied.

> plot image

Note: Images will open in ds9. Source and background regions can be defined and saved (click on the ds9 image to bring up a circle; double click inside the region to bring up a box within which you can change the position/size parameters), or the pipeline regions used for the source if xrtpipeline was run with cleanup=no.

Below are examples of both WT and PC images. See the page about XRT modes to learn about the differences between WT and PC.

WT image PC image

PC mode data above a count rate of about 0.6 count s-1 will probably be piled-up (above ~100 count s-1 for WT data). See the pile-up thread for information about how to identify and deal with such a situation.

If the source is not piled-up then a circular region should be used to extract spectra/light-curves; circles can be used both for WT and PC data. A box region could also be used for the WT data, but this then needs to be aligned with the window (the roll angle of the spacecraft, given by the PA_PNT keyword in the header of the event file); thus, use of a circular region is more straightforward. Unless the source is faint, a 20-30 pixel radius (1 pixel = 2.36 arcsec) is suggested for the source extraction. For PC mode, a larger background region will give a better estimate of the background - a large offset circle (50-60 pixels in radius, for example), several small circles or a large annulus centred on the source are all suitable. Because of the size of the WT window, a background region the same size as that used for the source is acceptable; this should shifted along the window, away from the source PSF; alternatively, as described in this thread, a large annulus overlapping the edge of the WT window could be used. See here for example regions. We note that, for count rates above about 10 count s-1, WT data do not really require background-subtraction: subtracting the background counts will have very little effect on the spectrum.

To extract spectra within regions called src.reg and back.reg (for the entire dataset read in), the commands are:

> filter region src.reg
> extract spectrum
> save spectrum WT.pi
> clear region
> filter region back.reg
> extract spectrum
> save spectrum WTback.pi
> clear region

Note that XSELECT does not save anything automatically, so any files extracted must be explicitly written to a file by the user, using the save command.

Extracting a light-curve is very similar. One additional useful command allows the user to filter on 0.3-10 keV only; the filter pha_cutoff command needs the range in terms of channels: for the XRT, 1 channel = 10 eV. (Note: this energy filtering must NOT be done when extracting a spectrum, because the number of channels would them be incorrect for the RMFs.)

> filter region src.reg
> filter pha_cutoff 30 1000
> extract curve
> save curve
> clear region
> filter region back.reg
> extract curve
> save curve
> clear region

By default, WT data include grades 0-2 (single and double pixels), while PC data include grades 0-12 (single-quadrupal events). See figures 2.2 and 2.3 of the XRT Software Guide for the grade definitions. RMFs are available for grade 0, as well as 0-2 for WT, and 0-4 and 0-12 for PC respectively. filter grade 0 (filter grade 0-4) will select only grade 0 (grades 0-4) events within XSELECT. Generally, using the full grade selection (0-2 for WT; 0-12 for PC) is recommended, in order to have the best possible statistics. However, if a source in WT is heavily absorbed (columns of about 1022 cm-2 and above), the use of grade 0 only is recommended.

Once the data have been read in (from one or more eventlists), time-filtering can be performed. For example, if a spectrum from the first snapshot of data only is required, the command filter time cursor can be used. A light-curve must be extracted for the full time interval first, though!

> filter region src.reg
> extract curve
> filter time cursor

To start selection enter quit at the PLT prompt then:

Enter QUIT at PLT prompt to continue

PLT output, click for full size version

An image (as shown above) will be displayed once quit has been typed at the prompt. Click just before and after the time of interest - in the above example, the first snapshot has been chosen, as indicated by the white horizontal line. Pressing x (with the cursor still in the window showing the light-curve) will return you to the XSELECT prompt, while writing the time selection to a temporary file:

> quit

  Writing timing selections to file xsel_cursor_gti001.xsl

Until this filtering is removed (clear time cursor), any subsequent commands (extracting images, spectra, light-curves...) will only use this subset of the data. If you wish to keep the temporary time filter for future use, it should be copied to another file. To run a non-XSELECT command from within the program, preface the command with a dollar sign. For example:

>$cp xsel_cursor_gti001.xsl snapshot1.xsl

If there are specific times you wish to filter on (for example all the data before a break in the light-curve), then the command filter time scc (scc = spacecraft clock) is more useful. The times need to be given with respect to the start of the eventlist, though. Thus, if you want a WT spectrum covering the interval of 100-150 s after the burst, and the WT eventlist only starts at 70 s after the burst (therefore the interval of interest is 30-80 s after the start of the WT data), the commands would be:

>filter time scc

Enter as: 'mode start, stop'
mode = c means cancel selection
mode = e means exclude the interval
mode = i means include the interval
mode = m means switch to mouse mode
mode = p means return to PLT prompt
mode = x means exit, writing selection

start = l starts the interval at the left edge of the plot.
stop  = r stops the interval at the right edge of the plot.

N.B. Enter times as shown on the plot's X-axis, I will apply the offset for you.

Enter QUIT at PLT prompt to continue

> quit
> Enter start and stop times > 30-80 
> Enter start and stop times > x

Writing timing selections to file xsel_cursor_gti002.xsl

To remove the scc filtering, the command is clear time key. Other filtering options include filter time file (if you have a GTI file - such as the one copied to snapshot1.xsl in the above example), filter time mjd (time in Modified Julian Date) and filter time ut (time in UT).

Exposure maps are required to account for the hot columns and bad pixels present on the CCD. In order to create these, eventlists may need to be extracted for a given interval of time (for example, a single snapshot). In this case, the command, after the relevant time-filtering, would be:

>extract event copyall=yes

The copyall=yes ensures the bad pixel extension will be written to the new file.

When this file is saved, the user will be asked whether they wish to use the filtered events as the input file. An answer in the affirmative means that only this time interval will now be used in XSELECT. The full eventlist would need to be re-read in, to obtain the rest of the data. If the answer given is "no", then clear event will return to the complete data set.

Note that show status demonstrates which filtering commands are active.