Chandra X-Ray Observatory
	(CXC)
Skip to the navigation links
Last modified: 18 Dec 2014

URL: http://cxc.harvard.edu/ciao/threads/hrc_badpix/

New Observation-Specific HRC Bad Pixel File

CIAO 4.7 Science Threads


Overview

Synopsis:

The HRC-I and HRC-S bad pixel files are used both to define the valid coordinate regions in the detectors and to identify bad (hot) pixels. Observation-specific bad pixel files are generated from calibration data products by applying the appropriate degap corrections and selecting all time-dependent bad pixel regions in the calibration data that are appropriate to the time of the observation.

Purpose:

To generate a new observation-specific HRC bad pixel file when you have re-run hrc_process_events using degap corrections different from those used in standard processing, or you have identified new bad pixel regions that are not contained in the CALDB bad pixel list.

Related Links:

Last Update: 18 Dec 2014 - Review for CIAO 4.7; no changes.


Contents


Get Started

Download the sample data: 6476 (HRC-I, HZ 43)

unix% download_chandra_obsid 6476 evt1,bpix

or any FITS file for the observation whose header contains the keywords TSTART, TSTOP, & DETNAM.

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

In order to run hrc_build_badpix, you need an "observation parameter file", obs.par, file for the observation, which contains the TSTART, TSTOP, and DETNAM parameters. This is created by running dmmakepar:

unix% dmmakepar hrcf06476_000N004_evt1.fits hrcf06476_obs.par

unix% less hrcf06476_obs.par
title,s,h,"AO7 Calibration Observations of HZ43",,,"Proposal title"
observer,s,h,"Dr. CXC Calibration",,,"Principal investigator"
object,s,h,"HZ43",,,"Source name"
origin,s,h,"ASC",,,"Source of FITS file"
...
detnam,s,h,"HRC-I",,,"Detector"
...
tstart,r,h,270164100.35322,,,"Observation start time"
tstop,r,h,270167471.57838,,,"Observation end time"
...

Updating the Bad Pixel File to the Current CALDB

The tool may be run to generate a new observation-specific bad pixel file from the newest available degap and bad pixel lists. To do so, set both infile and degapfile parameters to "CALDB" and the tool will automatically locate the newest appropriate file in the CALDB.

unix% punlearn hrc_build_badpix 
unix% pset hrc_build_badpix infile=CALDB
unix% pset hrc_build_badpix degapfile=CALDB
unix% pset hrc_build_badpix outfile=hrcf06476_bpix1_caldb.fits
unix% pset hrc_build_badpix obsfile=hrcf06476_obs.par 
unix% hrc_build_badpix
Input (ARD) bad pixel file (CALDB): 
Output (Level 1) bad pixel file (hrcf06476_bpix1_caldb.fits): 
Input observation parameter file (hrcf06476_obs.par): 
Input degap file (NONE | none | COEFF | <filename>) (CALDB): 
# hrc_build_badpix (CIAO 4.5): The following error occurred 3 times:
        dsHBBSETTLMINERR -- WARNING: chip coord. is outside of valid range. Set to TLMIN.
# hrc_build_badpix (CIAO 4.5): The following error occurred 3 times:
        dsHBBSETTLMAXERR -- WARNING: chip coord. is outside of valid range. Set to TLMAX.

The warnings may be ignored.

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

This bad pixel file is suitable for use with a dataset that has also been reprocessed with the newest calibration, e. g. by following the HRC Data Preparation Analysis Guide.


Generating a Bad Pixel File to Match Event Data Calibration

When creating a bad pixel file for use with a specific observation, it is important to make sure that the degap solution used is the same one that was applied to the event data. The degap solution is applied during analysis when converting from raw to chip coordinates.

Determine the degap solutions

The degap filename is stored in the DEGAP header keyword of the event and bad pixel files:

unix% dmkeypar hrcf06476_000N004_evt1.fits DEGAP echo+
hrciD1999-07-22gaplookupN0003.fits

unix% dmkeypar hrcf06476_000N004_bpix1.fits DEGAP echo+
/data/CALDB/sdp/data/chandra/hrc/bcf/gaplookup/hrciD1999-07-22gaplookupN0003.fits

The event data and bad pixel file have been reprocessed with the same version of the degap file. In this case, it is not necessary to create a new bad pixel file.

This data will still be used to show how the bad pixel file would be remade to use the same calibration as the event data.


Run hrc_build_badpix, specifying the degap file

Now we run hrc_build_badpix, specifying which degap file should be used when creating the new bad pixel file. Since the infile parameter is set to CALDB, the newest bad pixel file from the CALDB will be used for that input.

unix% punlearn hrc_build_badpix 
unix% pset hrc_build_badpix infile=CALDB
unix% pset hrc_build_badpix degapfile=$CALDB/data/chandra/hrc/gaplookup/hrciD1999-07-22gaplookupN0003.fits
unix% pset hrc_build_badpix outfile=hrcf06476_bpix1_match.fits
unix% pset hrc_build_badpix obsfile=hrcf06476_obs.par 
unix% hrc_build_badpix
Input (ARD) bad pixel file (CALDB): 
Output (Level 1) bad pixel file (hrcf06476_bpix1_match.fits): 
Input observation parameter file (hrcf06476_obs.par): 
Input degap file (NONE | none | COEFF | <filename>) (/soft/ciao/CALDB/data/chandra/hrc/gaplookup/hrciD1999-07-22gaplookupN0003.fits): 

# hrc_build_badpix (CIAO 4.5): The following error occurred 3 times:
        dsHBBSETTLMINERR -- WARNING: chip coord. is outside of valid range. Set to TLMIN.
# hrc_build_badpix (CIAO 4.5): The following error occurred 3 times:
        dsHBBSETTLMAXERR -- WARNING: chip coord. is outside of valid range. Set to TLMAX.

The warnings may be ignored.

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


Applying the File

Now that we have a new bad pixel file, it needs to be applied to the event file. To do so, use the chandra_repro script or follow the Create a New Level=2 Event File thread.

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.



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


        infile = CALDB            Input (ARD) bad pixel file
       outfile = hrcf06476_bpix1_caldb.fits Output (Level 1) bad pixel file
       obsfile = hrcf06476_obs.par Input observation parameter file
     degapfile = CALDB            Input degap file (NONE | none | COEFF | <filename>)
         (cfu1 = 1.0)             u axis 1st order cor. factor
         (cfu2 = 0.0)             u axis 2nd order cor. factor
         (cfv1 = 1.0)             v axis 1st order cor. factor
         (cfv2 = 0.0)             v axis 2nd order cor. factor
      (logfile = STDOUT)          Output debug log file (<filename>, NONE, STDOUT)
      (clobber = no)              Overwrite output file(s) if already exists?
      (verbose = 0)               Debug level (0-5)
         (mode = ql)              
    


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


        infile = CALDB            Input (ARD) bad pixel file
       outfile = hrcf06476_bpix1_match.fits Output (Level 1) bad pixel file
       obsfile = hrcf06476_obs.par Input observation parameter file
     degapfile = /soft/ciao/CALDB/data/chandra/hrc/gaplookup/hrciD1999-07-22gaplookupN0003.fits Input degap file (NONE | none | COEFF | <filename>)
         (cfu1 = 1.0)             u axis 1st order cor. factor
         (cfu2 = 0.0)             u axis 2nd order cor. factor
         (cfv1 = 1.0)             v axis 1st order cor. factor
         (cfv2 = 0.0)             v axis 2nd order cor. factor
      (logfile = STDOUT)          Output debug log file (<filename>, NONE, STDOUT)
      (clobber = no)              Overwrite output file(s) if already exists?
      (verbose = 0)               Debug level (0-5)
         (mode = ql)              
    

History

01 Dec 2006 new for CIAO 3.4
25 Jan 2008 reviewed for CIAO 4.0: no changes
06 Feb 2009 updated for CIAO 4.1: degap file path updated for CALDB 4
05 Feb 2010 reviewed for CIAO 4.2: no changes
13 Jan 2011 reviewed for CIAO 4.3: no changes
11 Jan 2012 reviewed for CIAO 4.4: no changes
03 Dec 2012 Review for CIAO 4.5; updated file versions.
02 Dec 2013 Review for CIAO 4.6; no changes
18 Dec 2014 Review for CIAO 4.7; no changes.


Last modified: 18 Dec 2014
Smithsonian Institute Smithsonian Institute

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-2014. All rights reserved.