Add Grating Spectra and Average ARFs
[CIAO 3.4 Science Threads]
OverviewLast Update: 4 Feb 2008 - add_grating_orders updated to v3.4 (several broken Unix "tail" commands were replaced with the tool dmkeypar) Synopsis: add_grating_spectra is a script which lets the user add two grating spectra and average their associated ARFs. The output spectrum can be grouped if desired. It can be used, for example, to add up spectra of sources from different observations. Purpose: To generate and group two coadded grating spectra and ARFs. Read this thread if: you are working with ACIS/HETG, ACIS/LETG, or HRC/LETG observational data and would like to add the grating orders. Related Links:
|
Contents
- Get Started
- Downloading add_grating_spectra
- Run add_grating_spectra
- Summary
- Parameter files:
- History
Get Started
Sample ObsIDs used: 459 (HETG/ACIS-S, 3C 273); 2463 (HETG/ACIS-S, 3C 273)
File types needed: evt1; flt1; asol1
To run this thread, you need two PHA grating spectra and the corresponding ARFs:
unix% ls 2463_MEG_1.arf 459_MEG_1.arf 2463_MEG_1_NONE.pha 459_MEG_1_NONE.pha
Both observations must have been taken with the same instrumental configuration:
- ACIS-HETG-HEG
- ACIS-HETG-MEG
- ACIS-LETG-LEG
- HRC-LETG-LEG
The files used here were created with the Extract Coadded and Grouped Nth-Order Source & Background Spectra and ARFs thread.
Downloading add_grating_spectra
The most recent version of add_grating_spectra is 3.2.0 (09 December 2004):
unix% grep version_ `which add_grating_spectra` version_str="3.4" version_date="04 February 2008"
Please check that you are using the most recent version before continuing. If you do not have the script installed or need to update to a newer version, please refer to the Scripts page.
Run add_grating_spectra
The script executes the following tools in order:
- dmtcalc: to rename columns and perform math on them in temporary PHA and ARF files.
- dmpaste: to merge the final columns into the output PHA and ARF files.
- dmgroup: to group the final PHA file.
- dmhedit: to update header keywords of the output files.
In this example, we are summing together the first-order MEG arms of HETG spectra and the corresponding gARFs:
unix% punlearn add_grating_spectra unix% pset add_grating_spectra pha1=2463_MEG_1_NONE.pha unix% pset add_grating_spectra pha2=459_MEG_1_NONE.pha unix% pset add_grating_spectra garf1=2463_MEG_1.arf unix% pset add_grating_spectra garf2=459_MEG_1.arf unix% pset add_grating_spectra gtype=BIN unix% pset add_grating_spectra gspec=10 unix% pset add_grating_spectra root=3C273_summed unix% add_grating_spectra First input PHA spectrum (2463_MEG_1_NONE.pha): Second input PHA spectrum (459_MEG_1_NONE.pha): First input ARF (2463_MEG_1.arf): Second input ARF (459_MEG_1.arf): Root name for output files (3C273_summed): Input pha1 file is: 2463_MEG_1_NONE.pha (INSTRUMENT=ACIS-MEG, ORDER=1) Input pha2 file is: 459_MEG_1_NONE.pha (INSTRUMENT=ACIS-MEG, ORDER=1) Using ACIS-MEG grating ARF order 1: 2463_MEG_1.arf Using ACIS-MEG grating ARF order 1: 459_MEG_1.arf The root filename for the output files is: 3C273_summed Exposure(2463_MEG_1_NONE.pha) = 26686.9077228220 Exposure(459_MEG_1_NONE.pha) = 38564.6089268890 New Exposure = 65251.5166497110 BACKSCUP(2463_MEG_1_NONE.pha) = 4.50 BACKSCDN(2463_MEG_1_NONE.pha) = 4.50 BACKSCUP(459_MEG_1_NONE.pha) = 4.50 BACKSCDN(459_MEG_1_NONE.pha) = 4.50 New BACKSCUP = 4.50 New BACKSCDN = 4.50 ACIS-MEG 3C273_summed_ACIS-MEG_1.pha will be grouped by 10 = .0500000000 Angstrom The output spectrum is named 3C273_summed_ACIS-MEG_1_BIN10.pha The Averaged Effective Area is named 3C273_summed_ACIS-MEG_1.arf
The content of the parameter file may be checked using plist add_grating_spectra.
Summary
The thread is now complete. The output containing the summed counts from both input PHA files is 3C273_summed_ACIS-MEG_1_BIN10.pha; the averaged effective area is named 3C273_summed_ACIS-MEG_1.arf.
To fit this data in Sherpa:
sherpa> data 3C273_summed_ACIS-MEG_1_BIN10.pha sherpa> rsp[arfname](,3C273_summed_ACIS-MEG_1.arf,) sherpa> instrument = arfname
See the Fitting PHA Data with Multi-Component Source Models thread for more information.
Parameters for /home/username/cxcds_param/add_grating_spectra.par pha1 = 2463_MEG_1_NONE.pha First input PHA spectrum pha2 = 459_MEG_1_NONE.pha Second input PHA spectrum garf1 = 2463_MEG_1.arf First input ARF garf2 = 459_MEG_1.arf Second input ARF root = 3C273_summed Root name for output files (gtype = BIN) Spectrum grouping type (gspec = 10) Spectrum grouping specs (NONE,10,etc) (clobber = no) Clobber existing output files? (verbose = 0) Debug Level(0-5) (mode = ql) |
History
14 Dec 2004 | updated for CIAO 3.2: created Downloading add_grating_spectra section |
06 Dec 2005 | reviewed for CIAO 3.3: no changes |
01 Dec 2006 | reviewed for CIAO 3.4: no changes |
04 Feb 2008 | add_grating_orders updated to v3.4 (several broken Unix "tail" commands were replaced with the tool dmkeypar) |