next up previous contents
Next: 8. SPECTRAL ANALYSIS Up: ASCA ABC Guide Previous: 6. SCREENING   Contents

Subsections


7. FILTERS

7.1 Introduction

In chapters 5 and 6 we saw how to reject `bad' data by means of various screening processes. Filtering, the next step in data reduction, means selecting subsets of the good, screened data for particular analyses. Once the filters are set, the data are extracted through the filters to yield the desired spectra, light curves or images. The various ways XSELECT provides for filtering data are the subject of this chapter.


7.2 The Basics of Filtering

In XSELECT, filters are entered with the filter command followed by the type of filter, followed by the filter information itself (usually the name of a file containing that information). There are five basic types of filter available:

  1. region

  2. time

  3. intensity

  4. energy

  5. phase

For example, filter region bl_lac.reg will enter the region filter contained in the file bl_lac.reg. All filters share the following basic features:


7.3 Region Filters

In XSELECT, region filters are usually created by examining an extracted image using SAOimage. The procedure is straightforward, but there are a few points to be borne in mind when creating region filters for the GIS and SIS.


7.3.1 Using SAOimage to Create Region Filters

To create region filters in XSELECT, execute the following steps.

  1. Decide first whether you want to work in SKY coordinates or DETECTOR coordinates. For spectra work it is strongly advised to use detector coordinates (the default), since the spectral response depends on the location in detector rather than position on the sky. Using SKY coordinates can give you an incorrect WMAP (§8.2.2), especially when attitude excursions are large. Errors can also arise when comparing extraction regions from other missions. To change the coordinates to SKY, use the XSELECT command set image sky. To change back to detector, use set image detector.

  2. Extract an image from your screened events with the extract image command.

  3. Plot the image with the plot image command which invokes SAOimage.

  4. Change the appearance of the plot, if you like, using the Scale, Zoom and Color buttons in SAOimage.

  5. Click on the Cursor button. There are two sets of cursor buttons available - toggle between them using the region button at the righthand end. To define the region, click on the circle button and then manipulate the region using the cursor. The left button changes the center of the region, the middle button changes the size of the region, and the right button changes the orientation. Once you have positioned and sized the region according to your wishes, type s inside the SAOimage window. Next, go to the region write button and at the prompt give the filename (e.g., source_gis2.reg) for the region specifier.

    To create an annular region, first position and size the outer circle and type s. Then, size the inner circle and type e which creates an exclusionary region. Finally, hit the write button, as before. Note that you can build up quite complicated regions by drawing multiple circles, etc., and typing s or e: all the circles will be written to the region file when you hit the write button. Hitting the reset button will erase the saved regions, allowing you to start again before writing the region file.

After it is created, a region filter file is applied with the filter region command followed by the name of the region file. To remove a region filter, use the command clear region


7.4 More About Region Filters

When creating a region filter, please consider the following points:


7.5 Time Filters

Time filters allow users to extract portions of their data based on time. XSELECT provides three methods for doing this.

  1. Specifying parts of the light curve with the mouse cursor;

  2. entering the start and stop times at the keyboard; and

  3. entering a file containing the desired start and stop times.

Before reading this section, it might be a good idea to revisit the sections which describe how time is defined in GIS and SIS data files (§2.6.2).


7.5.1 Time Filtering with the Mouse Cursor

In brief, cursor-based time filtering involves first extracting and plotting a light curve and then using the cursor to mark out portions of the light curve for extraction. In more detail, the various steps are:

  1. Before extracting a light curve, users might want to set other filters, such as a region filter or an energy filter. The time bin size can be selected by using the set binsize command. For example, set binsize 64 causes the light curve to be extracted in 64-s bins. Integral multiples of the original GIS and SIS bin sizes are recommended (see §9.12).

  2. Extract the light curve with the extract curve command.

  3. Initiate the cursor-based time filtering with the command filter time cursor. After specifying the PGPLOT device (e.g., /xw for XWindows), a plot of the light curve will appear on the screen. The X-axis displays the time, in seconds, from the start of the observation which appears in MJD and Spacecraft time at the top of the plot. The Y-axis gives the count rate. Meanwhile, in the XSELECT window, a command summary appears, followed by the PLT$>$ prompt.

  4. There are two modes of interacting with the display: `plotting' mode and `selection' mode. Plotting mode - the initial state - allows the user to alter the appearance of the plot by entering commands at the PLT$>$ prompt. For example, rescale x 20000 40000 will replot the light curve with the X axis covering the time range 20,000-40,000 s. Typing ? at the prompt will give a list of PLT commands.

  5. Once the plot appears to your satisfaction, type quit at the PLT$>$ prompt to enter selection mode (which will cause the cursor to change shape). At this point, you can use the cursor to mark out either the portions of the light curve you want to extract, or the portions you want to exclude from extraction.

    Inclusion of time intervals of is done by positioning the cursor at the beginning of the portion you want, clicking, and then moving the cursor to the end of the portion and clicking again. A horizontal line will then appear on the screen to indicate the part you selected.

    Exculsion of time intervals is done in a similar way, but with the difference that you type e instead of clicking. As before, the horizontal line which appears on the screen indicates the portion you selected, so an excluded part appears as a gap.

    It is possible to mix included and excluded portions, and to return to plotting mode to specify another set of portions. When you have finished selecting parts of the light curve, type x in selection mode or, if you are in plotting mode, type quit followed by x.

Leaving cursor selection creates a temporary file containing your time selections, in the form of a series of good time intervals (GTIs). By default, it will be used in the next extraction and can be removed with the clear time cursor command.

Also by default, the temporary file will be deleted on exiting XSELECT unless saved. To save the file, use the command save time cursor and name the file (but without an extension - XSELECT will append .curs_gti to the name). The file created is in FITS GTI format and may be reapplied with the filter time file command.


7.5.2 Time Filtering with the Keyboard

Perhaps the simplest method of creating a time filter is to enter pairs of start and stop times at the keyboard. There are three ways of specifying the times:

  1. Universal Time, in which case the command is filter time ut and the format for the time is, e.g., 20/09/95 14:12:00.00.

  2. Space Craft Clock Time, in which case the command is filter time scc and the format for the time is, e.g., 1.372975399487495E+07 or 13729753.99487495.

  3. Modified Julian Day, in which case the command is filter time mjd and the format for the time is, e.g., 49250.75223900.

Keyboard time filters, regardless of type, are removed with the clear time keyboard command.

If you have extracted a light curve before creating the keyboard time filter, then typing, say, filter time scc will cause the light curve to be plotted and a set of instructions to appear on the screen. The instructions are very similar to those for creating time filters with the mouse cursor:

  1. At first, the user has the opportunity to alter the appearance of the plot by entering commands at the PLT$>$ prompt, e.g., rescale y 0 4 to change the range of the Y-axis range to 0-4 count/s. Typing ? provides a list of the various PLT commands.

  2. Once the plot is satisfactory, type quit at the PLT$>$ prompt to start making selections.

  3. The on-screen instructions are straightforward: when filtering in Space Craft Clock time, typing, for example, i 13730000, 13750000 will cause events between 13,730,000 and 13,750,000 seconds to be included. This interval will appear as a horizontal line on the plot. Note that start and stop times should be separated with a comma.

  4. Further intervals can be specified, and the plot can be altered again by typing p to return to the PLT$>$ prompt. When all the intervals have been specified, type x (or quit then x if at the PLT$>$ prompt).

Leaving keyboard selection creates a temporary file containing your time selections. By default, it will be used in the next extraction and can be removed with the clear time keyboard command.

Also by default, the temporary file will be deleted on exiting XSELECT unless saved. To save the file, use the command save time keyboard and name the file (but without an extension - XSELECT will append .hnd_gti to the name). The file created is in FITS GTI format and may be reapplied with the filter time file command.

The procedure for creating keyboard time filters in the absence of a light curve is essentially the same, but without the opportunity to view the selected portions of the light curve.


7.5.3 Time Filtering with Files

Files containing sets of start and stop times can be used as time filters with the filter time file command. Three formats, which XSELECT distinguishes automatically, are possible:

  1. ASCII,
  2. FITS GTI and
  3. XRONOS window.

ASCII time filter files are the simplest of the three: they contain pairs, one per line, of the start and stop times you wish to include, as in this example:

1.372975399487495E+07   1.374917324292182E+07
1.376167806128120E+07   1.378212711987495E+07

Please note that ASCII time filter files

The time filters produced with the save time cursor and save time keyboard commands are examples of FITS GTI filter files. Like their ASCII counterparts, they are entered with the filter time file command, but are removed with the command clear time fits instead.

XRONOS windows are described in the XRONOS manual (see §11.2).


7.5.4 How Time Filter Files Are Combined

Time filter files are combined in the following way:


7.6 Energy Filters

Strictly speaking, it is not possible to filter by energy since events in the events lists are assigned a channel number rather than an energy: only in the spectral response matrix is the energy-to-channel conversion applied. However, XSELECT does allow users to filter by PHA or PI channel. All that is needed to filter by energy, therefore, are the energy-to-channel conversions for the various GIS and SIS data modes.

To enter a PI or PHA filter, type filter pha_cut followed by the lower and upper channel boundaries. To remove a PHA filter, clear pha_cut. In addition, please note the following.


7.7 Intensity Filters

Filtering by intensity is useful for variable sources - especially for spectral studies of high- and low-flux states. A light curve must be extracted first, as the filter settings refer to the count rate of the light curve. The steps are as follows:

  1. Before extracting a light curve, users might want to set other filters, such as a region filter or an energy filter. Select the bin size first with set binsize. Extract the light curve with the extract curve command.

  2. Plot the light curve with the plot curve command, and examine the plot to determine the intensity bands you wish to extract.

  3. Create the intensity filter with the filter intensity command. The arguments are the upper and lower bounds of the intensity band to be included. For example, filter intensity 0.8-2.1 will cause only those events to be extracted which lie in the parts of the light curve having count rates between 0.8 and 2.1 counts per second. Multiple bands can be specified by separating them with commas.

After setting the intensity filter, a temporary file containing the corresponding GTIs is created. By default, it will be used in the next extraction and can be removed with the clear intensity command.

Also by default, the temporary file will be deleted on exiting XSELECT unless saved. To save the file, use the command save intensity and name the file (but without an extension - XSELECT will append .int to the name). The file created is in FITS GTI format and may be reapplied with the filter time file command.

Please note: unless they are cleared beforehand, any filters used to create the light curve will be applied in conjunction with the intensity filter the next time anything is extracted. If, for example, you created an intensity filter based on a soft light curve, you should clear the corresponding energy filter before extracting a spectrum.


7.8 Phase Filters

The simplest way to describe phase filters is by example. The command

filter phase 49396 0.00782407 0.0-0.2

will cause events to be extracted between the phases of 0 and 0.2, where the full range in phase is 0-1. The first argument is the epoch of phase zero in MJD. The second argument is the period in days (676 seconds, in this case).

More than one phase range can be entered by separating the ranges with commas and enclosing them in a pair of quotation marks. The command clear phase removes a phase filter.

In general, any set of XSELECT commands can be written into an ASCII command file and implemented with the @ command followed by the name of the command filename. Phase filters are particularly suited for this treatment as they usually form a set of very similar commands. The following file, called phases.xco, is used for extracting a set of five phase-resolved GIS spectra:

filter phase 49396 0.00782407 0.0-0.2
extract spectrum
save spectrum pul1

clear phase
filter phase 49396 0.00782407 0.2-0.4
extract spectrum
save spectrum pul2

clear phase
filter phase 49396 0.00782407 0.4-0.6
extract spectrum
save spectrum pul3

clear phase
filter phase 49396 0.00782407 0.6-0.8
extract spectrum
save spectrum pul4

clear phase
filter phase 49396 0.00782407 0.8-1.0
extract spectrum
save spectrum pul5

clear phase

Please note the following.


7.9 Energy-to-Channel Conversion


7.9.1 GIS PH Mode

The energy-to-channel conversion is approximately linear for GIS PH mode events extracted from the PI column (the default). It is the same for GIS2 and GIS3 and can be expressed by the following approximate formula:

N = 84.9*E

where $N$ is the PI channel number and E is the energy in keV. Note that the formula applies for GIS PH mode with standard bit assignments. When 8 bits, rather than the standard 10, are used for PH, there are 256 channels in the events list. In this case, $N$ should first be calculated using the formula above and then divided by 4.


7.9.2 SIS FAINT and BRIGHT2 Modes

For SIS PHA bins, each chip has a different gain. The gain also has a spatial and temporal dependence. Therefore we strongly advise using PI channels, even for early observations in the PV and AO-1 phases.

In converting 4096 SIS PHA bins to PI, the channels are linearized so that each channel is 3.65 eV wide. However, this is not strictly the case over the whole pass band: some non-linearities remain. Even so, the following simple relationship is a good approximation for all eight chips:

N = 274*E   for E < 10.7

where N is the PI channel number and E is the energy in keV.


7.9.3 SIS BRIGHT and FAST Modes

The 2048 channels of BRIGHT and FAST mode events lists are related to those of FAINT and BRIGHT2 mode as follows. The first 1024 channels are unbinned; channels 1025-2048 are binned by a factor of 2; the remaining channels 2049-4096 are binned by a factor of 4. This means that the energy-to-channel relationship is a bit more complicated. In PI, for all eight chips, we have

N = 274*E - 1            for        E < 3.74

N = 1023+137*(E-3.74)    for 3.74 < E < 7.47

N = 1535+68.5*(E-7.47)   for 7.47 < E

where $N$ is the PI channel number and E is the energy in keV. The same caveats apply as for FAINT and BRIGHT2 modes: there are some small non-linearities in the energy-channel relationship, while above 10.7 keV the relationship changes.


7.10 Using Region Filters From Other Missions


7.10.1 SAOimage Region Files

The region files created by SAOimage are very simple: they contain only a description of the shape of the region, its position and its size - as in this example:

# gis2.img
# Wed Sep 13 11:49:47 1995
# shape x, y, [x dimension, y dimension], [angle]
 CIRCLE(109,115,32.08)

This corresponds to a circular region centered at the X-Y pixel position of (109,116) with a radius of 32.08 pixels. The lines beginning with # are headers and are ignored by SAOimage.

With such a simple scheme, it is not surprising that an SAOimage region file derived from, say, an Einstein IPC image, cannot be directly used as a filter for ASCA data. However, it is straightforward to convert the coordinates of one region file into the coordinates on the other, thanks to the use of standard OGIP FITS keywords in the headers of image files.


7.10.2 Converting Coordinates In Region Files

The steps involved in converting coordinates in region files from one mission to another comprise the following.

  1. For the first mission, extract an image in SKY coordinates and create a region filter.

  2. For the second mission, extract an image in SKY coordinates.

  3. Obtain the values of the following keywords from the headers of both image files (the FTOOLS fdump or fkeyprint can be used for this):

  4. Convert the values in the region filter from the first mission using the algorithm given below. Here, the values of the keywords for the first and second missions are denoted by the suffixes _in and _out, respectively. The coordinates and lengths in the region files follow the same convention. Thus, x_in, y_in and r_in are the coordinates and length(s) in the first region file, and x_out, y_out and r_out - the quantities we need to derive - are the coordinates and length(s) in the second region file.

         x_out = (x_in-crpix1_in)*[cdelt1_in/cdelt1_out]*
    	     [cos(crval2_out)/cos(crval2_in)] +
                 cos(crval2_out)*(crval1_in-crval1_out)/cdelt1_out + crpix1_out
    
         y_out = (y_in - crpix2_in)*[cdelt2_in/cdelt2_out] +
                 (crval2_in-crval2_out)/cdelt2_out + crpix2_out
    
         r_out = r_in * cdelt_out/cdelt_in
    
         where cdelt = (abs(cdelt1)+abs(cdelt2))*0.5
    

    The last expression is strictly NOT valid if CDELT1 and CDELT2 differ for the input and output image, in which case, e.g., a circular region would have to be mapped to an ellipse.

  5. With a text editor, create a region filter for the second mission containing the converted values.


7.10.3 Example: Using a ROSAT PSPC Region for the ASCA GIS

This example uses the ROSAT PSPC image of the cluster Abell 496, as obtained from the ROSPUBLIC database via HEASARC's W3Browse facility.

After extracting the image from the database, the first step is to display it using SAOimage and create the filter. In this example we have created a large circular region encompassing all the cluster emission. The corresponding region filter is:

# rp800024_im1.fits
# Thu Sep 14 10:36:29 1995
# shape x, y, [x dimension, y dimension], [angle]
 CIRCLE(256,257,36.06)

Next, I run fdump to display the values of the keywords we need:

tarquin> fdump rp800024_im1.fits
Name of optional output file[STDOUT]
Names of columns[-]
Lists of rows[-]
SIMPLE  =                    T  /  FITS STANDARD
BITPIX  =                   16  /  Binary Data
NAXIS   =                    2  /  Number of image axes
NAXIS1  =                  512  /  Dimension of axis 1
NAXIS2  =                  512  /  Dimension of axis 2
BSCALE  =           1.000000E0  /  Real = tape*BSCALE + BZERO
BZERO   =           0.000000E0  /  Real = tape*BSCALE + BZERO
DATE    = '27/09/91'  /  FITS creation date
IRAFNAME= './rp800024_im1.imh'  /  Output IRAF image name
TELESCOP= 'ROSAT   '  /  telescope (mission) name
INSTRUME= 'PSPC    '  /  instrument (detector) name
RADECSYS= 'FK5     '  /  WCS for this file (e.g. Fk4)
EQUINOX =           2.000000E3  /  equinox (epoch) for WCS
CTYPE1  = 'RA---TAN'  /  axis type for dim. 1 (e.g. RA---TAN)
CTYPE2  = 'DEC--TAN'  /  axis type for dim. 2 (e.g. DEC--TAN)
CRVAL1 =         6.841000E1 / sky coord of 1st axis (deg.)
CRVAL2 =        -1.326000E1 / sky coord of 2nd axis (deg.)
CDELT1 =        -4.166667E-3 / x degrees per pixel
CDELT2 =         4.166667E-3 / y degrees per pixel
CRPIX1 =         2.560000E2 / x pixel of tangent plane direction
CRPIX2 =         2.560000E2 / y pixel of tangent plane direction
CROTA2  =           0.000000E0  /  rotation angle (degrees)
MJD-OBS =           4.832162E4  /  MJD of start of obs.
More?[Yes] no

After obtaining the keyword values for the ROSAT PSPC image, I get the corresponding values for the ASCA GIS image by extracting a sky image from the A496 data and running fdump again. Here are the keywords:

CRPIX1  =  1.28500000000000000000E+02 / X axis reference pixel
CRPIX2  =  1.28500000000000000000E+02 / Y axis reference pixel
CRVAL1  =  6.84831770000000000000E+01 / Sky coord of X ref pixel (degrees)
CRVAL2  = -1.32060000000000000000E+01 / Sky coord of Y ref pixel (degrees)
CDELT1  = -4.09300000000000000000E-03 / X axis increment (degrees)
CDELT2  =  4.09300000000000000000E-03 / Y axis increment (degrees)

With the PSPC and GIS keyword values in hand, I use the formulae above to convert the X, Y and radius values from the ROSAT PSPC region file into their equivalents for the ASCA GIS region file:

x_out = (256-256)*-0.004166667/-0.004093*
        cos(-13.206)/cos(-13.26) +
        cos(-13.206)*(68.41-68.483177)/-0.004093 + 128.5
      = 145.91

y_out = (257 - 256)*0.004166667/0.004093 +
        (-13.26+13.206)/0.004093 + 128.5
      = 115.07

r_out = 36.06*0.004093/0.004166667
      = 35.42

The final stage is to use a text editor to create the GIS region file which contains the converted coordinates:

 CIRCLE(145.91,115.07,35.42)

Please note that the above procedure is limited by the pointing accuracy of ASCA. Details are given in the `Calibration Uncertainties' Web page (§1.7).


next up previous contents
Next: 8. SPECTRAL ANALYSIS Up: ASCA ABC Guide Previous: 6. SCREENING   Contents
Michael Arida 2002-10-22