back to HETG at XRCF


This page and links discuss and demonstrate the use of XSPEC for HETGS data analysis. More detailed discussions of these issues are available from the ASC/MIT.

The XSPEC software ( manual at GSFC, local MIT copy) is a very useful tool for the analysis (model fitting) of spectra. "Spectra" here means "counts vs. detector energy channel" histograms. The HETGS data (events(Y,Z,PHA,t), aspect solution, etc.) will be analyzed to produce such spectra; these histograms (HEG, MEG, orders 1,2,3, etc.) will be the main product for most observations.

The HETGS system that transforms a source spectra into a count-channel histogram is made up of astrophysical (source), hardware (observatory), and software (analysis) components. Changes in any of these can produce a different histogram output for the same input spectrum.

HETGS and XSPEC diagram

XSPEC encodes this system transfer function in two types of "response matrices". The first is an ".arf" file that is the Effective Area in cm2 vs. energy. It is stored in a three column FITS file giving the E_lo, E_hi, and Area for each energy bin.

The second matrix is an ".rmf" matrix that for each energy bin gives the resulting distribution of counts in the channels. For grating histograms the channel is derrived from the dispersion distance. The ".rmf" matrix is then largely equivalent to the 1-D Line Response Function of the HETGS. When order selection is accomplished with the ACIS-S energy information, the HETGS .rmf file is concentrated on the diagonal.

Linearity is assumed in this encoding of the system:

  histogram( spectrum_1 + spectrum_2 )  = 

                            histogram( spectrum_1 ) + histogram( spectrum_2 )
Note, however, that an effect like pile-up is not linear.

It is important to note that because of the dependance of the response and therefore the response matrices on so many effects, the response matrices are created with application to specific cases, for example the HEG and MEG response matrices below are assuming "point-source, nominal aim point, all first-order events selected, full cross-dispersion region used, etc.".

Work to create these matrices for the HETGS instrument and observations is on-going at MIT/ASC. The spatial nature of the "channels" may suggest slight changes to these methods. For example, because there are spatial gaps in the detectors, gaps (or reduced count regions) appear in the counts-channel histogram. It may be convenient to define a "channel space" .arf file that is applied after the .rmf matrix and is essentially a 1D "spectral exposure map".

Faking HETGS spectra

Given response matrices to specify the system, XSPEC can create simulated data files, ".pha" files. For example, the following XSPEC script file creates a model spectrum approximating the Carbon continuum spectrum ("featureless continuum" above 1 keV) at XRCF and then creates a simulated 135 second data file.

HETG response matrices are available about two thirds of the way down the ASC NRA News and FAQs web page.

Getting Data into XSPEC

Because the XSPEC .pha files are FITS format they can be read and written by a variety of FITS s/w. The tricky part is getting all the header information correct - for this it is convenient to create a simulated file (above) and then use that as a template for the header information. An IDL procedure that does this, xspec_write_pha.pro, is given here (and in ~dd/idl/xrcf/ at MIT.)

Analyzing HETGS data

With the HRMA, HETG, and ACIS-S all present and operating at XRCF we were able to get realistic HETGS data. One test devised to verify/improve our calibration of the HETGS is the "molecular contamination" test. In this test, a smooth, featureless continuum is observed. The resulting histogram will have all the instrumental spectral features in it (edges, detector gaps, etc.) and can be examined for unexpected ones as well.

The HETGS observation of the carbon spectrum, TRW ID H-HAS-MC-3.010, was analyzed using IDL to extract an array of first-order HEG event energies (disp_E(disp_select)) which were then binned into an XSPEC .pha file (at MIT: ~dd/xspec/carbspec_real.pha). The total detected first-order HEG count rate was ~280 counts per second.

To avoid pile-up the ACIS-S was operating in continuous-clocking mode - as it will be used when observing bright galactic sources. The total modeled 1-10 keV flux here is 4.4 x10-8 ergs / cm^2 s - comparable to SCO X-1 .

In fact the carbon continuum source was not so featureless - many emmission lines are seen due to source contamination. These lines and other features are discussed with the closeup plots below.

MIT Accessibility