About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: 26 Feb 2007
Hardcopy (PDF): A4 | Letter

Extracting Extended Source Spectra and Responses

[CIAO 3.4 Science Threads]



Overview

Last Update: 26 Feb 2007 - acisspec v4.0: Dead area correction parameters added to the acisspec.par file: pbkfile and dafile (added ACIS dead area correction section). Script prints a warning if RMF should be remade with mkacisrmf.

Synopsis:

Users are encouraged to use specextract in place of acisspec for new analyses; refer to the specextract thread for more information. This thread has been deprecated and will be removed in a future CIAO release.

acisspec is a versatile script that operates on both point-like and extended sources. In the following example, acisspec is used to extract ACIS PI spectra and associated WMAPs for the source (and background) and (optionally) group the output spectra. It also creates weighted response files (WARF and WRMF).

Purpose:

To use the acisspec script on an extended source to create a source and background spectrum, plus the corresponding weighted responses.

Read this thread if:

you are working with an ACIS imaging observation or the 0th-order of a grating observation and would like to create a spectrum and weighted response files for it.

Calibration Updates:

  • CALDB v3.3.0.1 (2 Feb 2007): The CALDB 3.3.0.1 patch corrects an indexing problem that may affects users of this thread. Read the Caveat: ACIS -120C FEF for CTI-corrected ACIS data for details.
  • CALDB v2.26 (2 Feb 2004): New FEF files containing updated information for ACIS S3 were added to the CALDB; there are CTI-corrected and uncorrected versions available.
  • CALDB v2.21 (14 Feb 2003): The new CTI-corrected FEF file (acisD2000-01-29fef_pha_ctiN0002.fits) contains updated information for chips S0, S1, and S3-5, eliminating the calibration problem announced in December 2002. Applying the CTI correction to these chips will no longer have a negative effect on the data.

Related Links:

Proceed to the HTML or hardcopy (PDF: A4 | letter) version of the thread.




Contents



Getting Started

Sample ObsID used: 1447 (ACIS-I, CAS A)

File types needed: evt2

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

CALDB 3.3.0.1 patch

The CALDB 3.3.0.1 patch, released on 02 February 2007, corrects an indexing problem that may affects users of this thread. Read the Caveat: ACIS -120C FEF for CTI-corrected ACIS data for details.

Make sure that this patch has been installed in your CALDB before continuing:

unix% dmlist "$CALDB/docs/chandra/caldb_version/caldb_version.fits[cols caldb_ver,ciao_ver]" data 
...
    52 3.2.4     CIAO3.3.0.1  
    53 3.3.0     CIAO3.4      
    54 3.3.0.1   CIAO3.4 

This file is automatically updated each time the CALDB is upgraded on your system, so the final row always indicates the current version.


Using Consistent Calibration: mkrmf vs mkacisrmf

The tool mkacisrmf is used to create RMFs for all -120 ACIS data taken in (V)FAINT mode that has the time-dependent gain adjustment and CTI correction applied. It may also be used for GRADED mode data on the back-illuminated chips (ACIS-S1 and S3) only.

All new analyses with these types of data should be done with mkacisrmf instead of mkrmf. Although this script runs mkrmf, it can still be used to create the spectrum and ARF files for the data. Then follow the Creating ACIS RMFs with mkacisrmf thread to generate new RMFs.

It is important that the calibration applied to the event file is consistent with the RMF tool chosen, as explained in the "Using Consistent Calibration" section of the why topic. If necessary, reprocess your data with the correct gain file before beginning this thread.


The ACIS dead area correction

There is a fractional area loss per unit time due to cosmic ray flux incident on the ACIS detector. Calibration to account for this ACIS "dead area" was included in CALDB 3.3.0 on 15 December 2006. The correction is non-zero for the 8 front-illuminated ACIS chips; the effect is not detectable for the BI chips, so the nominal calibration value is 0.0. The resulting chipy-dependent reduction in the EA will be approximately 2.2% at the readout, and 4.0% at the top of the chip. Refer to the ACIS Dead Area Correction why topic for technical details.

In CIAO 3.4, the application of the dead area correction is turned off by default. However, users may opt to include it in the analysis by setting the pbkfile and dafile parameters in this script. Refer to the script help file for details on these parameters.

Note that acisspec applies the same pbkfile to the source and background datasets. If this is not appropriate for your analysis, you will have to run mkwarf independently to create an ARF with the dead area correction.



Downloading acisspec

The most recent version of acisspec is v4.0 (07 February 2007):

unix% grep version_ `which acisspec`
version_str="4.0"
version_date="07 February 2007"

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.



Defining Source & Background Regions

First we need to define regions from which the source and background spectra will be created:

unix% cat src.reg
# Region file format: CIAO version 1.0
ellipse(3664,4398,431.51973,335.50368,335.55502)

unix% cat bgd.reg
# Region file format: CIAO version 1.0
circle(3136,4770,146)

Make sure that you save the regions in CIAO format (Regions -> File Format -> CIAO) so that they are fully compatible with the analysis tools; see the Using CIAO Regions thread for more information.

The regions are shown displayed on the event file in Figure 1 [Link to Image 1: Extraction regions on the event file]. In this example, we chose the background region from a source-free portion of the same event file.



Running the Script

We need to set the soufile1 and bgfile1 parameters - including the regions with the appropriate DM filter - and the root parameter:

unix% punlearn acisspec 
unix% pset acisspec soufile1="acisf01447N002_evt2.fits[sky=region(src.reg)]"
unix% pset acisspec root=es_1447
unix% pset acisspec bgfile1="acisf01447N002_evt2.fits[sky=region(bgd.reg)]"

If you wish to include the ACIS dead area correction (not applied in this thread), set the pbkfile and dafile parameters as well:

unix% pset acisspec pbkfile=acisf059538423N002_pbk0.fits dafile=CALDB 

Now execute the script:

unix% acisspec
Primary source file: events or spectrum (acisf01447N002_evt2.fits[sky=region(src.reg)]): 
Root name for output files (es_1447): 
# mkwarf (CIAO 3.4): WARNING: Input image name was "EVENTS_IMAGE" instead of "WMAP".  Will attempt to use.

Couldn't determine chip position for pixel: (4316.500000,4052.500000) with value=1.000000. Skipping pixel
This sort of warning may appear many times

***ARDLIB warning: Filename es_1447_sou.wmap does not specify an extension. Assuming the first "interesting" extension.
***ARDLIB warning: Filename es_1447_sou.wmap does not specify an extension. Assuming the first "interesting" extension.
***ARDLIB warning: Filename es_1447_sou.wmap does not specify an extension. Assuming the first "interesting" extension.
# mkwarf (CIAO 3.4): WARNING: Input image name was "EVENTS_IMAGE" instead of "WMAP".  Will attempt to use.

***ARDLIB warning: Filename es_1447_bgd.wmap does not specify an extension. Assuming the first "interesting" extension.
***ARDLIB warning: Filename es_1447_bgd.wmap does not specify an extension. Assuming the first "interesting" extension.
***ARDLIB warning: Filename es_1447_bgd.wmap does not specify an extension. Assuming the first "interesting" extension.


Atten: grid input,"energy=0.3:11.0:0.01", is ignored as a weights file, "es_1447_sou.wfef", is found.

Total 85 regions to be processed:
--- Region #1 processed
--- Region #2 processed
--- Region #3 processed
(clip)
--- Region #83 processed
--- Region #84 processed
--- Region #85 processed



Atten: grid input,"energy=0.3:11.0:0.01", is ignored as a weights file, "es_1447_bgd.wfef", is found.


Total 18 regions to be processed:
--- Region #1 processed
--- Region #2 processed
--- Region #3 processed
(clip)
--- Region #16 processed
--- Region #17 processed
--- Region #18 processed

See the Common Warnings section for an explanation of the messages printed to the screen.

Check the parameter file that was used with plist acisspec.

There are a couple things to note about this run:

  • The default values of the binwmap (det=8) and ewmap (300:2000) were used.

  • The spectra were not grouped in this case. There are four parameters that can be used to specify grouping for the source (gtype, gspec) and background (bggtype, bggspec) spectra, if desired.



Using the Ouput

The script has created a number of output files:

unix% ls es_1447*
es_1447_bgd.pi          es_1447_bgd.wrmf        es_1447_sou.wmap
es_1447_bgd.warf        es_1447_sou.pi          es_1447_sou.wrmf
es_1447_bgd.wmap        es_1447_sou.warf

The BACKFILE, RESPFILE, and ANCRFILE header keywords have been updated in the source spectrum file:

unix% dmkeypar es_1447_sou.pi BACKFILE echo+
es_1447_bgd.pi

unix% dmkeypar es_1447_sou.pi ANCRFILE echo+
es_1447_sou.warf

unix% dmkeypar es_1447_sou.pi RESPFILE echo+
es_1447_sou.wrmf

This means that the background file and source-related responses will automatically be read in when es_1447_sou.pi is read into Sherpa. The RESPFILE and ANCRFILE header keywords are not updated in the background spectrum in order to allow for background subtraction in Sherpa.

For help on fitting this data in Sherpa, follow the Fitting PHA Data thread.



Common Warnings

There are several warning messages that you may see printed to the screen during the acisspec run:

  • Originating library: ardlib

    ***ARDLIB warning: Filename es_1447_sou.wmap does not specify an extension. Assuming the first "interesting" extension.
    

    The warning may be ignored as it does not adversely affect the output; it is explained in this FAQ.

  • Originating tool: mkwarf

    # mkwarf (CIAO 3.4): WARNING: Input image name was "EVENTS_IMAGE" instead of "WMAP".  Will attempt to use.
    

    There are two ways to create a WMAP, with dmextract or with dmcopy; acisspec uses the dmcopy method. In this process, the primary block of the WMAP file is name EVENTS_IMAGE, as opposed to WMAP. Since we know that sources.wmap8 was created as a WMAP image (i.e. the detector coordinate system was used), the warning message can be ignored.

  • Originating tool: mkwarf

    Couldn't determine chip position for pixel: (4076.500000,4052.500000) with value=3.000000. Skipping pixel
    

    If the source is near a chip boundary, mkwarf may not be able to determine the chip location of every pixel in the WMAP. This has to do with the lack of SIM info in the image; details are available in this FAQ.

    In the vast majority of cases, the number of counts ignored (i.e. the sum of the "value" of each ignored pixel) is much smaller than the total signal in the WMAP. However, this may not be the case for small regions near chip boundaries. dmstat may be used to determine the sum of all pixels in the WMAP for comparison to the sum of the ignore pixel values.

  • Originating tool: mkrmf

     Atten: grid input,"energy=0.3:11.0:0.01", is ignored as a weights file, "es_1447_sou.wfef", is found.
    

    The energy axis grid is ignored since the grid is read from the weights file. Since the value entered for the energy axis (axis1 in this case) must be syntactically correct for the tool to parse over it properly, acisspec uses "energy=0.3:11.0:0.0" as a placeholder.



Analysis Caveats

Users should be cautious about analyzing the data for sources near the edges of the ACIS CCDs.

  1. For X-rays passing through the mirrors, the very bottom of each CCD is obscured by the frame store. As a result, some of the events in rows with CHIPY <= 8 are not detected. (The set of rows affected varies from CCD to CCD.) Since the CIAO tools do not compensate for this effect, the ARFs and exposure maps for sources in these regions may be inaccurate.

  2. For sources within about thirty-two pixels of any edge of a CCD, the source may be dithered off the CCD during part of an observation. The aspect histogram, which is used to create ARFs and exposure maps, is designed to compensate for this effect.

  3. A contaminant has accumulated on the optical-blocking filters of the ACIS detectors, as described in the ACIS QE Degradation why topic. Since there is a gradient in the temperature across the filters (the edges are colder), there is a gradient in the amount of material on the filters. (The contaminant is thicker at the edges.) Within about 100 pixels of the outer edges of the ACIS-I and ACIS-S arrays, the gradient is relatively steep. Therefore, the effective low-energy (' 1 keV) detection efficiency may vary within the dither pattern in this region. The ARF and instrument map tools are designed to read a calibration file which describes this spatial dependence.




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


      soufile1 = acisf01447N002_evt2.fits[sky=region(src.reg)] Primary source file: events or spectrum
          root = es_1447          Root name for output files
      (bgfile1 = acisf01447N002_evt2.fits[sky=region(bgd.reg)]) Primary background file: events or spectrum
     (soufile2 = )                Secondary source file: events or spectrum
      (bgfile2 = )                Secondary background file: events or spectrum
     (souwmap1 = )                Primary source WMAP
      (bgwmap1 = )                Primary background WMAP
     (souwmap2 = )                Secondary source WMAP
      (bgwmap2 = )                Secondary background WMAP
      (binwmap = det=8)           Binning factor for WMAPs
        (ewmap = 300:2000)        Energy Range for WMAPs
      (weight1 = 1)               Weight for the primary source spectrum
      (weight2 = 1)               Weight for the secondary source spectrum
        (gtype = )                Source spectrum grouping type (NONE, BIN, SNR, NUM_BINS, NUM_CTS, or ADAPTIVE)
        (gspec = )                Source spectrum grouping specs (NONE,10,etc)
      (bggtype = )                Background spectrum grouping type (NONE, BIN, SNR, NUM_BINS, NUM_CTS, or ADAPTIVE)
      (bggspec = )                Background spectrum grouping specs (NONE,10,etc)
      (pbkfile = NONE)            NONE, or name of the parameter block file
       (dafile = NONE)            CALDB, NONE, or name of ACIS dead-area calibration file
      (clobber = no)              Clobber existing file
      (verbose = 0)               Debug Level(0-5)
         (mode = ql)              
    

History

14 Dec 2004 updated for CIAO 3.2: created Using Consistent Calibration section; can be run on 0th order grating in CIAO 3.2
25 Feb 2005 acisspec updated to version 3.4: better error handling (see the script update history for a complete description of the changes)
10 Mar 2005 cleaned up information on background files
23 Jun 2005 CIAO 3.2.2 patch: new calibration for mkacisrmf is available; see the Using Consistent Calibration: mkrmf vs mkacisrmf section
15 Dec 2005 updated for CIAO 3.3: the acisspec script has been updated to version 3.5; note about specextract in the Overview
01 Feb 2006 added link to specextract thread
16 Feb 2006 acisspec updated to version 3.6: improved the conditional statement for recognizing weighted vs. unweighted cases.
05 Apr 2006 specextract use update added to Overview
14 Jun 2006 corrected link in "Calibration Updates"; clarified information on GRADED mode data
01 Dec 2006 updated for CIAO 3.4: acisspec updated to version 3.7 (removed "punlearn mkwarf" to allow new CIAO 3.4 mkwarf parameters (asolfile, pbkfile, dafile) to be set before running the script, if desired); CIAO version in warnings
02 Feb 2007 updated for CALDB 3.3.0.1 patch
26 Feb 2007 acisspec v4.0: Dead area correction parameters added to the acisspec.par file: pbkfile and dafile (added ACIS dead area correction section). Script prints a warning if RMF should be remade with mkacisrmf.

Return to Threads Page: Top | All | Imag Spec
Hardcopy (PDF): A4 | Letter
Last modified: 26 Feb 2007


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