Skip to the navigation links
Last modified: 1 Jul 2010
Where are the PDFs?

New ACIS Bad Pixel File: Identify ACIS Hot Pixels and Cosmic Ray Afterglows

CIAO 4.2 Science Threads


Last Update: 1 Jul 2010 - the chandra_repro reprocessing script automates data processing for ACIS imaging data


[New] A reprocessing script for ACIS and HRC imaging data: the chandra_repro script runs the data processing steps in this thread for ACIS imaging data. To use the reprocessing script, install the contrib tarfile. Refer to "ahelp chandra_repro" for more information.

An afterglow is the residual change from the interaction of a cosmic ray in a CCD. Some of the excess charge is captured by charge traps and released in a few to a few dozen subsequent frames. If afterglow events are not removed from the data, they can result in the spurious "detection" of faint sources.

Users should remove any afterglow correction that was applied via acis_detect_afterglow (e.g. during SDP) before running this thread; see the Remove the acis_detect_afterglow Correction thread for instructions.

Be sure to read the Cosmic-Ray Afterglows why topic and the caveats section of this thread.


To flag hot pixel and afterglow events in the event file, and to create a new bad pixel file with those pixels identified as bad.

Read this thread if:

If your data have gone through Reprocessing III, you do not have to run this thread. Get Started shows how to check the software version used in processing your data.

Related Links:


About the ACIS Hot Pixel Tools

acis_run_hotpix is a script which executes, in this order, acis_build_badpix, acis_find_hotpix, acis_classify_hotpix, and acis_build_badpix a second time.

Collectively, these tools

  1. search for pixels where the bias value is too low or too high (acis_build_badpix),

  2. search for suspicious pixels where there is an unusually large or unusually small number of events (acis_find_hotpix),

  3. classify the events on suspicious pixels as being associated with cosmic ray afterglows, hot pixels or astrophysical sources (acis_classify_hotpix), and

  4. write the bad pixels (acis_classify_hotpix) and their neighbors (acis_build_badpix) to the output bad pixel file.

Note that the bad pixels in the input bad pixel file are not all necessarily included in the output bad pixel file. All the bad pixels are recalculated and flagged as appropriate in the output file.

Which status bits are used?

acis_find_hotpix identifies three different kinds of anomalies: hot pixels, afterglow events, and pixels with bright bias. These are represented by the following status bits in the bad pixel file:

Cause Bad Pixel Status Bit
hot pixel 14
afterglow event 15
bright bias 16

When the bad pixel and event files are input to acis_process_events, different bits are set in the event file to record these same anomalies:

Cause Event Status Bit
hot pixel 4
afterglow event 16
bright bias 4

For more information on the status bits in the bad pixel file, see "ahelp acis_build_badpix". Technical information on status bits in bad pixel and event files is available from the memos on the MIT CXC Documents page.

Doing pileup analysis

With the acis_detect_afterglow correction, users were advised to filter the data to retain all events tagged as afterglows if the source is piled and you intended to model the pileup. The new hot pixel tools are more judicious with respect to throwing away piled source events, so users should be able to analyze the data without having to unfilter events first. The Using a Pileup Model thread has more information on pileup modeling.

Get Started

Sample ObsID used: 459 (HETG/ACIS-S, 3C 273)

File types needed: evt1; bpix1; msk1; bias0; pbk0

The event file (acis_459_reset_evt1.fits) was created by running the Remove the acis_detect_afterglow Correction; it is not the evt1 file from standard processing. Also, it is now possible to to obtain the correct bias and parameter block files from ChaSeR or WebChaSeR; they are included in the secondary data products.

In this thread, we assume that all relevant files are in the same working directory.

Check the mode of the observation:

unix% dmkeypar acis_459_reset_evt1.fits READMODE echo+

unix% dmkeypar acis_459_reset_evt1.fits DATAMODE echo+

This is a TIMED FAINT mode observation, so acis_run_hotpix may be used.

We also need to check the processing version:

unix% dmkeypar acis_459_reset_evt1.fits ASCDSVER echo+
CIAO 4.2

Since this data has already had acis_detect_afterglow correction removed, the ASCDSVER keyword value is the CIAO software version that was used. If you have not removed the correction yet, you should see something like this:

unix% dmkeypar acisf00459_000N002_evt1.fits ASCDSVER echo+

The observation was processed before the tool was included pipeline, i.e. the ASCDSVER is lower than DS 7.4.0. Note that the version naming convention changed after version R4CU5UPD14 to the "DS" system, starting with DS 6.0.0. Before continuing, remove any afterglow correction that was applied via acis_detect_afterglow (e.g. during SDP); see the Remove the acis_detect_afterglow Correction for instructions.

Create a New Bad Pixel File

The acis_run_hotpix tool is run to create the new bad pixel file:

unix% punlearn acis_run_hotpix
unix% pset acis_run_hotpix infile=acis_459_reset_evt1.fits
unix% pset acis_run_hotpix outfile=acis_459_new_bpix1.fits
unix% pset acis_run_hotpix badpixfile=acisf00459_000N002_bpix1.fits
unix% pset acis_run_hotpix biasfile=@bias_files.lis 
unix% pset acis_run_hotpix maskfile=acisf00459_000N002_msk1.fits
unix% pset acis_run_hotpix pbkfile=acisf063875928N002_pbk0.fits
unix% acis_run_hotpix
Input event list (acis_459_reset_evt1.fits): 
Output bad pixel file (acis_459_new_bpix1.fits): 
Input mask file ( <filename> | default | none | NONE ) (acisf00459_000N002_msk1.fits): 
Input bad pixel file (acisf00459_000N002_bpix1.fits): 
Input bias images (@bias_files.lis): 

The badpixfile parameter is set to the observation-specific bad pixel file from the Archive, not a bad pixel file from the CALDB. The latter should not be used when running this tool.

Note that for most observations there will be more than one bias file. All the files must be input to the biasfile parameter, either as a list or as a stack (see ahelp stack for more information). Here we used:

unix% more bias_files.lis 

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

Applying the File

Now that we have a new bad pixel file, it needs to be applied to the event file. To do so, run acis_process_events as shown in the New Level=2 Event File thread. The bad pixel file is used in the badpixfile parameter:

unix% pset acis_process_events badpixfile=acis_459_new_bpix1.fits

Also, set this as the the observation-specific bad pixel file for any subsequent analysis tasks; see the Setting the Observation-specific Bad Pixel Files thread for instructions.

Warning message: "File /tmp/hotpixel_list.fits does not have any rows"

Some datasets will return this warning when acis_run_hotpix is run:

# acis_classify_hotpix (CIAO 4.2): WARNING: File /tmp/hotpixel_list.fits does not have any rows.

It just means that no hot pixels were identified in the observation, which is a normal occurrence.


At present, the tool acis_run_hotpix is being used in the pipeline to identify cosmic-ray afterglows. The results obtained using this tool should be sufficient unless a user is interested in searching for or studying sources that have a small number of counts (i.e. less than about 10). In these situations, it may be advantageous to use the tool acis_detect_afterglow (in addition to acis_run_hotpix) to try to eliminate afterglows that have only a few events. Some care is required to ensure that acis_detect_afterglow does not eliminate a significant number of real x-ray events.

For more information, read the Cosmic-Ray Afterglows why topic.

There are a few additional caveats associated with acis_run_hotpix.

  • acis_run_hotpix finds few afterglows that have fewer than about 10 events.

  • acis_run_hotpix will not find afterglows and hot pixels if they are embedded in a bright source.

  • The tool can misidentify some legitimate X-ray events as bad. The worst case scenario is a very faint source that has a flare whose duration is much less than the period of the dither (nominally 707 s in the Z direction). The dither why topic has more information.

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

        infile = acis_459_reset_evt1.fits Input event list
       outfile = acis_459_new_bpix1.fits Output bad pixel file
    badpixfile = acisf00459_000N002_bpix1.fits Input bad pixel file
      biasfile = @bias_files.lis  Input bias images
      maskfile = acisf00459_000N002_msk1.fits Input mask file ( <filename> | none | NONE )
       pbkfile = acisf063875928N002_pbk0.fits Input parameter block file
   (probthresh = 1.0e-3)          Minimum significance of potentially bad pixels after trials (e.g. 1 sig = 0.159, 2 sig = 0.0228, and 3 sig = 0.00135)
     (regwidth = 7)               Size of reference region for comparison (e.g. 7 pixels x 7 pixels)
  (expnothresh = 10)              Minimum difference in frame numbers between hot pixels
   (biasthresh = 6)               Minimum bias offset for invalid pixels in adu
      (tempdir = ${ASCDS_WORK_PATH} -> /tmp) Temporary work directory
      (verbose = 0)               Debug level
      (clobber = no)              Clobber output files?
         (mode = ql)              


10 Feb 2005 updated for CIAO 3.2.1: new acis_run_hotpix parameter (pbkfile); new interface for retrieving bias files
16 Feb 2005 clarified statement in Overview that acis_run_hotpix should not be used on CC-mode data
23 Jun 2005 CIAO 3.2.2 patch: added VFAINT mode data section
21 Jul 2005 explained "File /tmp/hotpixel_list.fits does not have any rows" Warning
12 Dec 2005 updated for CIAO 3.3: users should be able to obtain correct bias and parameter block files from ChaSeR or WebChaSeR; minor changes to acis_run_hotpix parameter file
22 Mar 2006 added Which status bits are used? subsection
29 Mar 2006 expanded information in Which status bits are used? subsection
05 Apr 2006 updated ASCDSVER check in Get Started to show that it may return a CIAO version
01 Dec 2006 updated for CIAO 3.4: added "Create a New ACIS Bad Pixel File" to thread title; CIAO version in warning
14 Dec 2007 updated for CIAO 4.0: Sherpa link points to 3.4 website for now; removed outdated VFAINT section; new caveat: acis_run_hotpix finds few afterglows that have fewer than 10 events; linked to Afterglows why topic
12 Jan 2009 updated for CIAO 4.1: Sherpa link points to 4.1 website
08 Feb 2010 updated for CIAO 4.2: link to the new Customizing an ACIS Bad Pixel File thread
01 Jul 2010 the chandra_repro reprocessing script automates data processing for ACIS imaging data

Return to Threads Page: Top | All | Data Prep

Where are the PDFs?
Last modified: 1 Jul 2010