Chandra X-Ray Observatory
	(CXC)
Skip to the navigation links
Last modified: July 2017

URL: http://cxc.harvard.edu/ciao/ahelp/mktgresp.html
AHELP for CIAO 4.9

mktgresp

Context: tools

Synopsis

Create ARF and RMF files for each spectral order and grating arm in a TypeII PHA file

Syntax

mktgresp  infile evtfile outroot [orders] [wvgrid_arf] [wvgrid_chan]
[asolfile] [bpixfile] [mskfile] [dtffile] [pbkfile] [dafile] [osipfile]
[parallel] [nproc] [verbose] [clobber]

Description

The 'mktgresp' tool will create the ARF and RMF for each spectral order and grating arm in a Type II PHA file. It runs the mkgrmf tool and the fullgarf script with the appropriate inputs using the energy and channel grids.

For ACIS data, the default PHA files will have 12 spectra for HETG: +/- 3 orders for each MEG and HEG, and 6 for LETG: +/- 3 orders. Since HRC lacks energy resolution, the spectra cannot be order separated so there are only 2 spectra: +/- 1 which represents the contribution from all orders.

The tool will automatically try to locate the auxiliary files needed to make the response products: aspect solution, bad-pixel file, mask, dead time factors (HRC only), and parameter block (ACIS only). If any of these cannot be found, it will produce an error and users will need to set the file name via the parameter file.

Example 1

unix% mktgresp acis_repro_pha2.fits acis_repro_evt2.fits acis_repro

The ARF and RMF for each spectral order and grating arm in the input PHA file is created using the default energy and channel grids.

unix% /bin/ls acis_repro*.arf acis_repro*.rmf
acis_repro_heg_m1.arf  acis_repro_heg_p2.arf  acis_repro_meg_m3.arf
acis_repro_heg_m1.rmf  acis_repro_heg_p2.rmf  acis_repro_meg_m3.rmf
acis_repro_heg_m2.arf  acis_repro_heg_p3.arf  acis_repro_meg_p1.arf
acis_repro_heg_m2.rmf  acis_repro_heg_p3.rmf  acis_repro_meg_p1.rmf
acis_repro_heg_m3.arf  acis_repro_meg_m1.arf  acis_repro_meg_p2.arf
acis_repro_heg_m3.rmf  acis_repro_meg_m1.rmf  acis_repro_meg_p2.rmf
acis_repro_heg_p1.arf  acis_repro_meg_m2.arf  acis_repro_meg_p3.arf
acis_repro_heg_p1.rmf  acis_repro_meg_m2.rmf  acis_repro_meg_p3.rmf

Example 2

unix% mktgresp hrc_repro_pha2.fits hrc_repro_evt2.fits hrc_repro
orders=-3,-2,-1,1,2,3

Since HRC does not have sufficient energy resolution, the grating PHA file only contains the +1, and -1 orders -- which are actually sum of all spectral orders. However, with sufficient counts, users may need to include the higher order ARFs in their analysis. These users can set the orders parameter to the list of orders they required to fit the data. Note: both positive and negative orders must be specified.

unix% /bin/ls hrc_repro*.arf hrc_repro*.rmf
hrc_repro_leg_m1.arf  
hrc_repro_leg_m1.rmf  
hrc_repro_leg_m2.arf  
hrc_repro_leg_m2.rmf  
hrc_repro_leg_m3.arf  
hrc_repro_leg_m3.rmf  
hrc_repro_leg_p1.arf  
hrc_repro_leg_p1.rmf  
hrc_repro_leg_p2.arf
hrc_repro_leg_p2.rmf
hrc_repro_leg_p3.arf
hrc_repro_leg_p3.rmf

Parameters

name type def min max units reqd stacks
infile file         yes  
evtfile file         yes  
outroot file         yes  
orders string INDEF       no  
wvgrid_arf string compute     Angstrom no  
wvgrid_chan string compute     Angstrom no  
asolfile file         no yes
bpixfile file         no  
mskfile file         no  
dtffile file         no  
pbkfile file         no  
dafile file CALDB       no  
osipfile file CALDB       no  
parallel boolean yes       no  
nproc integer INDEF 1     no  
verbose integer 0 0 5      
clobber boolean no          

Detailed Parameter Descriptions

Parameter=infile (file required)

Input type II pha file

The input type II PHA file produced by either tgextract or tgextract2.

Parameter=evtfile (file required)

Input event file

The input event file with the extraction region attached. This file is also used to locate the auxiliary files with the information stored in the header.

Parameter=outroot (file required)

Output path and root file name for the products

The output file name will be

${root}_${arm}_${pm}${order}.${type}

where ${root} is this parameter. ${arm} is the grating arm: 'leg', 'meg', or 'heg'. ${pm} is 'p' for positive/plus orders and 'm' for minus/negative orders. ${order} is the integer order number: for ACIS the default PHA file will have orders '1', '2', and '3'. For HRC, only '1'. The ${type} identifies the file as either 'arf' or 'rmf'.

Parameter=orders (string not required default=INDEF)

The list of orders to create grating responses.

By default, orders="INDEF", mktgresp will create response file for each order (tg_m) value in the infile spectrum. However, for HRC/LETG observations, users may want to create higher order responses and/or ACIS users may want to only create first order responses (especially for faint sources). If this parameter is set, the orders listed will be created for each grating arm (tg_part) and source in the infile.

Parameter=wvgrid_arf (string not required default=compute units=Angstrom)

Wavelength grid of rmf and arf

Wavelength grid for the arf specification string. This string may specify compute, a file, or an explicit energy grid. For example, to use a grid for the MEG that ranges from 1 to 41.96 angstroms with 8192 channels set. The units for this parameter is angstroms.


  wvgrid_arf="1.0:41.96:#8192"

This is the same grid that you would get with


  wvgrid_arf=compute

The default grids for the three grating types are

Grating type wvgrid_arf
MEG 1.0:41.96:#8192
HEG 1.0:21.48:#8192
LEG 1.0:205.8:#16384

Parameter=wvgrid_chan (string not required default=compute units=Angstrom)

Enter channel-side wavelength grid [angstroms]

Specification string for the channel side wavelength grid. This string may specify compute, a file, or an explicit energy grid. In general this is set to be the same as the arf grid. However, there is no compelling reason that the fitting engine needs the ARF and the RMF on the same grid so this has been left as a user adjustable parameter. The units for this parameter is angstroms.

Parameter=asolfile (file not required stacks=yes)

Names of aspect solution file(s).

If blank, the script will use the information in the header of the event file to try to locate the correct file. If it cannot then the user must set the file name explicitly.

Parameter=bpixfile (file not required)

Name of bad pixel file.

If blank, the script will use the information in the header of the event file to try to locate the correct file. If it cannot then the user must set the file name explicitly.

Parameter=mskfile (file not required)

Names of instrument mask file.

If blank, the script will use the information in the header of the event file to try to locate the correct file. If it cannot then the user must set the file name explicitly.

Parameter=dtffile (file not required)

HRC Only. Name of dead time factors, dtf, file.

If blank, the script will use the information in the header of the event file to try to locate the correct file. If it cannot then the user must set the file name explicitly.

Parameter=pbkfile (file not required)

ACIS only. Names of parameter block, pbk, file.

If blank, the script will use the information in the header of the event file to try to locate the correct file. If it cannot then the user must set the file name explicitly.

Parameter=dafile (file not required default=CALDB)

ACIS only. Name of the dead area calibration file.

The default, CALDB, will retrieve the correct file from the calibration database. If blank, then the dead area calibration will be omitted from the ARF.

Parameter=osipfile (file not required default=CALDB)

Order sorting calibration file

The order sorting calibration file contains information needed to construct the ARF. The default, CALDB, will retrieve the correct file from the calibration database.

Parameter=parallel (boolean not required default=yes)

Run code in parallel using multiple processors?

If multiple processors are available, then this parameter controls whether the tool should run various underlying tools in parallel.

If parallel=yes and verbose>0 users will see that arm+orders will be run in a random order.

Parameter=nproc (integer not required default=INDEF min=1)

Number of processors to use

If parallel=yes, then this controls the number of processes to run at once. The default, INDEF, will use all available processors. The value cannot be larger than the number of processors.

If parallel=yes and verbose>0 users will see that arms+orders will be run in a random order.

Parameter=verbose (integer default=0 min=0 max=5)

Amount of information printed to the terminal

Parameter=clobber (boolean default=no)

Should existing files be removed?

Changes in the scripts 4.9.4 (July 2017) release

Fix problem cleaning up temporary aspect histogram files under Python 3.

Changes in the scripts 4.9.2 (April 2017) release

The script can now work on TYPE:I (ie single spectra) PHA files.

Change in scripts 4.8.4 (September 2016) release

Updates to allow for ACIS-I + grating configurations.

Changes in scripts 4.7.2 (April 2015) release

The new orders parameter has been added to specify which responses' orders to create. The tool can also now create response files for the different grating orders and arms in parallel using the new nproc and parallel parameters.

About Contributed Software

This script is not an official part of the CIAO release but is made available as "contributed" software via the CIAO scripts page. Please see this page for installation instructions - such as how to ensure that the parameter file is available.

Bugs

Caveats

Warnings related to missing SUM_2X2, OCLKPAIR, FEP_CCD, or ORC_MODE keywords

Users trying to run this tool with old versions of data products, those created with ASCDSVER less than version 8.4.2, may see warnings like


FITSIO status = 202: keyword not found in header
*** ERROR: *** Unable to get the value of `SUM_2X2' in /data/acisf04425_000N003_evt1.fits

Users should consult the Watch Out page for more information on this topic an information on how to upgrade their data products.

See Also

chandra
eventdef
tools
combine_grating_spectra, detilt, dewiggle, dmtype2split, symmetrize, tg_bkg, tg_choose_method, tg_create_mask, tg_findzo, tg_resolve_events, tgdetect, tgdetect2, tgextract, tgextract2, tgidselectsrc, tgmask2reg, tgmatchsrc, tgsplit

Last modified: July 2017
Smithsonian Institute Smithsonian Institute

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email:   cxchelp@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2017. All rights reserved.