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 Jun 2008
Hardcopy (PDF): A4 | Letter

Remove the ACIS Readout Streak

CIAO 4.0 Science Threads



Overview

Last Update: 24 Jun 2008 - updated image display to place figures inline with text

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.

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

Figure 1 shows the prominent readout streak on the S3 chip, which will be removed by running this thread. There may also be streaks on the S4 chip, which are due to a flaw in the serial readout of the chips; use the tool destreak to remove those streaks.

[Thumbnail image: bitmap image of ds9 display]

[Version: full-size]

[Print media version: bitmap image of ds9 display]

Figure 1: ACIS readout streak

Image displaying the prominent readout streak on the S3 chip.



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 acisf01712N003_evt2.fits &
    

    From the ds9 display (Figure 2), we can determine that the source is at (4084.0,4085.5).

    [Thumbnail image: bitmap image of ds9 display]

    [Version: full-size]

    [Print media version: bitmap image of ds9 display]

    Figure 2: Getting the source location from ds9

    The source location is determined from the white cross at the center of the frame.

  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 "acisf01712N003_evt2.fits[bin sky=8]"
    EVENTS_IMAGE
        min:        0             @:        ( 4.5 4.5 )
        max:        3862          @:        ( 4084.5 4084.5 )
       mean:        0.43529605865 
        sum:        456441 
       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 shows the region used. For help on rotating regions in ds9, see this FAQ.

[Thumbnail image: bitmap image of ds9 display]

[Version: full-size]

[Print media version: bitmap image of ds9 display]

Figure 3: Region for background spectrum

Image displaying a background region selected from an area of the chip that doesn't contain any bright sources.

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="acisf01712N003_evt2.fits[sky=region(bkg.reg)][bin pi=1:1024:1]"
unix% pset dmextract outfile=bkg_pi.fits
unix% dmextract
Input event file  (acisf01712N003_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=acisf01712N003_evt2.fits
unix% pset acisreadcorr outfile=acis_1712_corr_evt2.fits
unix% pset acisreadcorr aspect=pcadf077378077N003_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 (acisf01712N003_evt2.fits): 
Output dataset/block specification (acis_1712_corr_evt2.fits): 
Aspect file (pcadf077378077N003_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.

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). These values determine the width of the region to be cleaned and how close to get to the source, respectively.

[Thumbnail image: bitmap image of ds9 display]

[Version: full-size]

[Print media version: bitmap image of ds9 display]

Figure 4: Choosing dy for the observation

dy, the number of rows to be avoided around a source in a run of acisreadcorr, can be estimated by drawing a circle around the source in ds9 and finding the diameter.

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. The streak has obviously been removed and "filled-in " by the background photons.

[Thumbnail image: bitmap image of ds9 display]

[Version: full-size]

[Print media version: bitmap image of ds9 display]

Figure 5: Event file with streak removed (used background spectrum)

Event file after processing with acisreadcorr; the streak has been removed and "filled-in" by the background photons.

It is compared to the original event file in Figure 6.
[Thumbnail image: bitmap image of ds9 display]

[Version: full-size]

[Print media version: bitmap image of ds9 display]

Figure 6: Original and new event files, side-by-side

The original event file (left) is compared with the new event file output from acisreadcorr (right).

Figure 7 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.

[Thumbnail image: bitmap image of ds9 display]

[Version: full-size]

[Print media version: bitmap image of ds9 display]

Figure 7: Event file with streak removed (didn't use background spectrum)

Event file after processing with another run of acisreadcorr, this time without supplying a background file to the tool; 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.

[Thumbnail image: bitmap image of ds9 display]

[Version: full-size]

[Print media version: bitmap image of ds9 display]

Figure 8: Photons flagged by acisreadcorr

The background photons are on the left and the out-of-time source photons are on the right. The right frame is set at zoom=4.



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 = acisf01712N003_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 = acisf01712N003_evt2.fits   Input dataset/block specification
       outfile = acis_1712_corr_evt2.fits Output dataset/block specification
        aspect = pcadf077378077N003_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
23 Jan 2008 updated for CIAO 4.0: filename and screen output updated for reprocessed data (version N003 event file)
24 Jun 2008 updated image display to place figures inline with text

Return to Threads Page: Top | All | Data Prep
Hardcopy (PDF): A4 | Letter
Last modified: 24 Jun 2008


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.