next up previous contents
Next: 9 TEMPORAL ANALYSIS Up: ASCA ABC Guide Previous: 7 FILTERS

8 SPECTRAL ANALYSIS

 

8.1 Extracting Spectra

 

Once the data have been screened and the desired filters set, to extract a spectrum simply type extract spectrum at the XSELECT prompt. This command initiates the extractor, an FTOOL run by XSELECT, which extracts from the events list photons satisfying the GTI and filter constraints and bins them up as a spectrum. The extractor places the spectrum in a temporary file which can be saved using save spectrum. Although this procedure is as straightforward as it sounds, please note the following.

8.2 Spectral Files

 

It is not necessary to know all about ASCA spectral files in order to use them. However, it is a good idea to be familiar with their basic structure and contents.

The general principles behind the design and structure of the FITS spectral files (also known as PHA or PI files) from ASCA are described in Arnaud et al. 1992, Legacy #2, 65 and

http://heasarc.gsfc.nasa.gov/docs/heasarc/ofwg/docs/spectra/ogip_92_007/ogip_92_007.html.)

This article also lists all the keywords, extension names and column names. The key components of an ASCA spectral file are described below.

8.2.1 Primary Header

 

Below is a short list of some of the important keywords in the primary header.

EXPOSURE Integration time (in secs) of PHA data.
BACKSCAL Scaling factor used in background subtraction.
BACKFILE Background file name (blank unless filled by user).
RESPFILE RMF file name (blank unless filled by user).
ANCRFILE ARF file name (blank unless filled by user).
POISSERR Whether Poisson errors should be applied.
CHANTYPE Whether channels are PHA or PI.
TLMIN1 Channel number of first channel.
NCHAN Number of detector channels in the data set.
QUALITY Whether quality flags are attached to the data.
GROUPING Whether data are grouped.

Note that the background scaling factor, with keyword BACKSCAL, is defined as the ratio of the area of the region used to extract the spectrum to the total detector pixel area. Thus multiplying BACKSCAL by tex2html_wrap_inline6122 or tex2html_wrap_inline6124 gives the area of the spectral extraction region (in unbinned pixels) for the GIS or SIS respectively.

8.2.2 The Weighted Map (WMAP)

  The weighted map, or WMAP, is an image of the count distribution in the region used to extract the spectrum. The WMAP is an image array which resides in the primary extension of the FITS spectral file. This information is used to generate the XRT ancillary response file (ARF; see §8.7) which requires the spatial information of the counts on the detector plane. Since it is a FITS image, the WMAP can actually be displayed using an image display package such as SAOimage (e.g., saoimage -fits burst_g2.pha). In XSELECT the default binning for WMAP is unity for the GIS and a factor 8 for the SIS.

8.2.3 Spectrum, Quality and Grouping Flags

 

The SPECTRUM extension contains columns corresponding to channel number and the counts in each channel. The SPECTRUM extension can also contain additional columns for errors (if non-Possionian), as well as quality and grouping flags.

The quality flag, following the OGIP standard, can have the following values.

0 good
1 defined bad by software
2 defined dubious by software
5 defined bad by user
-1 reason for bad flag unknown

XSPEC will automatically ignore channels with a quality flag of 1, and on the command ignore bad will ignore channels with a quality flag of 5. Quality flags can be set or reset with the FTOOL grppha.

The grouping flag works as follows. XSPEC combines the counts in a channel with a grouping flag of 1 with all successive channels with grouping flags of -1. Grouping flags can be set or reset with the FTOOL grppha.

8.2.4 Spectrum GTI

The GTI extension contains the individual time intervals (start and stop times) used to make the spectral file.

8.3 Binning and Grouping

 

A key concept when dealing with spectral files is the difference between binning and grouping, both of which relate to the combining of spectral channels. An important difference, for our purposes, is that grouping is reversible but binning is not. Otherwise, the two processes are equivalent.

8.3.1 Binning

 

Binning refers to the recasting of counts from the original set of channels into a new, smaller set of binned channels. In general, a spectrum must be used with a background file and response file with matching channel arrays, i.e., all three files must share the same number of channels and channel boundaries. This means that when a spectrum is binned in a certain way, so must the background and response. To rebin spectral files, you can use the FTOOL rbnpha, and to rebin a response matrix, rbnrmf.

In the course of normal ASCA data reduction and analysis, the binning of the spectral files matches that of the response by default. However, there are three cases when changing the binning is an issue:

  1. Saving 1024-channel BRIGHT mode spectral files. By default, when BRIGHT mode spectral files are saved in XSELECT, rbnpha is applied to linearize the binning and to rebin the channels by a factor of four (i.e., 2048 to 512 channels). If you want a BRIGHT mode spectral file with 1024 channels, then you should not apply the default binning, and, instead, run rbnpha outside XSELECT. In this case, the appropriate `compression mode' required by rbnpha is bright2linear.
  2. Rebinning the GIS RMF for non-standard bit assignments. In GIS PH mode, if 8 bits rather than the standard 10 are assigned to the PHA, then the spectral files will have 256 channels rather than the standard 1024. If this is the case, the GIS RMF should be rebinned with rbnrmf. Here, the appropriate compression mode is linear.
  3. Reducing the size of the response and spectral files. To reduce the amount of computer memory required to perform spectral fitting, it is sometimes a good idea to rebin response and spectral files in addition to - or instead of - grouping the spectral files. This is especially useful when fitting more than one spectral file simultaneously. For this, use rbnpha and rbnrmf on the spectral files and response, respectively, with an identical number of resulting channels and compression mode.

8.3.2 Grouping

 

Grouping is performed by the FTOOL grppha. For more details about this program refer to fhelp grppha and §8.11.

Grouping refers to the setting of flags for combining spectral channels. The flags are used internally by XSPEC. Neither XSPEC nor the grouping program (grppha) physically alters the channels or their contents in the spectral file - unlike binning. When a spectral file is read into XSPEC, the program consults the grouping column in the file and applies the grouping information it contains to the spectral file, its associated background file and to its response. The effect of grouping the spectral file, therefore, is the same as binning the spectral file, background file and response. However, since it requires only one step and is reversible, changing the grouping is often more convenient than changing the binning. Note that background files should not be grouped since XSPEC will automatically group the background to match the source data. By default, GIS PH mode spectral files are regrouped by a factor of four when saved in XSELECT.

An instance where one must use binning and not grouping is if a response matrix and spectrum have a different number of intrinsic channels. In this case, grouping will not work. Either the spectrum or response matrix must be rebinned.

8.4 Spectral Responses

 

The instrument response can be split up into two parts. A `redistribution' matrix, which specifies the channel probability distribution for a photon of given energy, and an effective area curve, which specifies the telescope area and window absorption. We refer to the redistribution matrix as the RMF (Redistribution Matrix File) and the effective area curve as the ARF (Ancillary Response File). The combined response is the product of the ARF and RMF and is conventionally termed the RSP (response) file.

Users obtain GIS RMFs from the HEASARC calibration database and generate SIS RMFs using the FTOOL sisrmg. Users generate ARFs appropriate to their spectra using the FTOOL ascaarf.

In XSPEC, RMFs are entered using the response command, while ARFs are entered using the arf command. Alternatively, the RMF and ARF file names can be written into the header of the spectral file using grppha.

8.5 Obtaining GIS RMFs from the Calibration Database

 

GIS RMFs are straightforward. Only one kind, for PH mode, is available. The latest matrices can be found at

ftp://legacy.gsfc.nasa.gov/caldb/data/asca/gis/cpf/95mar06/gis2v4_0.rmf ftp://legacy.gsfc.nasa.gov/caldb/data/asca/gis/cpf/95mar06/gis3v4_0.rmf

The above directory (and the ASCA GOF Web page, should be checked regularly for any later releases.

8.6 Generating SIS RMFs

 

SIS RMFs are more complicated. Each SIS camera comprises four CCD chips, each of which requires its own RMF. A different RMF is also required for different event grades, split event thresholds, echo and CTI corrections. Moreover, the SIS resolution is degrading with time due to the cumulative effect of radiation damage. Therefore it is now recommended to generate the RMF file for each observation, in PI channels.

The FTOOL sisrmg (v1.0 or later, included in FTOOLS v3.5 or later) should be used to generate the RMF file, appropriate for your data. sisrmg will read the necessary information from the spectral file. Currently, the spectral files do not contain the grade selection information in a easily machine-readable way, therefore that information needs to be supplied on the command line.

tarquin> sisrmg grades=0234 
Name of PHA input file [NONE] s0b.pha
Name of ARF input file [NONE] 
Name of RM output file [NONE] s0b.rmf

Note that sisrmg requires the PHA to PI conversion calibration file. You must check that you are accessing the latest file as a new file is often released to keep up with the changing CTI (see §4.5.2). You must force sisrmg to use the latest file either by changing the parameter file or specifying the parameter calfile on the command line.

The ARF input file can be ignored in most cases, unless an RMF file that exactly matches an existing ARF file in terms of the energy grid is required.

8.7 Generating ARFs with ASCAARF

 

The Ancillary Response File (or ARF) contains all the information about

  1. the XRT effective area for the particular position of the source with respect to the optical axis;
  2. the point spread function (PSF) for the given extraction region;
  3. and the transmission of the detector window.

All these effects have been built into a convenient FTOOL called ascaarf which will generate the appropriate ARF for a given spectral file by using information in the spectral file itself - specifically, the WMAP which contains a map of where in the extraction region the counts in the spectrum came from. The energies at which the ARF is calculated are obtained from the corresponding RMF file, hence the arguments of the program are as follows.

  1. Input spectral file.
  2. Input RMF file.
  3. Output ARF file.

The user also needs to tell the program whether the source is point-like, and, if so, whether it is in the center of the WMAP. If the source is point-like and is not centered in the WMAP, then the user is prompted for the unbinned DETX and DETY coordinates of the source. For the case of a point source, ascaarf calculates the effective area at the source position and multiplies this by the (energy-dependent) fraction of events expected to fall within the selected region. For an extended source, ascaarf calculates a weighted-average effective area with the weighting factor being the number of events at each pixel position. In this case no attempt is made to correct for the spatial response and in particular no correction is made for events being scattered out of the selected region (see also §10.6).

Two important hidden parameters for ascaarf, and their default values, are fudge = yes and arffil = yes. The fudge parameter applies adds a Gaussian at 2.2 keV for the SIS and 1.9 keV for the GIS in order to account empirically for sharp residual features in the XRT response. The arffil parameter applies corrections (of order less than 5%) based on the fitting residuals to Crab GIS data. The average for GIS2 and GIS3 are used in the case of the SIS. At the time of going to press (March 1997), a calibration effort is underway to understand the physical origin of both these features and it is expected that ascaarf and the SIS and GIS response matrices will be modified and updated. Therefore the user should regularly check the `Calibration Uncertainties' Web page (§1.7) for recent developments.

Below are listed some more general points about ascaarf.

  1. The azimuthal dependence of the XRT response is less certain than the azimuthally averaged response so that more accurate results will obtained for circular extraction regions (see also §10.6).
  2. If, after generating an ARF, you rebin the spectral file and RMF, you do not need to generate a new, rebinned ARF.
  3. For the GIS, ascaarf has to convolve the XRT response with the GIS PSF. This calculation is rather CPU-intensive and can result in the program taking tens of minutes to create an ARF.
  4. ascaarf does not work well for point sources extracted in SKY coordinates or for any observation whose pointing position changes.
  5. Dead time correction is not included in ascaarf. It can, however, be corrected for in GIS events lists using the FTOOL deadtime.

8.8 Background Subtraction

 

At present, for spectra, there are two background subtraction techniques. These are (1) subtract suitable portions of the blank-sky observations that the GOF has made available, or (2) subtract a source-free part of the same observation. As the mission matures, it is likely that other, perhaps better, techniques will emerge, possibly involving fully prescriptive background models.

For more information about the GIS background and how to subtract it, please consult the articles by Kubo et al (ASCANews #2, 14) and Ikebe et al. (ASCANews #3, 13). The internal background of the SIS is described by Keith Gendreau in ASCANews #2, 5.

Whatever method is used, the relative normalization between the on-source and background spectra is taken care of by the EXPOSURE and BACKSCAL keywords. The value of the latter keyword is set in every spectral file when it is created (whether from a source or background region) to be proportional to the geometrical detector area of the extraction region (see §8.2.1 for precise definition).

8.8.1 Blank-Sky Observations

 

The blank-sky events lists for background subtraction are available at

ftp://legacy.gsfc.nasa.gov/caldb/data/asca/sis/bcf/bgd/94nov/

for the SIS, and at

ftp://legacy.gsfc.nasa.gov/caldb/data/asca/gis/bcf/bgd/94may/

for the GIS. These background files have been created from several superposed PV phase observations and are sorted by cut-off rigidity. They should only be used to create products in detector coordinates. Please note that these files have not been subjected to RTI-based background rejection (see §\ refrtiscrn). This means that, if your source spectrum has RTI-based background rejection, then you should use the XSELECT command gisclean on the file before extracting a background spectrum.

The files themselves are described in detail in the README files that accompany them. As FITS events files, they can be read into XSELECT with the read events command.

An important point to remember for the SIS is that these early blank-sky observations were made with the SIS in 4-CCD mode but the vast majority of point-source Guest Observer observations are made in 1- or 2-CCD mode. Since the SIS internal background depends on clocking-mode, this could lead to problems, especially at high energies (see §8.8.6). Also, the SIS sensitivity is declining with time in a manner which depends on the clocking-mode (primarily due to RDD effects - see §4.6.3) so the blank-sky background may not work well for the more recent observations.

8.8.2 GIS Night Earth Observations

 

In addition to the blank-sky observations, the ASCA GOF has also made available GIS events files corresponding to observations of the night Earth. Since the night Earth is X-ray dark, the files represent, to a good approximation, the purely instrumental background of the GIS. The files are available at

ftp://legacy.gsfc.nasa.gov/caldb/data/asca/gis/bcf/bgd/night_earth/

Each file contains night Earth events accumulated between 1993 May 28, (after the GIS Spread Discriminator was turned on) and 1994 Feb 8 (just before the temporary GIS3 CPU trouble). As FITS events files, they can be read into XSELECT with the read events command.

8.8.3 How to Subtract Background

 

The best background subtraction depends on matching as closely as possible the background in your source region. There are four main aspects to this which, to some extent, vary in relative importance depending on the nature of your observation.

  1. Extraction region.
  2. Screening criteria.
  3. Instrument mode.
  4. Galactic position.

Note that the first two are actually mutually exclusive: you can only extract background from the same region as the source by using a different, blank-sky observation; and you can only use an identical set of screening criteria by using the same observation for background and source.

8.8.4 Background: Extraction Region

 

Largely because of the vignetting of the XRT, the responses of the GIS and SIS depend on position in the field of view. For this reason, background events should technically be extracted from the same part of the field of view as the source events. In XSELECT this is easy:

  1. Read in the appropriate blank-sky background file with the command read events.
  2. For GIS files, issue the command gisclean to subject the events to RTI-based background subtraction.
  3. For SIS files, make sure that the background spectrum will be extracted from the same energy column as the source spectrum, i.e., PHA or PI. If necessary, to change the extraction column, type set phaname followed by pha or pi. In any case, you should now always be using PI.
  4. Then, extract a background spectrum with the same region filter file used for the source spectrum, making sure that the spatial binning and coordinate system are the same (use the command show status to check).
  5. Finally, save the background file with the command save spectrum. If GIS, do not apply the default grouping (XSPEC will get the grouping from the source file instead).

WARNING! If you background region goes outside the chips of the SIS, or outside the GIS detector area, your spectral files will contain the wrong values of BACKSCAL, the background scaling factor, and therefore your background subtraction will be wrong. You must explicitly exclude the off-detector regions.

8.8.5 Background: Screening Criteria

 

It is very important that the screening criteria used for the source and the background should be as similar as possible. The first release of background files is not accompanied by the mkf files, so the full range of selection criteria cannot be applied. Since the background files have been screened in a standard way and are sorted by cut-off rigidity, they should be acceptable for most cases. However, if you have a point source, we recommend that, as well as using the background files, you also extract background events from a source-free part of your source field. In the case of the SIS, this should be from the same chip; for the GIS, from a region at the same distance from the optical axis (within 14 arcmin from the optical axis, the GIS background does not vary much).

To find a source-free region, it is a good idea to make soft and hard images in case a contaminating source is not obvious in the image extracted from the full pass band. Of course, this background subtraction method contravenes the previous recommendation, but usually closely matching screening criteria are much more important for good background subtraction. Please use both methods and compare the results.

8.8.6 Background: Instrument Mode

 

As mentioned in chapter 4 and §8.8.1, the internal background of the SIS depends on clocking mode, i.e., whether 1-CCD, 2-CCD 4-CCD or parallel sum (FAST) mode was used. Since the total background is dominated by the cosmic background, this effect is small - except at energies above 7 keV. The rate of hot and flickering pixels also depends on mode, and it is possible that if, for example, the 4-CCD background files are used with a 1-CCD mode source file, then spurious, effects could appear. Also, as already mentioned, the effect of RDD (§4.6.3) is reducing the SIS sensitivity with time in a manner which depends on clocking mode so the blank-sky background may not work so well for more recent observations. Better results will often come from using background from a source-free region of the same chip from the current or even from a different observation.

8.8.7 Background: Galactic Position

 

The fields used to make the background files all come from high Galactic latitudes. At low Galactic latitudes, the Galactic X-ray background becomes important so local backgrounds must be used.

Using Blank-Sky Data for BRIGHT2 Mode Spectra

The blank-sky data for the SIS are in BRIGHT mode. They may also be used for BRIGHT2 mode source spectra. In this case, do not group or rebin when saving the spectra in XSELECT. Instead, run rbnpha on the saved spectra, using the BRIGHT2LINEAR option.

8.9 Analyzing SIS Spectra from Two or More Chips

 

When analyzing SIS spectra, if the photons from the source are spread over two or more chips and if you chose an extraction region over these chips, you have to consider that the chips have different responses (RMFs).

  1. Create a set of region files. One is for the entire source region (typically circular), excluding the inter-chip gap using the `box' shaping and hitting e in SAOimage. The other regions are sub-sets of the above, each lying entirely within a single chip (combine the same circle and a box, using s for both). There may be 2 or 4 such sub-regions.
  2. Extract spectra for each of the sub-regions. Run sisrmg on each. Also get the total number of counts in each spectrum (using e.g. the TOTCTS keyword).
  3. Use addrmf to combine the RMF files, weighting each file by the total number of counts in the corresponding spectrum.
  4. Extract the spectrum from the entire source region. Use this and the combined RMF to generate the ARF. Now you are ready for spectral fitting.

Note that this method is not mathematically exact, but considered a fairly good approximation. The exact way is to make an ARF for each chip (though this is not so simple), multiply the ARF and RMF for each chip, and average RSPs of different chips with equal weights. Since ARF for each chip can be approximated with the total ARF times (number of counts on that chip)/(total number of counts), the above method should work for most cases.

8.9.1 Combining Detectors

 

It may be helpful to add together spectral files from the two GIS or from the two SIS, rather than fit the spectral files with the same model simultaneously. The advantage is that, with the better signal-to-noise, it is easier to see spectral features in the combined spectrum than in the individual spectra.

8.9.2 For GIS

 

GIS2 and GIS3 RMFs, though having different names, are identical. Hence, the same RMF can be used for the GIS2 and GIS3 combined spectra, and only the ARFs have to be averaged. So...

  1. Extract source and background spectra for GIS2 and GIS3.
  2. Make ARFs for the GIS2 and GIS3 source spectral files using ascaarf with an RMF.
  3. Average the GIS2 and GIS3 ARFs. This is done with FTOOL addarf which requires, as well as the input ARFs, the weightings to be applied to each ARF. The weightings are simply the exposure time for each instrument divided by the sum of the two exposure times. Usually, the two sensors have almost the same exposure times, so the weights will be (0.5, 0.5). For help on addarf, type fhelp addarf.
  4. Combine the GIS2 source spectrum with the GIS3 source spectrum. Adding spectral files is performed with the FTOOL mathpha. Specify the exposure=CALC, and backscal=NONE options. Then the exposure time of the summed file becomes the sum of the GIS2 and GIS3 exposure times, and the BACKSCAL keyword value is reset to one. For help on mathpha, type fhelp mathpha. The following is an example of the use of mathpha to add the files g2_all.spec and g3_all.spec.

      tarquin> mathpha
      Expression to be evaluated[] g2_all.spec+g3_all.spec
      Units algebraic expression to be performed in (C,R,F or Help)[C] 
      O/p PHA filename[] g23.spec
      Exposure time flag/value ({value},{file},CALC,NULL or Help)[] CALC
      Areascal flag/value ({value},{file},NULL or Help)[%] NULL
      Number of comment strings to be added (up to 4)[1] 0
       ......... processing file: g2_all.spec
       ......... processing file: g3_all.spec
       ...  ... performing algebra in units of COUNTS
       WARNING - filop 2.1.0:
       ... Poissonian errors with N<20 assumed  for:
       ...... channels     1.-    7.
       ...... channels    21.-   49.
       ...... channels    71.-  128.
       ... written the PHA data Extension
       ** mathpha 4.1.2 completed successfully
  5. For the case where the same region filter in the detector coordinates is used for the source and the blank-sky background database, and the source and background exposure times are nearly identical for two the sensors, the two background files can be simply added. Sum the GIS2 and GIS3 background files using mathpha and specify the exposure=CALC, and backscal=NONE options. Otherwise, refer to §8.9.4
  6. Use the combined spectrum with the averaged ARF with either the GIS2 or GIS3 RMF. You may want to change the INSTRUME header keywords in these files with the grppha chkey command, or the FTOOL fparkey. Not doing so does not do any harm, but XSPEC will give warning messages.

8.9.3 For SIS

 

In the case of 1-CCD mode

  1. Extract SIS0 and SIS1 spectra and create each ARF as explained above.
  2. Create the SIS0 and SIS1 RSPs. To do so, combine the SIS0 ARF with the SIS0 RMF by using the FTOOL marfrmf. Although not mandatory, the product should be given the extension .rsp. Repeat for SIS1. For help on marfrmf, type fhelp marfrmf.
  3. Average the SIS0 RSP with the SIS1 RSP. This is done with FTOOL addrmf which requires, as well as the input RSPs, the weightings to be applied to each RSP. The weightings are simply the exposure time for each instrument divided by the sum of the two exposure times. Usually, the two sensors have almost the same exposure times, and the weights thus will be (0.5, 0.5). For help on addrmf, type fhelp addrmf.
  4. Add SIS0 and SIS1 source and background spectra as explained above for the case of GIS. Again note the additional complication of computing the correct background normalization in the general case (§8.9.4).
  5. Use the combined source and bgd spectra with the averaged RSP. Adjust the INSTRUME header keywords in these files, if you like. grppha can be used for this, with its chkey command. Not doing so does not do harm, but XSPEC will give warning messages.

In the case of 2-CCD or 4-CCD modes first calculate RSPs for SIS0 and SIS1, combining the RSPs for two or more chips as explained in §8.9. Then follow the procedure for 1-CCD mode.

8.9.4 Computing the Correct Background Normalization for Combined Spectra

 

If the background and the source spectra are made from different detector regions, the BACKSCAL keywords of the background spectra have to be re-written to ensure the correct background normalization. Due account must be taken of the correct weights for the region sizes and exposure times. Full details are given the document `Background Normalization' at the URL

http://heasarc.gsfc.nasa.gov/docs/asca/abc_backscal.html

8.10 GIS Deadtime Correction

 

GIS PH mode has a typical deadtime of about 8 msec per event. For bright sources, GIS deadtime will be significant and deadtime correction is necessary to obtain the correct incident flux through spectral analysis.

GIS deadtime can be calculated using the GIS monitor count rates. The mkf files created in the standard processing have two columns, G2_DEADT and G3_DEADT, in which the deadtime fraction values thus calculated are stored.

Using these deadtime fraction values, with the FTOOL deadtime, the deadtime correction can be done as follows. In this example the GIS spectrum is called g2.spec. As is usual for an ASCA spectral file, the first extension contains the energy spectrum and the second extension contains the GTIs. At the system prompt type

deadtime g2.spec+1 g2.spec+2 ft941222_1327_0210.mkf exposure=EXPOSURE 
deadcol=G2_DEADT

The EXPOSURE keyword in the spectral extension is overwritten with the correct exposure time taking deadtime into account. It is a good idea, when using deadtime, to verify that the value of EXPOSURE decreases due to the deadtime correction. (The FTOOLS grppha or fkeyprint can conveniently display the value of the EXPOSURE keyword).

8.11 Getting Started with XSPEC

 

XSPEC is a powerful and versatile spectral-fitting program. It is fully documented, with an extensive manual and on-line help which can be obtained at the URL

http://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/u_manual.html.
(local copy on this CD)

The following, which covers XSPEC basics, is a very brief guide to get you started.

8.11.1 Entering Data into XSPEC

 

Having typed XSPEC to start the program, there are two ways of entering data: with XSPEC commands, or with the header keywords in the spectral file. A third method, using a command file, is really a more convenient version of the first.

To illustrate these methods, we assume we have produced and obtained the following files for our SIS0-chip1 data:

mkn841_s0c1.pi source spectral file
back_s0c1.pi background file
mkn841_s0c1.arf ARF
s0c1g0234p40e1_512v0_8i.rmf RMF

Each of these files has a different XSPEC command which enters it into the program. These are:

XSPEC>data  mkn841_s0c1.pi 
XSPEC>backgrnd  back_s0c1.pi 
XSPEC>arf  mkn841_s0c1.arf
XSPEC>response  s0c1g0234p40e1_512v0_8i.rmf

These lines can be copied with a text editor into an ASCII command file data_s0c1.xcm, say, and run with the XSPEC command @data_s0c1.

Alternatively, you can write the names of the background file, ARF and RMF into the header of the spectral file with the FTOOL grppha. Keyword values are changed with the grppha command chkey. In our example, the following grppha commands would be used:

chkey BACKFILE  back_s0c1.pi 
chkey ANCRFILE  mkn841_s0c1.arf 
chkey RESPFILE  s0c1g0234p40e1_512v0_8i.rmf

Note that grppha will overwrite an existing file (rather than create a new one) only if an exclamation mark is put before the input file name, as in:

tarquin> grppha mkn841_s0c1.pi 
Please enter output filename[]!mkn841_s0c1.pi

More than one data file can be entered into XSPEC. For more information about the data command, consult the XSPEC manual or type help commands data at the XSPEC> prompt.

8.11.2 Ignoring Channels and Energy Ranges

 

It is nearly always good policy to exclude from a fit channels at the lower and upper ends of the pass band, where the instrument efficiency is low, the background predominant and the calibration less certain. The XSPEC command ignore causes channels to be excluded: ignore 1-40, for example, excludes channels 1-40, while ignore bad will exclude channels with a quality flag of 5. Note that the ignore command operates on regrouped channels, not on the original channels. Its inverse is the notice command.

Users can set quality flags themselves with grppha. Typing help quality at the GRPPHA> prompt explains how to do so.

Versions of XSPEC later than 9.0 allow the user to ignore or notice channels by specifying energy ranges directly. Thus

ignore 1-4:0.0-0.7

will ignore all channels in files 1-4 between 0.0 and 0.7 keV.

8.11.3 Defining Models

 

In XSPEC, models are built up from a suite of model components which are either `additive' (supplying model photons) or `multiplicative' (modifying the flux of model photons). To see a list of the models available in XSPEC, type model ?.

Models are defined with the model command. For example, the spectrum of a high-redshift quasar with both Galactic and intrinsic absorption might be defined by the command model wabs * zwabs (zpowerl). For help on the model command, type help commands model and for an explanation of an individual component, type, e.g., help model zwabs. Once the model command is entered, the user is prompted for the initial values of the corresponding parameters (a carriage return enters the default).

Parameters are fixed with the freeze command and unfixed with the thaw command. To change a parameter value, use the newpar command.

For more information about XSPEC models, please consult the XSPEC manual and on-line help. In particular note that major changes to model syntax were introduced in XSPEC v10.0.

8.11.4 Fitting Models

 

After defining a model and assigning initial parameter values, fitting is initiated by typing the command fit. If a minimum is not found after 10 iterations, the user is given the option of continuing or stopping - perhaps to reset parameters or to try a different model. When the fit converges, a summary is displayed on the screen giving the best-fitting parameter values and chi-squared.

The fit command has several options which you learn about by typing help commands fit at the XSPEC> prompt.

8.11.5 Deriving Errors

 

Although some errors are displayed at the culmination of a successful fit, these errors are approximate and should not be quoted in scientific papers. Instead, you should use the error command which initiates a further search of chi-squared space to find the width of the minimum in terms of parameter confidence ranges. For example, error 3 will find the 90 per cent confidence range for the third parameter, i.e., the values which cause chi-squared to depart from its minimum by an increment of 2.7. For more options, type help commands error.

8.11.6 Plotting Results

 

Plotting the results of a fit in XSPEC is a three-stage process:

  1. Choose the plot device with the cpd command. The choices can be seen by typing cpd ?. For most workstations, the device is /xw.
  2. Set the X-axis to be energy, wavelength or channels. Type either setplot energy, setplot wave or setplot channels.
  3. Plot the fit, residuals etc. There are two plot commands, plot, which simply displays the plot with the plot device, and iplot, which displays the plot as well as allowing the user to modify it. Several things may be plotted. For example, plot data residuals causes the data (with fit) to be plotted in a large upper panel, with the residuals in a smaller, lower panel. To view the options, type plot ?.

To make a PostScript file of your plot, use iplot rather than plot and type, for example, hard two_temp_fit.ps/ps at the PLT> prompt to create the PostScript file two_temp_fit.ps.


next up previous contents
Next: 9 TEMPORAL ANALYSIS Up: ASCA ABC Guide Previous: 7 FILTERS

Michael Arida
Wed May 7 18:10:27 EDT 1997