specmat -- Contstructs XSPEC compatible spectral data file and response matrix from source flux and position information generated by the "like" program
specmat miscdir datadir calibdir tempfildir outputdir exphistfilebase outputfile likefile scalefacfile rmffil objnam evclass clobber
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.
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
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