PurposeThis guide is intended to provide a comprehensive overview of the processing and analysis of Chandra data obtained with either of the Chandra X-Ray Observatory's transmission grating instruments (HETG or LETG). It will provide a description of the tools, data, and processes in the contexts of pipeline processing, data-quality assessment, re-processing, and analysis. It will cover some of the special instrument modes, such as ACIS CC-mode, or blocked zero-order cases. It will also give examples of common problems and their solutions. This guide is not a detailed reference manual. To that end, the help-files are available for each tool and provide an explicit list of all input and output files and control parameters. Manuals for other components of the system, set-by-step threads, and useful scripts are also available. These will be referenced here. Intended AudienceIt is assumed that the reader is already familiar with the basics of Chandra data products (such as an event-list) and the CIAO suite of software. Some additional information will be given here as it pertains to the high-resolution spectra, but for the fundamentals of CIAO, data-model, sherpa, CHIPS, event-files, filtering, etc., please refer to the material in your local CIAO distribution (e.g., $ASCDS_INSTALL/doc/html/chips/index.html, or $ASCDS_INSTALL/doc/html/doc/html/sherpa/index.html), your contextual ``ahelp'' files (e.g., ``ahelp dm''), or the CIAO web-based material (http://cxc.harvard.edu).This guide is intended to be a ``living'' document, and will be updated as frequently as required. It will hence be available on-line only, and provide links to detailed information. The most recent version of this document will be available at http://space.mit.edu/CXC/analysis/AGfCHRS.html. If there is information you would like to find here, please contact me. Concepts and ResourcesInstruments' BasicsFundamental theory and operation of the Chandra diffraction grating instruments are given in the Proposers' Observatory Guide (POG). Such useful details as effective areas, spectral resolution, background levels, can be found there.Instrument ModelsThe MARX simulator is the calibration model for HETG, but it also simulates LETG and any combination of grating and focal-plane cameras. The output is event-based, and utilities exist which can format output into FITS event files and an aspect solution, which can then be processed with CIAO tools.Models can also be found in the form of ``off-the-shelf'' responses, particularly as a Response Matrix File (RMF) and Auxiliary Response File (ARF) (see proposal planning files; grating RMFs are also in the CALDB). Chandra DictionaryA collection of terms and definitions can be found in the Chandra/CIAO Dictionary. See this on-line list to bone-up on your acronyms, to review the difference between a Response Matrix, an Auxiliary Response, or a Spectral Response Matrix, or to see what is in a Chandra event-list.CIAO BasicsThe basics (and details) of CIAO (``Chandra Interactive Analysis of Observations'') can be found on-line at CIAO Home.If you have CIAO installed, here are some example help commands which summarize grating processing tools:
CIAO Threads and ScriptsSome commonly-performed sequences of operations have been written as ``threads,'' which are specific instantiations of CIAO commands, with supporting commentary. The scripts are threads, or parts thereof, which have been written in a shell-language (usually sh) to perform a more general function, using command-line arguments. These are not part of your distribution, but are available on-line. Useful grating threads and scripts will be described below, and links provided.Processing OverviewProcessing of Chandra high resolution spectra can be divided into two major areas: pre-PHA and post-PHA. Pre-PHA encompasses all the event and aspect processing required to assign wavelength coordinates and to compute responses. The event-list with grating coordinates can be binned into the counts spectrum, or ``PHA'' file. Post-PHA proccessing is the application of responses and measurement of the binned spectrum to derive source properties and physical source models consistent with the observed spectrum.
The three panels correspond roughly represent the levels of processing. The pipeline does most of the first two (omitted are: destreak, mkgarf, asphist, and mkgrmf (mkgrmf is ciao new for 2.2)); the bottom panel is user analysis. In the diagram, ovals represent processes and are labeled with tool names. The rounded-corner rectangles represent calibration data, and the square-cornered rectangles represent data-products. Not all inputs, outputs or control parameters are shown (see the detailed help files). Observers receive a binned spectrum from the pipeline as a standard product. They may not need to use the event file, but may take the ancillary products (such as aspect solution, bad-pixel list), make responses, and proceed with spectral analysis. However, improvements in calibration, discovery of bugs in the system, or improved analysis techniques may require re-processing of the events. Or healthy scientific skepticism may generate interest in details of the event processing and files in order to verify the products and better understand the quality, limitations, and potential of the data. So these steps and data will be described, but the first look may skip past the events and go right into spectral analysis using the binned spectrum. [At the time of this writing (October, 2001), the pipelines do not compute grating effective areas (ARFs). We are evaluating whether we can add this step to the pipelines.]
Event ProcessingGrating Event Coordinates``Level 1.5'' processing refers to the determination of zero-order centroids, definition of spectral regions, and computation of diffraction coordinates. The resulting products are a source table, an augmented event-list, and a spatial region, with the event-list being the fundamental product. (The standard product has the region converted to FITS format and appended to the event file.)The spatial region is used to classify the ``Level 1'' events geometrically according to the part of the spectrum in which they fall. Using the aspect solution, the instantaneous transformation is done using the event's three-dimensional chip coordinate, projection of zero-order centroid from sky to chip, location of the grating node, grating facet mean characteristics, and camera location along the translation direction (SIM_Z). If the detector is ACIS, the energy resolution is used to sort orders, according to a spatially-dependent detector response calibration file. The attributes of each photon thus determined are appended to the event-list as new columns. These columns are (TG stands for ``Transmission Grating''):
Spatial Region FilesThe geometry for LETG and HETG spatial regions is shown schematically in the following two figures. Since positive spacecraft roll rotates the grating arms clockwise in the sky x-y pixel-plane, these examples are for rolls of a little less than 180 degrees, and negative orders are to the right.By default, tg_create_mask generates region sizes which are wide enough in the cross-dispersion direction to contain both source and local background. When binning (see about PHA files below), sub-selections are made with smaller cross-dispersion widths. ![]() ![]() Details of the ASCII region format are here. The FITS format is much more general, and more generally supported. For example, regions in this format can be used as Data-Model filters. An example columns and contents of a region FITS file are here. The ASCII regions can be converted to FITS (and optionally appended to another file) with dmrega2fits. Zero-order Region and Source DetectionThe zero-order region is a circle centered on the brightest source detected near the aim-point. Pipeline processing only searches for one source. The region size is adjusted to be many times larger than the local point-spread-function. Parameters to tgdetect may be customized to generate source tables for multiple sources, or other sources in the field, and then input to tg_create_mask to make multi-source spatial region filters. Tgdetect uses the more general celldetect program, but adds a few control parameters. One important one is snr_ratio_limit, which specifies the faintest sources to detect, compared to the brightest. It must be set to less than 1.0 to detect additional sources in the field.Aspect Dither, Aspect Offsets, and Coordinate TransformationsThe spacecraft pointing is intentionally ``dithered'' in order to spread signal over large regions, relative to a detector pixel, since the PSF is comparable to a pixel, but the efficiency calibration has a larger scale. A source image in detector coordinates will show a lissajous pattern with periods of about 1000 seconds (or a filled square, if the exposure is much longer).In addition to controlled motion of the optical axis, there is uncontrolled (but measured) thermal flexure of the optical bench, resulting in science instrument module (SIM) motion. The six aspect parameters are stored in the aspect solution (asol) file, and in an aspect offsets (aoff) file. The latter differs in units, storing the optical axis coordinates as a difference from the mean value in detector pixels. Grating event coordinates are computed by using the aspect solution to project the zero-order sky centroid onto the detector at the time of each event, then solving for the diffraction coordinates using the chip coordinates (in 3 dimensions) of the detected photon, the zero-order location, and grating geometry. Source TableThe source table (src1a.fits file) for grating observations differs a bit from the non-grating source case. The table contains an explicit additional column, TG_SRCID, which gives a source number. An implicit difference is that if there are multiple observation intervals (``OBIs''), then the table is formed by merging each OBI's table with the previous using source-matching to form a unique source identifier column. This is because all OBI's are merged later in the processing, and we want one binned spectrum for each source, not multiple.CCD PHA, Gain, Energy, and Order-SortingDiffraction gratings disperse light into multiple orders, according to the one-dimensional grating equation: order*wavelength = Period * sin(diffraction_angle). At any diffraction angle, different wavelengths overlap. CCD energy resolution is enough to separate orders, and hence, determine the wavelength and order for each photon (TG_M and TG_LAM in the event file) using the dispersed coordinate (TG_MLAM) and knowledge of the CCD resolution and photon's CCD low-resolution energy.The CCD gain is the calibration quantity which relates the detected signal (``PHA'') to nominal (or blurred) energy (ENERGY column in the event file). The gain depends upon the CCD, the CCD quadrant, and upon x,y location within the quadrant, and to some extent on energy. The gain also depends on epoch, mainly through operating temperature. The blurring of the input photon energy to CCD detected ENERGY is stored in the Response Matrix Function, whose width, like the gain, also depends upon CCD and event location within the CCD. Grating event order sorting is done by taking the ratio of the diffraction order*wavelength (uniquely determined from the diffraction angle) to the CCD ``wavelength''. If the value is within the CCD resolution of an integer value, then that integer value is assigned as the order. The expected boundaries in CCD energy vs energy are pre-computed for each CCD, and for each position on each CCD. The tables are called ``osip'' files, for ``Order Sorting and Integrated Probability''. They are maps vs chip position of the CCD main peak's energy width vs energy. The widths are approximately 3*sigma of the Gaussian fit to the main peak of the CCD response. Since the CCD resolution changes substantially with CHIPY, the width of the 3*sigma region is asymmetric in plus and minus orders. We have tuned the widths slightly from 3*sigma to accomodate gain correction inaccuracies and order crowding. The software truncates any overlap at the halfway point (i.e., order 2 is always from ratios between 1.5 and 2.5). It is possible to bypass the OSIP tables and to specify order-sorting limits which are constant with wavelength (see the order-sorting figures below), via the osort_hi and osort_lo parameters of tg_resolve_events. Prior to definition of the OSIP tables, a position-independent order-sorting table was used. This had widths dependent on CCD_ID, since the CCD energy resolution can change abruptly between chips (e.g., Front Illuminated to Back Illuminated). This table is somewhat broader than the OSIP, and also allows a user-selectable ``fudge-factor'' on the width. This can be somewhat more forgiving for troublesome data (unstable gain, CC-mode). However, the effective area is not calibrated for arbitrary ``fudge-factors''; this should not matter increased widths, but may for smaller regions which truncate the PHA distribtions. The old-style file is termed ``IRMF'', for Integrated Response Matrix File (but is NOT a response matrix). The fudge factors are the energ_lo_adj and energ_hi_adj parameters to tg_resolve_events. LETG/HRC-S and Overlapping OrdersThe HRC detectors have little energy resolution. Overlapping orders cannot be sorted. The TG_M column is either -1 or +1, and TG_LAM=abs(TG_MLAM), to preserve consistency in format with the HETG event file.Graphical Examples![]() ![]() ![]() ![]() ![]() Event FiltersThere are some events which can easily be identified as being of other than cosmic origin (source or background). Some are routinely filtered out of the Level 1 file to make the Level 2 events file (*evt2.fits), and before binning spectra. Others are either more subjective, or not well enough understood yet to be done automatically. Some important filters are:
Binned Spectra (``PHA'' Files)After events have been resolved and filtered, they can be binned into one-dimensional counts histograms. If the detector is ACIS, they can be further separated by grating and order. The histogram files are called ``PHA'' files for historical reasons. ``PHA'' originally stood for ``Pulse Height Analyzer'', or ``Pulse Height Amplitude.'' Today, it refers more to a file format for storing binned spectra. We have adopted two such standard formats, PHA ``Type I'' and ``Type II'' FITS files, but added some Chandra-specific components.``Type I'' files have sequential channels stored in sequential rows, and the corresponding counts in another column. ``Type II'' is a transpose of this: the COUNTS and CHANNEL columns are array columns. For a single-spectrum file, there would be only one row. ``Type II'' is the default for Chandra grating spectra, since each observation is comprised of at least two orders (LETGS). For HETGS, we bin from -3 to +3 for two gratings by default, and thus have 12 counts histograms per observation. Instead of creating 12 files, we use one Type II format. The CXC program used to bin Chandra spectra is tgextract. Extensions to the Standard FormatsWe have added a few useful fields to the PHA files.
Default Spectrum GridsThe default grids for binned spectra were chosen to be easy to remember and to slightly oversample the resolution. The first order grids are:
Coarser gridding, if desired for lower signal data, may be obtained with parameters to tgextract, or by applying ``grouping'' during a fit. If the detector is ACIS, then orders -3 to +3 (excluding 0) are binned into the standard PHA file. If the detector is HRC, then the orders are called -1 or +1; it must be understood that these are the sum of overlapping orders, to be deconvolved (if necessary) through modeling. Summary of Grating-specific Reference DataThe following table lists the most important calibration database files used in processing events up to binned spectra.
Cases Requiring Customized ProcessingACIS, CC-ModeACIS can be run in Continuous-Clocking (CC) mode for high time resolution. Spatial information in the cross-dispersion direction is lost. We can still process HETGS data, however, into binned MEG and HEG spectra. In this mode, orders still separate according to pulse-height. The odd-orders' pulse-height regions are unambiguously from MEG. If even, we assume to be HEG since MEG even order efficiency is low (e.g., MEG ``2nd'' order is really mostly HEG 1st; MEG ``4th'' is really HEG 2nd, and so on). The pipeline applies an iterative step in processing CC-mode, first assuming events are from MEG, and guessing the CHIPY position given the zero-order position and CHIPX, then if the order is odd, it re-resolves it assuming HEG.ACIS, Blocked Zero OrderFor some bright sources (such as X-Ray binaries), the zero-order region is blocked via on-board software. If ACIS is in timed-exposure mode, then the best way to determine the zero-order sky centroid is from the intersection of the frame-shift streak and the MEG trace. To provide a template for editing, tg_create_mask can be run (with possibly adjusted parameters) to create a mask for some bright point in the spectrum (this uses the observational configuration and produces regions with the correct roll). Then the output file can be edited manually to offset the centers of the source and order regions.If ACIS is in CC-mode and zero order is blocked, there is no frame-shift streak. In this case, one may be able to use an initial guess, then refine the position by bisecting the detector silicon edge features in the spectrum, or by bisecting hyperbolas in ENERGY vs X,Y plots. Neither of these work-arounds has been implemented automatically. These modes require intervention to create a valid region file (usually done with tgdetect and tg_create_mask), after which processing can proceed as usual with tg_resolve_events. Pileup/Zero Order Centroid ErrorFor ACIS, bright zero-order sources can have severe pileup. (Pileup is the coincidence of multiple photons in the same pixel during an ACIS frame-time.) Severe pileup can distort the zero-order image profile and cause the centroid to be erroneous. Symptoms of pileup are an image which has the central peak suppressed or missing.If the centroid is erroneous, then the wavelength scale will be offset in an antisymmetric fashion in each grating. Offsets can be different in HEG and MEG, depending on the direction of the zero-order centroid error. This error can be handled by either manually editing the zero-order centroid (in the src1a.fits file or in the region file), or by averaging the wavelengths of plus and minus order feature measurements. Multiple SourcesPipeline processing is only designed to process the brightest source in the field. Multiple sources can be detected and a region mask constructed by manual configuration of tgdetect to specify the region of interest and a signal-to-noise ratio factor down from the brightest source found.Tg_create_mask will create masks for up to 10 sources. Tg_resolve_events will apply this mask and attempt to resolve orders and sources in spatially confused regions by the CCD pulse-height, which for some source configurations can result in unambiguous identification. The resulting event list has columns for the source ID, and a column which has bits set (a source map) to indicate other all possible sources, if the event is not resolved. Quantitative use of these ambiguous events is left to the user. Extended SourcesExtended sources present special challenges to dispersed spectra. Techniques will be refined and incorporated into CIAO as experience accumulates. Currently, all extended source grating observations are processed by the pipelines as if they were point sources. Custom user reprocessing is necessary, whose nature depends upon the source extent and the information desired.Some help is available with current tools. For example, tg_create_mask can be run for one grating arm (HEG or MEG), which may be desired to omit collision of HEG and MEG near zero order. Then, the mask widths can be manually edited to make them very wide (or the width_factor_arms used to expand the region). Thus, tg_resolve_events will order-sort photons within that region, and they can be binned with tgextract for customized cross-dispersion regions. Note, however, that the wavelengths are determined for a zero order point. Interpretation of wavelengths is ambiguous. Also, mkgarf computes the ARF for a point source. We currently have no provision for extended source grating ARFs. High-Resolution Spectral ResponsesThere are two fundamental components to the spectral response: the effective area, and line-spread-function (LSF). We represent these in the FITS formats (defined in various OGIP (Office of Guest Investigator Programs) memos) as the Auxiliary Response Function (ARF) and Redistribution Matrix Function (RMF). The ARF is effective area vs. energy function. The RMF is the probability vs output channel for a given input energy. We store both in the traditional format as a table in increasing energy order, but we use grids which are linear in wavelength, since the gratings disperse linearly in that coordinate.The ARF is observation dependent, since it depends upon the zero-order position and dither pattern, which determine the mean position of wavelengths on the detector (whose QE(E) depends upon position) and the history of position with time. The RMF is weakly dependent upon the observation, particularly for HRC-S, whose 3-plate geometry deviates significantly from the ideal focal surface. The grating ARFs can be made with the program, mkgarf. Since each detector element is independent and can have its own live-time, mkgarf works on one chip at a time. Some useful Grating Spectroscopy Scripts package multiple runs and the final merging. Until CIAO 2.2, grating RMFs were on-the-shelf (in the calibration database). With CIAO 2.2, custom RMFs can be made with mkgrmf. The customization is primarily in the choice of grids and spectral regions, but this important to facilitate analyses which use non-default wavelength gridding. Mkgrmf also incorporates effects due to off-axis angle and cross-dispersion width on the LSF. The rigorous definition of the responses can be found in Davis (2001). Summary of Response Generating Software and Data
Response Gridding IssuesGenerally, the energy grids of and ARF and RMF must match, and they should be at resolution high enough to separate important features of the models. In practice, for convenience, and since the grating spectrometers are high resolution, we make the PHA, ARF, and RMF have the same energy grids. The PHA grid should still be thought of as a ``smeared'' wavelength grid, and the ARF and RMF as having the model grids. It is a convenience of high-resolution that we can make them the same (usually; see Spectral Analysis).Spectral AnalysisSoftware PackagesIn-HouseThere are many options and modes for spectral analysis. ISIS is a stand-alone, S-lang based package especially developed by CXC for analysis of Chandra grating spectra and as an interface to the Astrophysical Plasma Emissivity Database (APED). ISIS is programmable and extensible. It can also do more than high-resolution spectroscopy; J.Davis has implemented a pile-up model for imaging CCD spectroscopy which is now part of the ISIS distribution.GUIDE is the initial implementation of S-lang based high-resolution spectroscopic functions in the integrated CIAO software. CIAO has a larger suite of generalized fitting routines (Sherpa) and a FITS output model format (Model Descriptor List, or MDL file). CIAO 2.2 has a fully integrated S-lang interpreter, and will allow direct import of ISIS modules to extend or replace GUIDE. While ISIS can be imported, connections have not yet been made between underlying libraries (that is a major CIAO 3 effort). Out-HouseSome third-party options for spectral analysis and modeling are: PINTofALE, CHIANTI, SPEX, XSPEC, XSTAR.Spectroscopic Analysis Methods and IssuesAnalysis of high-resolution spectra is best done on a feature-basis, rather than by global fits. For example, one could perform fits of APED models to an entire HETG spectral order (or orders) in XSPEC. However, the data are now richer than the models, and the fit can easily be meaningless in terms of individual line features due to small inaccuracies in wavelength or emissivity. Instead, the preferred approach is to identify and measure individual features or small groups of features, and to then fit those results with physical models, such as for determination of differental emission measures, abundances, or densities. (Global fitting may still serve adequately to characterize contnuua.)Some Miscellaneous Items
Calibration issuesInformation on the HETGS calibration status and accuracy can be found at HETG User Information page. LETGS information is on the LETG User Information page.
MIT Center for Space Research NE80-6023, Cambridge, MA 02139 dph@space.mit.edu Updates: 2001 February 26 2001 June 7 (added table of contents) 2001 October 2 (CIAO 2.2 revisions) |