next up previous contents
Next: More Advanced Analysis Up: ROSAT Xselect Guide Previous: Spectral Analysis   Contents


Preparing for XSPEC, XRONOS and XIMAGE

Together, xspec, xronos and ximage are known as the xanadu software. These programs allow the detailed spectral, timing and spatial analysis of your data (in FITS format). A very brief introduction follows.

The xanadu software and installation guide can be found on the anonymous ftp area of under the /software/xanadu/ directory. For help finding or installing xspec, xronos or ximage software or manuals please email

Prior to XSPEC

There are just a few considerations prior to reading your FITS spectrum into xspec. If your source was observed on-axis, you may wish to use the standard on-axis response matrices which are already convolved with the on-axis mirror effective area and the PSPC gas transmission and window functions.

The ROSAT PSPC response matrices

The anonymous ftp /caldb/data/rosat/pspc/cpf/matrices/ directory tree on the machine contains various response matrices (and related products) for the ROSAT PSPCs.

256 PI channel detector redistribution matrices

The following matrices are 2-dimensional arrays (energy vs channel) containing the probabilities that a photon of a given incident energy which enters the detector will give rise to an event in a given PI channel. As such they are VALID FOR ALL REGIONS of the detector, but also require an appropriately constructed "Ancillary Response File" (ARF) to enable spectral analysis to be performed in xspec. (ARFs can be constructed using pcarf, as detailed above)

        - valid for PSPCB data taken BEFORE 1991 Oct 14
        - valid for PSPCB data taken AFTER 1991 Oct 14
        - valid for ALL PSPCC data (detector destroyed on 1991 Jan 25)

On-axis 256 PI channel response matrices (including the on-axis effective areas)

The following matrices are 2-dimensional arrays (energy vs channel) containing the above detector redistribution (probability) matrices BUT MULTIPLIED by the XRT effective area, window transmission etc appropriate for ON-AXIS sources.

        - valid for PSPCB data taken BEFORE 1991 Oct 14
          (formerly known as pspcb_92mar11.rmf)
        - valid for PSPCB data taken AFTER 1991 Oct 14
          (formerly known as pspcb_93jan12.rmf)
        - valid for ALL PSPCC data (detector destroyed on 1991 Jan 25)
          (formerly known as pspcc_92mar11.rmf)

Compressed, 34 channel matrices are also available in the same area, for use with the archival spectra stored in the RDF _src.fits files.

The ROSAT HRI response matrix

The HRI matrix can be found under /caldb/data/rosat/hri/cpf/hri_90dec01.rmf

Off-Axis Spectra

If your source was observed off-axis then you must make an ancilliary response file (ARF) for your spectrum and you should use grppha to group and set bad channel flags for the source spectral data (if you did not allow to the deafult grouping to be set when you saved the spectrum from xselect).


This program generates a Ancillary Response File (ARF) for the ROSAT PSPC instrument. The ARF consists of a simple 1-d list of the corrections required to be applied to the input detector response matrix during the spectral analysis of input PHA dataset. The ARF contains the weighted effective area, PSPC gas transmission, window and filter (where applicable) information, and is used in xspec in conjunction with the photon redistribution *only* matrix (in the past we have used matrices which held the convolved area and photon redistribution information).

** PCARF 2.0.0
Name of input PHA file[] target.sp
Name of input RMF file[/caldb/data/rosat/pspc/cpf/matrices/pspcb_gain2_256.rmf]
Name of output ARF file[target.arf]
Name of input SPECRESP or EFFAREA file[/caldb/data/rosat/pspc/cpf/pspcb_v2.

** PCARF 2.0.0   Finished

Notes & Warnings:

Grouping or Rebinning the Spectral Data


The raw 256 channels oversamples the PSPC spectral resolution many times so you may want to group up the FITS spectrum before analyzing it within xspec. This can be done using the grppha ftool. grppha sets a data grouping rather than actually binning the data. This means that the grouping can be changed as many times as required, while the original counts and error information remain available. In fact the data must not be rebinned using rbnpha or the resultant spectra will fail to match the dimension of the response matrices you will be using (xspec internally handles the binning of the response matrix to match the data grouping produced using grppha). xselect spawns the grppha ftool as you "save spectrum", it offers a reasonable setting for the bad channels, and a reasonable grouping, but you may wish to set your own grouping (note even if you allow xselect to set an initial grouping, you can reset this later using the 'reset group' command in grppha, so its a good idea to use the xselect default for the first quick-look)

grppha target.sp target_group.sp

grppha will first give you a summary of the keyword values set in your file. You may wish to change these in order to set defaults for the response matrix, ARF , background spectrum etc.

GRPPHA (): chkey ancrfile new_target.arf

GRPPHA (): chkey backfile target_bgd.sp

set default arf and background files for the spectral file.

Note Do not group up the background spectrum, xspec will handle the area rescaling and data grouping using the header information in both spectral files. xspec also automatically bins up the response matrix to have the same number of channels as the spectrum.

GRPPHA (): bad 1-8, 200-256

GRPPHA (): group 9-199 10

GRPPHA (): exit

The target_group.sp file will now give 19 channels when read into xspec.

If ARF, RESP and BACKFILE are not set in the source spectrum file header, then one can read them in at the xspec prompt.


In the case of the HRI spectra, the energy resolution is negligable and the response matrix for the HRI is a single channel matrix, while the data have 16 raw channels. In this case one should use rbnpha to bin up the 16 raw channels into the 1 resultant channel for which the HRI response matrix is calibrated. xselect offers this as a default upon saving HRI spectra, but you can run the task standalone


Please enter PHA filename[agn.pha]
Please enter output filename[] agn_bin.pha
Please enter Resultant number of Channels[10] 1
Please enter Compression mode[linear]
 Main RBNPHA Ver 1.0.9
 RBNPHA ver 1.0.9 completed

Reading the Data into XSPEC

Having prepared the spectrum, and any arf file if required, invoke xspec by typing its name

               XSPEC 9.00 16:25:16 14-Mar-96

  Plot device not set, use "cpd" to set it

  Type "help" or "?" for further information
 XSPEC> data agn.pha
  Net count rate (cts/cm^2/s) for file   1  0.2669    +/-  7.7344E-03
 XSPEC> ignore bad
 XSPEC> cpd /xw

the data are read in and the plot device is set. If you put the information as to where to find the response matrix, the background spectrum and (if in use ) the arf file in the primary spectrum file header, then you are now ready to define and fit a model spectrum to the data. If you did not define these things, then you can do so within xspec

 XSPEC> resp /cpf/matrices/pspcb_gain2_256.rmf
 XSPEC> arf agn.arf
 XSPEC> back background.pha
  Net count rate (cts/cm^2/s) for file   1  0.2441    +/-  8.2032E-03
( 92.6% total)

You are now ready for model definition and spectral fitting. For more details about xspec see the xspec users guide, available from legacy under /software/xanadu/xandis/manuals/xspec_7/

Reading the events files or time series into XRONOS

xronos can read the FITS binned light curves and the photon time files written by xselect. xronos can be used for detailed analysis of time series and photons events files, it contains routines to calulate power spectra, hardness ratios, cross correlation functions etc. The xronos tasks lc1, lc2 and lc3 are used to plot light curves in 1 to 3 bands (respectively). The user can set the number of output bins, and the data window. The tasks efs and psd allow data folding and fft calculation, while acf, acs, ccf and ccs allow auto-correlation and cross- correlation analysis and sta and tss allow a statistical analysis of the dataset.

A detailed description of xronos is beyond the scope of this guide, but further information can be found in the xronos users guide available from legacy under /software/xanadu/xandis/timing/xronos/help/

In this simple example, a time series is read into the lc1 program, which allows binning and plotting of a light curve (which can be made up of several files) as follows:

% xronos

Welcome to Xronos         

                       Type "help" for information

[1]xronos> lc1
> Program lc1         18-OCT-1994 11:48:13         Xronos vers. 4.02 Jul 94

Enter up to  50 input filenames and options for series 1 (or rtn)
lc1> Ser. 1 filename   1 +options[.rbf]=> test.curve

Selected FITS extensions: 1 - RATE TABLE;

Source ....... NGC 0000  Start Time (d) ....   601 16:22:03.000
FITS Extension  1 - `RATE` Stop Time (d) ...   605 02:38:43.000
No. of Rows ...         18        Bin Time (s) ......    200.0
Right Ascension                   Internal time sys.. Literal
Declination .....                 Experiment ........ ROSAT    PSPC
Filter ........ none
Corrections applied: Vignetting-No ; Deadtime-No ; Bkgd-No ; Clock-No

Selected Columns: 1-Time;   2-Y-axis;  3-Y-error;

File contains binned data.

 lc1> Ser. 1 filename   2 +options[.rbf]=>
 lc1> Window Options ?          {y/n}[n]=>

   0 Time,    0 Phase,    0 Intensity,    2 Exposure Windows

 Expected Start ...  601.68197916667  (days)  16:22: 3:0  (h:m:s:ms)
 Expected Stop ....  605.11021990741  (days)   2:38:43:0  (h:m:s:ms)
 Minimum Newbin Time    200.00000      (s)
 Maximum Newbin No..             1482
 Default Newbin Time  579.194 s (to have 1 Intv. of512 Newbins)

 lc1> Enter Newbin Time (s) or neg.rebinning
      of Min. Newbin Time [   579.2    ]=>

 Newbin Time ......     579.194     (s)
 Maximum Newbin No.     512    (or 1 Intvs. of 512 Newbins)

 lc1> No. of Newbins/Intv.  (max: 65536)
      {value or neg.pow.of 2}[      512]=>

 Maximum of  1 Intvs. with  512 Newbins of 579.194 s

 lc1> Order of polynomial trend removal
 lc1> Time axis units
        {0=s from start,1=s,2=h,3=d} [3]=>
 lc1> Enter output filename
      [xronos.qlc1                     ]=>
 lc1> Plot options ?            {n/y}[n]=>

Intv 1   Start  601 16:25:12
     Ser.1 Avg  13.01  Chisq  3608. Var  12.83  Newbs. 9
     Min  8.973    Max  20.08  expVar 0.3804E-01  Bins 18
             Light curve ready !
 Frme    1  Written to output file : xronos.qlc1

 To plot  vs. Time (days), please enter
 PGPLOT file/type: /xterm

Thus a light curve was rebinned to 512 output bins, plotted in an xterm window and saved to xronos.qlc1, ready for further analysis.

Reading the events files or images in XIMAGE

The FITS image output from XSELECT can be read straight into XIMAGE using the command :

XIMAGE> read/fits goodimage.fits

The events file requires some rebinning in order to read in the entire field-of-view

XIMAGE> read/fits/rebin=30 events.fits

XIMAGE> cpd /xw

XIMAGE> disp

sets the plot device to xwindows and displays the data.

If you don't have an X device then you could use the contour option:

XIMAGE> smooth[/sigma=3]

smooths the image with a Gaussian of sigma 3 bins. Then make a contour plot :

XIMAGE> contour[/first=2/no_of=10]

The optional qualifers make 10 linearly-spaced contours but this does not plot the lowest contour.

XIMAGE> contour/overlay

will overlay the contour on a previously displayed image.

There are many other useful things that ximage can do, e.g.

         slice/x - make a slice in the x direction (use the left, 
                   middle and right mouse buttons to select, erase 
                   and choose a y region to do the slice accumulation)

background/box=n - measure the background in a box of size n pixels

          detect - source detection (use /back=n, to vary the background 
                   box size)
             cct - change the color table

          circle - defines a circular region (can write to file)

            grid - draw a coordinate grid

ra_dec_to_pixel  - mark the image and return pixel for given RA and DEC

         psf/cur - measure the point spread function

        saoimage - spawn saoimage to display the image

      write/fits - write the current image as a FITS file

Notes & Warnings:

For further information regarding XIMAGE please see the XIMAGE users guide, available from anonymous ftp account under /software/xanadu/xandis/image/ximage/doc/

next up previous contents
Next: More Advanced Analysis Up: ROSAT Xselect Guide Previous: Spectral Analysis   Contents
Michael Arida 2001-09-20