Skip to the navigation links
Last modified: 5 Feb 2010
Where are the PDFs?

Setting the Observation-specific Bad Pixel Files

CIAO 4.2 Science Threads


Last Update: 5 Feb 2010 - updated for CIAO 4.2: link to the new Customizing an ACIS Bad Pixel File thread


Several of the CIAO data analysis tools directly use calibration data from the tool's parameter file, but many access it via calls to the ardlib.par parameter file. Although the majority of these calibration files are now controlled by the Chandra Calibration Database (CALDB), the observation-specific bad pixel list must still be set by the user. This list contains both the known bad pixels and columns for each chip, plus any additional ones for that specific observation.


To set the observation-specific bad pixel file for an analysis session. This ensures that the tools will locate the proper bad pixel file in ardlib.par when it is needed.

Read this thread if:

you are beginning a new ACIS or HRC analysis session.

Related Links:


Get Started

Sample ObsIDs used: 1843 (ACIS-I, G21.5-0.9); 144 (HRC-I, G21.5-0.9); 1557 (HRC-S, G21.5-09)

File types needed: evt2; bpix1

If you have created a new bad pixel file by following one of these threads:

use that file in this thread. Otherwise, use the bpix1.fits file from the Archive.

In the following examples, these filenames will be used:

  • ACIS: /data/ObsID1843/acis1843_new_bpix1.fits
    (created with the ACIS hot pixel tools)

  • HRC-I: /data/ObsID144/secondary/hrcf00144_000N005_bpix1.fits

  • HRC-S: /data/ObsID1557/secondary/hrcf01557_000N003_bpix1.fits

Reminder: Reset ardlib Between Analysis Sessions

Use caution when analyzing more than one dataset; either "punlearn" or delete the ardlib.par file before you start processing another dataset.

If you find that tools/scripts complain about being unable to find the bad pixel file for an observation that is different from the one you are observing, chances are that you have not cleaned out your ardlib.par file.

ACIS Observations

The process of setting the bad pixel parameters for an ACIS observation has been simplified with the acis_set_ardlib script. If users prefer, it is also possible to set the parameters manually.

Download the script

This section of the thread uses the acis_set_ardlib script, which is part of the CIAO Scripts distribution. The CIAO scripts package should be the following version or newer:

17 Apr 2009

Please check that you have at least this version of the scripts package installed before continuing. If you do not have the scripts installed or need to update to a newer version, refer to the Scripts page.

Running acis_set_ardlib

Prior to version 1.5, the script would look for a file that ended in "bpix1.fits" in the current and ../secondary/ directories. The script now requires you to supply the full filename. This change was made to allow easy use of the output from acis_run_hotpix, as the new bad pixel file is not required to end in bpix1.fits.

The absolutepath parameter ("yes" by default) tells the script to include the complete path to the file in ardlib.par, as shown in this example:

unix% punlearn ardlib

unix% pwd

unix% acis_set_ardlib acis1843_new_bpix1.fits 
Updated ardlib parameter file: /home/username/cxcds_param4/ardlib.par
  AXAF_ACIS0_BADPIX_FILE -> /data/ObsID1843/acis1843_new_bpix1.fits[BADPIX0]
  AXAF_ACIS1_BADPIX_FILE -> /data/ObsID1843/acis1843_new_bpix1.fits[BADPIX1]
  AXAF_ACIS2_BADPIX_FILE -> /data/ObsID1843/acis1843_new_bpix1.fits[BADPIX2]
  AXAF_ACIS3_BADPIX_FILE -> /data/ObsID1843/acis1843_new_bpix1.fits[BADPIX3]
  AXAF_ACIS6_BADPIX_FILE -> /data/ObsID1843/acis1843_new_bpix1.fits[BADPIX6]
  AXAF_ACIS7_BADPIX_FILE -> /data/ObsID1843/acis1843_new_bpix1.fits[BADPIX7]

It is recommended that the script be run with absolutepath=yes so that the correct bad pixel file is accessed, regardless of the working directory.

The content of the parameter file may be checked using plist acis_set_ardlib.

Optional: Setting the ACIS parameters manually

If you prefer, it is possible to set the ARDLIB parameters manually instead. First determine which chips were on for the observation, then set the appropriate parameters. This example uses the foreach syntax for the csh or tcsh shell. If you are using another shell, e.g. bash, change the loop syntax accordingly.

unix% dmkeypar acisf01843N002_evt2.fits DETNAM echo+

unix% foreach d ( 0 1 2 3 6 7 )
foreach? pset \
         ardlib AXAF_ACIS${d}_BADPIX_FILE = \
foreach? end

HRC Observations

Setting the bad pixel file for HRC observations is straightforward, as there is only one ARDLIB parameter each for HRC-S and HRC-I.

unix% pset ardlib \
unix% pset ardlib \

Check the Local ardlib.par File

Verify that ardlib.par now references the correct bad pixel files (this example shows the files for all three detectors):

unix% plist ardlib | less

Parameters for /home/username/cxcds_param4/ardlib.par

# Ardlib parameter file
# Non-absolute file names are searched in the directories given
# by the ArdlibDataPath variable.
ArdlibDataPath = $ASCDS_CALIB     Directory containing data files

# Generic Mission Support
. (lines omitted)
# AXAF ACIS Bad Pixel Files
# Use "NONE" to ignore bad pixels.
AXAF_ACIS0_BADPIX_FILE = /data/ObsID1843/acis1843_new_bpix1.fits[BADPIX0] Enter ACIS-0 Bad Pixel File
AXAF_ACIS1_BADPIX_FILE = /data/ObsID1843/acis1843_new_bpix1.fits[BADPIX1] Enter ACIS-1 Bad Pixel File
AXAF_ACIS2_BADPIX_FILE = /data/ObsID1843/acis1843_new_bpix1.fits[BADPIX2] Enter ACIS-2 Bad Pixel File
AXAF_ACIS3_BADPIX_FILE = /data/ObsID1843/acis1843_new_bpix1.fits[BADPIX3] Enter ACIS-3 Bad Pixel File
AXAF_ACIS4_BADPIX_FILE = CALDB            Enter ACIS-4 Bad Pixel File
AXAF_ACIS5_BADPIX_FILE = CALDB            Enter ACIS-5 Bad Pixel File
AXAF_ACIS6_BADPIX_FILE = /data/ObsID1843/acis1843_new_bpix1.fits[BADPIX6] Enter ACIS-6 Bad Pixel File
AXAF_ACIS7_BADPIX_FILE = /data/ObsID1843/acis1843_new_bpix1.fits[BADPIX7] Enter ACIS-7 Bad Pixel File
AXAF_ACIS8_BADPIX_FILE = CALDB            Enter ACIS-8 Bad Pixel File
AXAF_ACIS9_BADPIX_FILE = CALDB            Enter ACIS-9 Bad Pixel File
AXAF_HRC-I_QE_FILE = CALDB            Enter HRC-I Mean QE file
AXAF_HRC-I_QEU_FILE = CALDB            Enter HRC-I Mean QE file
AXAF_HRC-I_BADPIX_FILE = /data/ObsID144/secondary/hrcf00144_000N003_bpix1.fits Enter HRC-I Badpix file
AXAF_HRC-S1_QE_FILE = CALDB            Enter HRC-S1 Mean QE file
AXAF_HRC-S2_QE_FILE = CALDB            Enter HRC-S2 Mean QE file
AXAF_HRC-S3_QE_FILE = CALDB            Enter HRC-S3 Mean QE file
AXAF_HRC-S1_QEU_FILE = CALDB            Enter HRC-S1 QE Uniformity file
AXAF_HRC-S2_QEU_FILE = CALDB            Enter HRC-S2 QE Uniformity file
AXAF_HRC-S3_QEU_FILE = CALDB            Enter HRC-S3 QE Uniformity file
AXAF_HRC-S_BADPIX_FILE = /data/ObsID1557/secondary/hrcf01557_000N002_bpix1.fits Enter HRC-S Badpix file
. (lines omitted)

Note that the parameter file now resides in the local parameter directory (/home/username/cxcds_param4) as a result of the pset steps. All the CIAO tools will now access this version rather than the default one.


Again, remember to "punlearn" or delete your ardlib.par file after completing analysis of this dataset to ensure that the proper bad pixel maps are used the next time that ardlib.par is referenced by a tool.

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

    badpixfile = acis1843_new_bpix1.fits Bad pixel file for the observation
 (absolutepath = yes)             Use an absolute path in the parameter file
   (ardlibfile = ardlib)          Parameter file to change
      (verbose = 1)               Verbosity (0 for no screen output)
         (mode = ql)              


05 Jan 2005 updated for CIAO 3.2: ardlib.par has new contamination file parameters; added information on creating a new bad pixel file with the acis hot pixel tools
20 Jan 2005 revised to use new version of the acis_set_ardlib script; separated ACIS and HRC sections
08 Dec 2005 reviewed for CIAO 3.3: no changes
01 Dec 2006 reviewed for CIAO 3.4: include link to the Creating a New Observation-Specific HRC Bad Pixel File thread
10 Jan 2008 updated for CIAO 4.0: default parameter file is $HOME/cxcds_param4
12 Jan 2009 updated for CIAO 4.1: foreach syntax is for (t)csh shell, user has to change syntax if using another shell
06 May 2009 check the version of the CIAO scripts package instead of the individual script
05 Feb 2010 updated for CIAO 4.2: link to the new Customizing an ACIS Bad Pixel File thread

Return to Threads Page: Top | All | Data Prep

Where are the PDFs?
Last modified: 5 Feb 2010