Last modified: 24 Apr 2013

URL: https://cxc.cfa.harvard.edu/ciao/threads/mkgrmf_hrcs/

HRC Grating RMFs

CIAO 4.15 Science Threads


Overview

Synopsis:

mkgrmf generates a grating RMF (gRMF) appropriate for spectral analysis of grating observations. The tool can be used either to create a standard gRMF with the most up-to-date calibration or to calculate a gRMF using non-standard grids.

Purpose:

To create an observation-specific gRMF for an on-axis HRC source

Related Links:

Last Update: 24 Apr 2013 - Add pointer to new mktgresp tool.


Contents


About the Chandra Grating Data Archive and Catalog

The Chandra Grating Data Archive and Catalog (TGCat) is a browsable interface to analysis-quality spectral products (binned spectra and corresponding response files). TGCat makes it easy to find observations of a particular object, type of object, or type of observation, to quickly assess the quality and potential usefulness of the spectra with pre-computed graphics or custom-generated plots of binned and combined counts or fluxe spectra. Spectra, responses, event files, and summary products may be downloaded as a package.

TGCat runs standard CIAO tools, but also includes customized extractions for non-standard cases to refine the zeroth order position or to use regions appropriate for extended sources. Non-standard extractions details are provided in "verification and validation" comments for users.

Most public grating observations are available and new ones are added soon after they are released. See the list of of observations not included for exceptions. Many of the observations currently in this list will be included when we add enhanced processing for more difficult cases (multiple sources, very extended sources).

Please consider using the spectrum and responses (PHA, ARF, and RMF files) from TGCat in your analysis.


Repro V (5) data

Datasets which have been processed as part of Repro V (5), and those recently obtained data processed with ASCDSVER=10.8.3 and newer include grating ARFs and RMF files for the source spectrum extracted in the pha2 file. These files are located in the primary/responses directory.


Script It

The creation of the grating ARF and RMF is now automated.

chandra_repro will now automatically create the RMF and ARF for grating spectra. The results are stored in a tg/ subdirectory of the output directory.

Also, the mktgresp tool will create all the ARFs and RMFs for the grating spectra in a type II PHA file using the default grids and standard calibrations files. Just simply run

unix% mktgresp pha2 evt2 root_filename

where pha2 and evt2 are the filenames of your spectra output from tgextract or tgextract2 and the corresponding event file.

[WARNING]
Thread Complete

If you have run chandra_repro or mktgresp then you are done with this thread and may move onto fitting and modeling your spectra. If you need to customize your responses or want to learn more details of the step by step processing steps you can continue with this thread.


Get Started

Download the sample data: 460 (LETG/HRC-S, 3C 273)

[NOTE]
Early dataset

The data used in this thread was taken very early in the Chandra mission. It was not included in the bulk reprocessing metioned in the Watchout page. The keywords required for analysis with CIAO need to be added by running chandra_repro or r4_header_update.

Make sure that you have set up ardlib to use the bad pixel file for your observation before following this thread.

About the calibration files

The calibration files used by mkgrmf (LSFPARM files) are labeled as +/- 1 order:

unix% ls -1 $CALDB/data/chandra/hrc/lsfparm/
hrcsleg1D1999-07-22lsfparmN0002.fits
hrcsleg-1D1999-07-22lsfparmN0003.fits
hrcsleg1D1999-07-22lsfparmN0003.fits

The 1st order LSF scales nicely at higher orders, however, allowing mkgrmf to build higher order gRMFs based on 1st order model. If you request a higher order response file, a message of this form will be printed:

WARNING: Unable to find a row with TG_M=2 --- rescaling TG_M=1 region

The tool looks for a 2nd-order calibration file and, failing to find one, chooses the 1st order LSF and builds the gRMF based on it.


Off-axis Angles

The LSFPARM data is calibrated for on-axis or "near" pointings (within 1-2 arcmin radius of the axis). mkgrmf is not useful for observations with an offset of more than 2 arcmin as the calibration does not take into account the broadening introduced at larger off-axis angles.


Run mkgrmf

Here we create a +1 order gRMF with standard grids:

unix% punlearn mkgrmf
unix% pset mkgrmf order=1
unix% pset mkgrmf grating_arm=LEG
unix% pset mkgrmf outfile=leg_p1.rmf
unix% pset mkgrmf obsfile="hrcf00460_repro_evt2.fits[EVENTS]"
unix% pset mkgrmf regionfile=hrcf00460_repro_pha2.fits
unix% pset mkgrmf detsubsys=HRC-S2
unix% pset mkgrmf wvgrid_arf=compute
unix% pset mkgrmf wvgrid_chan=compute
unix% pset mkgrmf clobber=no
unix% mkgrmf
Output File Name (leg_p1.rmf): 
Enter ARF side wavelegth grid [angstroms] (compute): 
Enter channel-side wavelegth grid [angstroms] (compute): 
Enter Grating order (1): 
Name of fits file with obs info (hrcf00460_repro_evt2.fits[EVENTS]): 
File containing extraction region (hrcf00460_repro_pha2.fits): 
SrcID (1): 
Enter RMF threshold (1e-06): 
Verbosity (0:5) (0): 
Detector Name (e.g., ACIS-S3) (HRC-S2): 
Enter Grating Arm (HEG|MEG|LEG|NONE) (LEG): 

There are a few details to note:

  • The default srcid=1 is used in this example. The srcid is the number of the source in the pha2 file and is used to find the appropriate source position for creating the gRMF. For most observations, there is a single source in the grating observation; if you need to create a gRMF for more than one source in an observation, e.g. to use the output of the Grating Spectra for Multiple HRC Sources thread, change the srcid to the correct source id for the data.

  • The detsubsys parameter is set to the chip on which the 0th order falls. For most observations, this will be HRC-S2.

  • Specifying compute as the grid value is the same as using the default gridding. The default grids for the wvgrid_arf parameter, suitable for most analysis, are listed in the help file. In general, wvgrid_chan is set to be the same as the arf grid.

    It is also possible to run mkgrmf with non-standard grids for the wvgrid_arf and wvgrid_chan parameters, e.g.:

    unix% pset mkgrmf wvgrid_arf="1.0:205.8:0.01"
    unix% pset mkgrmf wvgrid_chan="1.0:205.8:0.01"
    

The contents of the parameter may be checked with plist mkgrmf.

Run the tool for every order you wish to model, changing the order parameter accordingly. This process can be automated with a foreach loop (shown here for the tcsh shell). After setting the mkgrmf parameters:

unix% foreach f ( -1 -2 -3 1 2 3 )
foreach? mkgrmf outfile=460_leg_{$f}.grmf order=$f mode=h
foreach? end

This loop creates gRMFs for the first three positive and negative orders of the spectra. The Creating Higher-order Responses for HRC-S/LETG Spectra thread provides some advice on determing the number of orders to model.


Caveats

Responses for randomized HRC-S data

For randomized data, there is only calibration available for the positive orders. This is primarily due to the fact that users are recommended to work with unrandomized data, so a higher priority is placed on making those calibration files.

Since the effect of randomization on LETG+HRC-S data is virtually zero, the randomized and unrandomized calibration is essentially identical. This means that you can use the negative-order unrandomized file to make negative-order randomized gRMFs.

In order to do so, it is necessary to set the filename in ardlib.par:

unix% pset ardlib \
      AXAF_LETG_1111_LSF_FILE="$CALDB/data/chandra/hrc/lsfparm/hrcsleg-1D1999-07-22lsfparmN0003.fits"

This forces mkgrmf to use the -1 randomized file for all runs of the tool, so make sure to "punlearn ardlib" when finished with this analysis. Otherwise the wrong file will be selected in future sessions.


Working with LETG/HRC-I data

Note that very few LETG/HRC-I observations were done in which the instrument configuration has the optimal zero offset in Y and +100 microns focus offset; see the restriction on off-axis angles. Users working with this detector/instrument combination must take care to know how the data were observed.

The calibration files used by mkgrmf (LSFPARM files) were calibrated for LETG/HRC-S data, but may be used for HRC-I data as well. The calibration would be identical, except at the very ends of the spectrum. The difference became noticeable around 0.2 keV and worsened quickly at a lower energies.

  • Pixel size is not an issue, and intrinsic charge cloud-related detector broadening in HRC-I is very similar to HRC-S, and small compared with mirror broadening.

  • The HRC-I plate is 90x90mm, or 127mm along the diagonal of the dispersion axis, compared to 100mm for the HRC-S central plate. The Rowland circle will deviate from the detector for HRC-I only at the extra ~8.5mm at each end. As can be seen from the LETG/HRC-S though, this effect is insignificant over the whole of the HRC-S, so will likely not get that much worse over the extra few mm in HRC-I.

To make the RMFs, explicitly set the LSFPARM file in ardlib.par. For the +1 order:

unix% pset ardlib.par AXAF_LETG_1111_LSF_FILE=${CALDB}/data/chandra/hrc/lsfparm/hrcsleg1D1999-07-22lsfparmN0003.fits 

and for the -1 order:

unix% pset ardlib.par AXAF_LETG_1111_LSF_FILE=${CALDB}/data/chandra/hrc/lsfparm/hrcsleg-1D1999-07-22lsfparmN0003.fits 

Users that have questions or need further information on creating gRMFs for LETG/HRC-I should contact the CXC Helpdesk.


Summary

This thread is now complete. You may procede to the Grating ARF thread appropriate for your observation: LETG/HRC-S or LETG/HRC-I.



Parameters for /home/username/cxcds_param/mkgrmf.par


       outfile = leg_p1.rmf       Output File Name
    wvgrid_arf = compute          Enter ARF side wavelength grid [angstroms]
   wvgrid_chan = compute          Enter channel-side wavelength grid [angstroms]
         order = 1                Enter Grating order
       obsfile = hrcf00460_repro_evt2.fits[EVENTS] Name of fits file with obs info
    regionfile = hrcf00460_repro_pha2.fits File containing extraction region
         srcid = 1                SrcID
#
     threshold = 1e-06            Enter RMF threshold
     detsubsys = HRC-S2           Detector Name (e.g., ACIS-S3)
   grating_arm = LEG              Enter Grating Arm
#
       verbose = 0                Verbosity
  (diagonalrmf = no)              Compute diagonal RMF?
#
#
(ardlibparfile = ardlib.par)      name of ardlib parameter file
      (geompar = geom)            Parameter file for Pixlib Geometry files
#
       (mirror = HRMA)            Mirror Name
      (clobber = no)              Overwrite existing files?
         (mode = ql)              Enter mode for parameter file.
    

History

20 Dec 2004 updated for CIAO 3.2: canned gRMFs are no longer available in the CALDB, users must run this thread
14 Jan 2005 added Working with LETG/HRC-I data caveat
08 Apr 2005 added more detail to thread overall; new section - Get Started: About the calibration files; new caveat - Responses for randomized HRC-S data
05 Dec 2005 reviewed for CIAO 3.3: no changes
06 Feb 2006 removed "Matching the grid to the PHA file" section, as it is not straightforward for HRC observations; users who set a custom bin size when running tgextract (e.g. not 0.0125 Å) may contact the CXC Helpdesk for assistance.
01 Dec 2006 reviewed for CIAO 3.4: no changes
11 Jan 2008 reviewed for CIAO 4.0: no changes
12 Feb 2009 updated for CIAO 4.1: paths to calibration files updated for CALDB 4
24 Feb 2009 added Off-axis Angles section
04 Mar 2009 srcid information added to the Run mkgrmf section
16 Jun 2009 added About the Chandra Grating Data Archive and Catalog section
14 Jan 2009 reviewed for CIAO 4.2: no changes
12 Jan 2011 reviewed for CIAO 4.3: no changes
10 Jan 2012 reviewed for CIAO 4.4: no changes
03 Dec 2012 Review for CIAO 4.5; no changes
24 Apr 2013 Add pointer to new mktgresp tool.