NAME

specmat -- Contstructs XSPEC compatible spectral data file and response matrix from source flux and position information generated by the "like" program


USAGE

        specmat miscdir datadir calibdir tempfildir outputdir exphistfilebase 
          outputfile likefile scalefacfile rmffil objnam evclass clobber


DESCRIPTION



Specmat is derived from the EGRET team "spectral" program. It can be used to construct an approximate detector count spectrum, and accompanying instrumental response matrix for an EGRET point (or compact extended) source determination. The spectra is ouput into an PHA type FITS file, which can be used by XSPEC, and manipulated by other HEASARC utilities. Similarly, the response matrix is written in RMF format (although it is not a normalized RMF; rather it has already been convolved with the instrumentaleffective area). Some informatio required for the spectrum and response calculations will have been previously performed by the "like" program. Specmat reads the exposure history file (ASCII) for the appropriate viewing period(s) to take into account the history of the EGRET telescope modes during the dtaa accumulation period, and the scale factor file (FITS) which accounts for changes in the detector gas quality over the course of the mission. The user should bear in mind that the spectral resolution of EGRET is coarse, on the order of 20-25% depending on signal-to-noise. Thus, typically ~10 spectral energy channels are output. In practice, only powerlaw, broken- or absorbed powelaw models have been resonably constrained by EGRET spectral measurement. However, the XSPEC compatible output formats facilitate the combination of EGRET data with other high-energy data for global spectral modelling.


PARAMETERS

miscdir [string]
name of directory containing timeline file

datadir [string]
name of directory containing catalog file, exposure history files, like file and scale factor files

calibdir [string]
name of directory containing FITS calibration files

tempfildir [string]
location to put temporary files generated during the program execution

outputdir [string]
name of directory for output files

exphistfilebase [string]
base name used to create the exposure history file names

outputfile [string]
name of the output file

likefile [string]
name of the input like output file

scalefacfile [string]
name of the scale factors file

rmffil [string]
name of the output RMF file

objnam [string]
name of the output PHA file

evclass [integer]
event class parameter. deterimines which categories (in terms of the reliability of their reconstruction) of EGRET spark shamber events are to be included. Typically this should be 2, which leads to the inclusion of class A and B events.

clobber [integer]
indicates whether or not to overwrite any existing output files


EXAMPLES



1. Make an EGRET detector spectrum (PHA file) and response matrix (RMF file) for the Crab pulsar (phase averaged), for viewing period 0.4 (i.e. CGRO commisioning phase). The point source analysis has been previously performed usling the like program. This results in the ascii file depicted below.

specmat.par

          miscdir,s,a,"/my_misc_dir/",,,"Directory for miscelaneous files:"
          datadir,s,h,"/my_egret_data_dir/",,,"Path to the input FITS files:"
          calibdir,s,h,"/my_egret_cal_dir/",,,"Path to the input Calibration files:"
          tempfildir,s,h,"/my_egret_cal_dir/",,,"Directory for temp calibration 
          files:"
          outputdir,s,a,"./",,,"Path to the output files:"
          exphistfilebase,s,a,"exphst_v01p",,,"Base for the name of the input FITS 
          Exposure History File:"
          outputfile,s,a,"Crab_vp04",,,"Name of the output File:"
          likefile,s,a,"like.file",,,"Name of the input ascii like output file:"
          scalefacfile,s,a,"scale.factor.fits",,,"Name of Scale Factor File:"
          rmffil,s,a,"Crab_vp04",,,"Name of the output RMF file:"
          objnam,s,a,"Crab",,,"Source ID"
          evclass,i,a,2,,,"EGRET spark chamber event class:"
          clobber,i,ql,1,,,"Do you want to delete any existing output files? (Yes):"
          mode,s,h,"ql",,,""

like.file:

          User-id : shrader
          Time run: Wed May 20 14:27:47 1998
          Source position (RA,DEC):    83.638    22.015
          Phase interval:           0.0000    1.0000
          Viewing period:     0.4     8377.7215277778     8380.6777777778
          
          .......emin......emax.......counts....counts_err.....zenmax..
                  30.0      50.0      260.53       42.39       82.183
                  50.0      70.0     1266.66       65.15       88.824
                  70.0     100.0     2109.81       78.91       92.307
                 100.0     150.0     1565.55       69.45       95.375
                 150.0     300.0     1777.12       64.49       98.222
                 300.0     500.0      776.03       38.81      101.866
                 500.0    1000.0      556.12       29.81      103.808
                1000.0    2000.0      229.67       18.03      105.000
                2000.0    4000.0      104.95       11.53      105.000
                4000.0   10000.0       31.19        6.14      105.000




FILES NEEDED

Examples of the files required, and the directories where they should reside are depecited below. The EGRET data and calibration files are available through the HEASARC Browse system, or via FTP at: <ftp://cossc.gsfc.nasa.gov/compton/data/egret/>.



          data_dir/like.file
          data_dir/scale.factor.fits
          data_dir/exphst_v01p.0040
          data_dir/catlog
          misc_dir/timeline
          calib_dir/edpfil01.fits
          calib_dir/psdfil01.fits
          calib_dir/sarfil01.fits




BUGS


SEE ALSO

CATEGORY

Mar02 ftools.gro