Last modified: 31 Jan 2022

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

LETG/HRC-I Grating ARFs

CIAO 4.16 Science Threads


Overview

Synopsis:

Using HRC-I with the transmission grattings is a non-standard configuration typically used for calibration observations. The standard mktgresp and fullgarf do not work in this mode. Users need to create the ARFs manually as shown in this thread.

mkgarf creates a grating ARF for a particular order and grating of an observation.

Purpose:

To create grating ARFs for an LETG/HRC-I observation.

Related Links:

Last Update: 31 Jan 2022 - Review for CIAO 4.14. Added section about repro5 datasets.


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.


Get Started

Download the sample data: 1801 (LETG/HRC-I, PKS2155-304)

unix% download_chandra_obsid 1801 evt2,pha2,asol,bpix,dtf

If you created a new bad pixel file by running the New Observation-Specific HRC Bad Pixel File thread, make sure that you have set up ardlib to use the same bad pixel file.


Determine Orders

An ARF needs to be calculated for each order in the observation. We can use dmlist to examine the pha2 file and determine how many orders there are:

unix% dmlist hrcf01801N008_pha2.fits"[cols tg_m,tg_part]" data,clean
#  TG_M TG_PART
   -1    3
    1    3

The tg_m column indicates the order of the observation (+/- 1, +/- 2, +/- 3) and the tg_part column indicates the grating (1 = HEG, 2 = MEG, 3 = LEG). Here we see the two rows for the LETG observation. HRC-I cannot resolve orders; +/- 1 refer to the total positive- and negative-side counts respectively.


Compute the Aspect Histogram (asphist)

The aspect solution files are used to create a binned histogram detailing the aspect history of the observation:

unix% punlearn asphist
unix% pset asphist infile=@pcad_asol1.lis
unix% pset asphist outfile=asphist.fits
unix% pset asphist evtfile=hrcf01801N008_evt2.fits
unix% pset asphist dtffile=hrcf01801_000N008_dtf1.fits
unix% asphist
Aspect Solution List Files (@pcad_asol1.lis): 
Aspect Histogram Output File (asphist.fits): 
Event List Files (hrcf01801N008_evt2.fits[chip_id=0]): 
Live Time Correction List Files for HRC (hrcf01801_000N008_dtf1.fits): 

# asphist (CIAO): WARNING: skipping 8 livetime correction records
  (from time: 82336842.920992 to time: 82337011.020998)

In some rare cases, there will be more than one aspect solution file (pcad_asol1.fits) for an observation. All the files must be input to the infile parameter, either as a list or a stack. Here we use:

unix% cat pcad_asol1.lis 
pcadf01801_000N001_asol1.fits

The content of the parameter file may be checked using plist asphist.


Get Source Position (dmlist)

The source position is required as one of the inputs to mkgarf. This information can be easily obtained from the PHA2 file with dmlist:

unix% dmlist "hrcf01801N008_pha2.fits[SPECTRUM][cols x,y]" opt=data rows=1
 
 
--------------------------------------------------------------------------------
Data for Table Block SPECTRUM
--------------------------------------------------------------------------------
 
ROW    X            Y           
 
     1          1      16498.2792968750       16390.49218750

The source in this example is located at (16498.2792968750, 16390.49218750).


Run mkgarf

Now we have all the information needed to run mkgarf. We will have to run the tool twice, once for each row in the PHA file:

A. For row 1, LEG, order = -1

unix% punlearn mkgarf
unix% pset mkgarf outfile=1801_-1_LEG_garf.fits
unix% pset mkgarf order=-1
unix% pset mkgarf asphistfile="asphist.fits[ASPHIST]"
unix% pset mkgarf obsfile="hrcf01801N008_evt2.fits[EVENTS]"
unix% pset mkgarf engrid="grid(rmf.fits[cols ENERG_LO,ENERG_HI])"
unix% pset mkgarf detsubsys=HRC-I grating_arm=LEG 
unix% pset mkgarf sourcepixelx=16498.2792968750 sourcepixely=16390.49218750
unix% mkgarf
Aspect Histogram File (include extension) (asphist.fits[ASPHIST]): 
Output File Name (1801_-1_LEG_garf.fits): 
Enter Grating order (-1): 
Source X Pixel (16498.2792968750):
Source Y Pixel (16390.49218750):
Energy grid spec (grid(rmf.fits[cols ENERG_LO,ENERG_HI])): 
Name of fits file with obs info (include extension) (hrcf01801N008_evt2.fits[EVENTS]): 
NONE or Name of fits file with order sorting info (NONE): 
Detector Name (HRC-I): 
Enter Grating Arm (HEG|MEG|LEG) (LEG): 
NONE, or name of ACIS window mask file (NONE): 

B. For row 2, LEG, order = 1

unix% pset mkgarf order=1
unix% pset mkgarf outfile=1801_1_LEG_garf.fits
unix% mkgarf
Aspect Histogram File (include extension) (asphist.fits[ASPHIST]): 
Output File Name (1801_1_LEG_garf.fits): 
Enter Grating order (1): 
Source X Pixel (16498.2792968750):
Source Y Pixel (16390.49218750):
Energy grid spec (grid(rmf.fits[cols ENERG_LO,ENERG_HI])): 
Name of fits file with obs info (include extension) (hrcf01801N008_evt2.fits[EVENTS]): 
NONE or Name of fits file with order sorting info (NONE): 
Detector Name (HRC-I): 
Enter Grating Arm (HEG|MEG|LEG) (LEG): 
NONE, or name of ACIS window mask file (NONE): 

The content of the parameter file may be checked using plist mkgarf.


Fitting

At this point, you should have the spectra, gARFs, and gRMFs necessary for fitting the data. The Fitting Grating Data thread shows how to load the data and responses, define a model, and fit the spectra.

In order to use Gaussian statistics to fit a model to a dataset, it is often necessary to "group" the data - i.e. combine channels until you have enough counts. Before fitting the data in Sherpa, read the Grouping a Grating Spectrum thread for more information.


Summary

The grating ARFs for this dataset are 1801_-1_LEG_garf.fits and 1801_1_LEG_garf.fits. Since this source is at the aimpoint/on-axis, the two garfs are nearly identical; Figure 1 shows the +1 order plotted on top of the -1 order. This is normal and is due to the fact that the detector is symmetric, flat, and has no holes or filter boundaries. Also, the HRC-I QEU file is fairly uniform. Off-axis observations will not have such a high degree of similarity between the -1 and +1 orders.

Figure 1: +1 order plotted over the -1 order

[Thumbnail image: The +1 order is displayed as a solid red line over the -1 order in white.]

[Version: full-size]

[Print media version: The +1 order is displayed as a solid red line over the -1 order in white.]

Figure 1: +1 order plotted over the -1 order

These are the pythoncommands used to create this plot:

from pycrates import read_file
import matplotlib.pylab as plt

tab=read_file("1801_-1_LEG_garf.fits")
x = tab.get_column("ENERG_HI").values
y = tab.get_column("SPECRESP").values
plt.plot(x,y,marker="o",linestyle="None", mfc="black",mec="black")
plt.show()

tab=read_file("1801_1_LEG_garf.fits")
x = tab.get_column("ENERG_HI").values
y = tab.get_column("SPECRESP").values
plt.plot(x,y,marker="None",linestyle="solid",color="red")
plt.show()


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


#--------------------------------------------------------------------------
#
#       Parameter file for the ASPECT HISTOGRAM Tool
#
#--------------------------------------------------------------------------
        infile = @pcad_asol1.lis  Aspect Solution List Files
       outfile = asphist.fits     Aspect Histogram Output File
       evtfile = hrcf01801N008_evt2.fits Event List Files
       dtffile = hrcf01801_000N008_dtf1.fits Live Time Correction List Files for HRC
      (geompar = geom)            Parameter file for Pixlib Geometry files
       (res_xy = 0.5)             Aspect Resolution x and y in arcsec
     (res_roll = 600.)            Aspect Resolution roll in arcsec
      (max_bin = 10000.)          Maximal number of bins
      (clobber = no)              Clobber output
      (verbose = 0)               Verbose
         (mode = ql)              
    


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


   asphistfile = asphist.fits[ASPHIST] Aspect Histogram File (include extension)
       outfile = 1801_1_LEG_garf.fits Output File Name
         order = 1                Enter Grating order
  sourcepixelx = 16511.48046875   Source X Pixel
  sourcepixely = 16367.2802734375 Source Y Pixel
        engrid = grid(rmf.fits[cols ENERG_LO,ENERG_HI]) Energy grid spec
       obsfile = hrcf01801N008_evt2.fits[EVENTS] Name of fits file with obs info (include extension)
#engrid,f,a,"0.3:10:0.1",,,"Energy grid spec"
#engrid,f,a,"grid(rmf.fits[cols ENERG_LO,ENERG_HI])",,,"Energy grid spec"
      osipfile = NONE             NONE or Name of fits file with order sorting info
      maskfile = NONE             NONE, or name of ACIS window mask file
     detsubsys = HRC-I            Detector Name
   grating_arm = LEG              Enter Grating Arm
       pbkfile =                  NONE, or the name of the parameter block file
       (mirror = hrma)            Mirror Name
       (dafile = CALDB)           NONE, CALDB, or name of ACIS dead-area calibration file
      (geompar = geom)            Parameter file for Pixlib Geometry files
      (verbose = 0)               Verbosity
      (clobber = no)              Overwrite existing files?
         (mode = ql)              Enter mode for parameter file.
    

History

22 Dec 2004 updated for CIAO 3.2: minor changes to parameter files; canned gARFs are no longer available in the CALDB, removed "Choosing an RMF" section
20 Jun 2005 CIAO 3.2.2 patch: change to asphist parameter file
06 Dec 2005 updated for CIAO 3.3: new asphist tool syntax (the GTI filter is associated with the event file instead of the aspect solution file)
01 Dec 2006 updated for CIAO 3.4: CIAO version in warning; ChIPS version; parameter file updates for mkgarf
23 Jan 2008 updated for CIAO 4.0: parameter file update for mkgarf (obsfile parameter is set to event file instead of aspect histogram file); updated ChIPS syntax; removed outdated calibration updates; filenames and screen output updated for reprocessed data (version N008 files)
12 Feb 2009 updated for CIAO 4.1: images are inline
19 Feb 2009 added Fitting 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; file version name updates
24 Apr 2013 Add pointer to new mktgresp tool.
10 Dec 2013 Review for CIAO 4.6. No changes.
22 Dec 2014 Review for CIAO 4.7; clarified that HRC-I/LETG is an unusual configuration.
02 Apr 2019 Updated to use matplotlib for plotting.
31 Jan 2022 Review for CIAO 4.14. Added section about repro5 datasets.