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.
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:
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:
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.
To create region filters in XSELECT, execute the following steps.
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
When creating a region filter, please consider the following points:
Time filters allow users to extract portions of their data based on time. XSELECT provides three methods for doing this.
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).
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:
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.
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:
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:
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.
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:
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).
Time filter files are combined in the following way:
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.
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:
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.
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.
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 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, should first be calculated using the formula above and then divided by 4.
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.
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 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.
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.
The steps involved in converting coordinates in region files from one mission to another comprise the following.
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.
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).