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

Skip the navigation links
Last modified: 24 Jul 2007
Hardcopy (PDF): A4 | Letter

Remove the ACIS Readout Streak

[CIAO 3.4 Science Threads]



Overview

Last Update: 24 Jul 2007 - improved quality of images

Synopsis:

While ACIS reads out a frame, it is still taking data. Photons detected during the readout are clocked out in the wrong row and so have incorrect CHIPY values. For a bright source, you get a streak along the entire column of the source. Events above a source occur as a frame is being read out. Events below the source occur when the previous frame is being read out. This vertical streak (in CHIP coordinates) should not be confused with the horizontal streak on ACIS-S4 due to electronic read-out noise, as discussed in the Get Started section.

Purpose:

To remove the streak from the image (for cosmetic reasons and so that it doesn't affect source detection), and to retain the streak photons (which have more accurate timing information and are not affected by pileup).

Read this thread if:

you are working with an ACIS observation that is affected by this problem; see Get Started for an example.

Related Links:

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




Contents



Get Started

Sample ObsID used: 1712 (ACIS-S, 3C273)

File types needed: evt2; asol1

This thread only shows how to remove the ACIS readout streak. Figure 1 [Link to Image 1: ACIS readout streak vs. Chip S4 serial streaks] shows both the prominent readout streak on the S3 chip, as well as streaks on the S4 chip. The latter are due to a flaw in the serial readout of the chips; use the tool destreak to remove this streak, as illustrated in the Destreak the ACIS-S4 Chip thread.



Get Source Location

acisreadcorr uses the source position to determine which events may have a misplaced CHIPY value. There are two ways to determine the source position:

  1. With ds9:

    unix% ds9 acisf01712N002_evt2.fits &
    

    From the ds9 display [Link to Image 2: Getting the source location from ds9], we can determine that the source is at (4084.0,4085.5).

  2. With dmstat:
    Here we use the virtual file syntax to find the maximum number of photons in the field. It follows that this is the source location:

    unix% punlearn dmstat
    unix% pset dmstat centroid=no sigma=no
    unix% dmstat "acisf01712N002_evt2.fits[bin sky=8]"
    EVENTS_IMAGE
        min:        0             @:        ( 4.5 4.5 )
        max:        4365          @:        ( 4084.5 4084.5 )
       mean:        0.441757202 
        sum:        463216 
       good:        1048576 
       null:        0 
    

    The source location is given as (4084.5,4084.5).



Create a Background Spectrum

Removing all the photons from the affected area would leave a black streak instead of a bright one. We wish instead to leave the background photons where they are. For this reason, it is possible to input a background PI spectrum. The tool then attempts to leave background photons - consistent with the given PI spectrum and distributed evenly in time - where the streak once was.

First, we need to select a background region. This can be from any area of the chip that doesn't contain any bright regions; Figure 3 [Link to Image 3: Region for background spectrum] shows the region used. For help on rotating regions in ds9, see this FAQ.

Save the region:

  • Region -> File Format-> Ciao
  • Region -> File Coordinate System -> Physical
  • Region -> Save Regions... -> Save As "bkg.reg"

The resulting file will look something like this:

unix%  more bkg.reg 
# Region file format: CIAO version 1.0
rotbox(4410.92,4353.0555,389.55054,66.92414,24.719781)

The tool dmextract is now used to create the spectrum of this region:

unix% punlearn dmextract
unix% pset dmextract infile="acisf01712N002_evt2.fits[sky=region(bkg.reg)][bin pi=1:1024:1]"
unix% pset dmextract outfile=bkg_pi.fits
unix% dmextract
Input event file  (acisf01712N002_evt2.fits[sky=region(bkg.reg)][bin pi=1:1024:1]): 
Enter output file name (bkg_pi.fits): 

The contents of the parameter file may be checked using plist dmextract.

NOTE: if your observation was taken with a subarray defined, read the Observations Using Subarrays caveat before proceeding.

The background spectrum should be binned to be the same size as your event file. If you were to bin this example to 1:1023:1, for instance, it may cause photons with PI=1024 to be attributed to the source erroneously. Changing the binning is only a concern if you have filtered your event file such that there are no longer 1024 channels of PI.



Run acisreadcorr

Now we have all the necessary information to run acisreadcorr:

unix% punlearn acisreadcorr
unix% pset acisreadcorr infile=acisf01712N002_evt2.fits
unix% pset acisreadcorr outfile=acis_1712_corr_evt2.fits
unix% pset acisreadcorr aspect=pcadf077378077N002_asol1.fits
unix% pset acisreadcorr x=4084.5 y=4084.5
unix% pset acisreadcorr dx=5 dy=50
unix% pset acisreadcorr bkg=bkg_pi.fits
unix% acisreadcorr 
Input dataset/block specification (acisf01712N002_evt2.fits): 
Output dataset/block specification (acis_1712_corr_evt2.fits): 
Aspect file (pcadf077378077N002_asol1.fits): 
Sky X position (pixels) (4084.5): 
Sky Y position (pixels) (4084.5): 

In some cases there will be more than one asol1.fits file for an observation. All the files must be input to the aspect parameter, either as a comma-separated list or as a stack (see ahelp stack for more information).

The dx and dy parameters may need to be adjusted. The default value for dx (2 pixels), or a number close to it, should be fine for on-axis point sources. dy can be estimated by drawing a circle in ds9 and finding the diameter (see Figure 4 [Link to Image 4: Choosing dy for the observation]). These values determine the width of the region to be cleaned and how close to get to the source, respectively.

The contents of the parameter file may be checked using plist acisreadcorr.



Examine the Results

The newly created file can be viewed in ds9:

unix% ds9 acis_1712_corr_evt2.fits &

as seen in Figure 5 [Link to Image 5: Event file with streak removed (used background spectrum)]. The streak has obviously been removed and "filled-in " by the background photons. It is compared to the original event file in Figure 6 [Link to Image 6: Original and new event files, side-by-side].

Figure 7 [Link to Image 7: Event file with streak removed (didn't used background spectrum)] shows an image of a nearly identical acisreadcorr run. The only difference is that a background spectrum was not supplied to the tool (i.e. bkg=""). The streak has been removed and a stripe of zero counts replaces it.

dmcopy may be used to see which photons were flagged by the tool. Status bit 22 marks photons identified as background and bit 21 marks out-of-time source events. In the following filters, the bits are numbered from the right, starting at zero:

unix% dmcopy "acis_1712_corr_evt2.fits[status=xxxxxxxxxx10xxxxxxxxxxxxxxxxxxxxx]" \
      flag_bkg.fits

unix% dmcopy "acis_1712_corr_evt2.fits[status=xxxxxxxxxx01xxxxxxxxxxxxxxxxxxxxx]" \
      flag_source.fits

Displaying these event files side-by-side produces Figure 8 [Link to Image 8: Photons flagged by acisreadcorr].



Caveats

Observations Using Subarrays

There is a bug in the current version of acisreadcorr such that so that it does not work correctly on observations that used a subarray. A subarray is a defined region of the CCD in which data will be taken, rather than the entire chip. Since the readout time is scaled by the fraction of the chip used, a common case in which observers decide to use a subarray is to reduce pileup (i.e. the data are read out faster). See the Frame Times & Subarrays section of the POG for details.

The bug comes into play when a background spectrum is used (bkg parameter). The workaround is to modify the BACKSCAL header keyword with dmhedit. Specifically, it needs to be multiplied by:

1024 / (subarray delta y)

For example, a 1/8 subarray has delta y = 128, so the ratio is:

1024 / 128 = 8

Then modify the background file created in the Create a Background Spectrum step.

NOTE: the observation in this thread does not use a subarray; this background file is used for illustrative purposes only:

unix% dmkeypar bkg_pi.fits BACKSCAL echo+
0.00038847826236539

calculate new value:	0.00038847826236539 * 8 = 0.00310782609892312

unix% dmhedit infile=bkg_pi.fits filelist="" operation=add \
      key=BACKSCAL value=0.00310782609892312 unit="[pixel]" comment="Fractional area"

unix% dmkeypar bkg_pi.fits BACKSCAL echo+
0.0031078260989231

The BACKSCAL keyword has been properly updated, so the thread may be continued from the Run acisreadcorr step.




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


#--------------------------------------------------------------------
#
# DMEXTRACT -- extract columns or counts from an event list
#
#--------------------------------------------------------------------
        infile = acisf01712N002_evt2.fits[sky=region(bkg.reg)][bin pi=1:1024:1] Input event file 
       outfile = bkg_pi.fits      Enter output file name
          (bkg = )                Background region file or fixed background (counts/pixel/s) subtraction
        (error = gaussian)        Method for error determination(poisson|gaussian|<variance file>)
     (bkgerror = gaussian)        Method for background error determination(poisson|gaussian|<variance file>)
      (bkgnorm = 1.0)             Background normalization
          (exp = )                Exposure map image file
       (bkgexp = )                Background exposure map image file
      (sys_err = 0)               Fixed systematic error value for SYS_ERR keyword
          (opt = pha1)            Output file type: pha1 
     (defaults = ${ASCDS_CALIB}/cxo.mdb -> /soft/ciao/data/cxo.mdb) Instrument defaults file
         (wmap = )                WMAP filter/binning (e.g. det=8 or default)
      (clobber = no)              OK to overwrite existing output file(s)?
      (verbose = 0)               Verbosity level
         (mode = ql)              
    


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


        infile = acisf01712N002_evt2.fits   Input dataset/block specification
       outfile = acis_1712_corr_evt2.fits Output dataset/block specification
        aspect = pcadf077378077N002_asol1.fits Aspect file
             x = 4084.5           Sky X position (pixels)
             y = 4084.5           Sky Y position (pixels)
           (dx = 5)               Chip X tolerance diameter (pixels)
           (dy = 50)              Chip Y tolerance diameter (pixels)
          (bkg = bkg_pi.fits)     Background PI spectrum file
       (bgroup = 10)              Min counts for PI group
      (geompar = geom)            Parameter file for Pixlib Geometry files
       (random = 0)               random seed (0 use time)
      (verbose = 0)               Debug Level(0-5)
      (clobber = no)              Clobber existing file
         (mode = ql)              
    

History

16 Dec 2004 updated for CIAO 3.2: default value of bgroup parameter is changed to 10
12 Dec 2005 updated for CIAO 3.3: default value of dmextract error and bkgerror parameters is "gaussian"
01 Dec 2006 reviewed for CIAO 3.4: no changes
24 Jul 2007 improved quality of images

Return to Threads Page: Top | All | Data Prep
Hardcopy (PDF): A4 | Letter
Last modified: 24 Jul 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.