Spectral modeling

Extract the photons for a source in XSPEC format. Create an rmf file for your source. G. Chartas recommends the following procedure:
  1. Locate the ACIS calibration spectrum obtained at a time near to the date of your observation.
  2. Fit the calibration lines and create an ASCII Electron Cloud Distribution file (called "source.ecd" here) with four columns. Example: where the columns are:
    1. Known energy of the calibration line in keV
    2. Number of counts under the line
    3. Energy of the line in ADU units
    4. Sigma of the Gaussian fit to the line width in ADU units.
  3. Change your UNIX path as follows:
  4. Create an *.rsp file:
  5. Convert the rsp file to an rmf file for XSPEC:
Another procedure to extract a spectrum and build an arf and rmf file is given in a CIAO Science Thread. Be sure to look at their Important Caveat.

Following is a procedure developed by Y. Maeda and Y. Tsuboi which creates rmf and arf files for a specific region of a specific observation including CTI correction, based on on-board calibration obtained under the same conditions (e.g. focal plane temperature) as the observation.

  1. Starting with an event FITS file of an ACIS chip or region that is corrected for CTI, create another event file with a column labeled "PI" derived from the column labeled "ENERGY" using the FTOOL fcalc: Editor's note: the factor 3.65 may not be correct here, but it does not matter if the *arf and *rmf files are used in a consistent fashion.
  2. Extract the PI values for the source region(s) of interest using CIAO dmextract; e.g. for source #22
  3. Find the pixel coordinates of the source in tiled detector coordinates using CIAO dmstat. In this case, the mean coordinates are (TDETX,TDETY)=(4087,3992). Also, record the chip number, in this case ACIS-I2.
  4. Obtain a calibration dataset from the same orbit as your observation. Correct it for CTI effects, grade selection, etc. in the same way as the observation dataset was treated. Make a new FITS file with a PI column as above. The file name might resemble ccd0123_g02346.1.evt. Extract from it a moderately wide region around the same location as the source of interest: e.g.
  5. Check that at least ~1000 counts are available in this region:
  6. Find the peak channels for the Al, Ti, and Mn K-shell lines using XSPEC. But first group the PI channels from 4096 channels to a smaller number (e.g. 512 channels) using grppha. Some intermediate steps in XSPEC (e.g. inspection and selection of appropriate channels) are omitted here.
  7. Make an ecd (Electron Cloud Distribution) ASCII file using a UNIX editor with the line energies and corresponding channel values and widths; e.g.
  8. Create a response file using rspgen:
  9. Convert this to a FITS rmf file using FTOOLS rsp2rmf:
  10. Make an arf file using CIAO's mkarf. You will need the aspect file for this chip.
You now have an rmf and arf file designed specifically for source #22 with CTI correction. Proceed to standard interactive XSPEC analysis.

G. Chartas has written an IDL scipt XPSF that modifies arf files generated by mkarf to account for the dependence of photon scattering with energy. This effect may be important whenever small extraction regions are used in spectral analysis. One application of this tool is performing spectral fits to piled-up spectra. A spectrum extracted from an annulus centered on a piled-up source will be less affected by pile-up. XPSF simulates the effective area (EA) of CHANDRA for a specified location and extraction region and source morphology using XSPEC and MARX.

Copy the following the files xpsf.pro, xpsf.par, and par_get.pro to your local working directory. Edit the parameter file xpsf.par (e.g. using CIAO pedit) to supply the name of the existing arf file (arf), the arf file to be created (new_arf), the inner and outer radii of the extraction region in ACIS pixels (xtrad_in, xtrad_out), and the MARX output directory (OutputDir), and the source offsets in arcmin. These last quantities are SourceOffsetZ = (sign)(Y_source - Y_focus)* 0.492/60. (arcmin), and similarly for SourceOffsetY, where 1 ACIS sky pixel = 0.492 arcsec and SourceOffsetZ is positive going from I1 towards I3 while SourceOffsetY is positive going from I3 towards I2.
Run the program:

In the plot that appears, the top panel is the arf correction function that will be applied to the existing arf file, and the bottom panel shows the effective area with and without extraction regions (normalized). If you notice to many fluctuations in the arf correction function you may want to increase the signal to noise by increasing the normalization parameter of "xspecparam" in xpsf.par.