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

Skip the navigation links
Last modified: 1 Dec 2006
Hardcopy (PDF): A4 | Letter

Creating a New Observation-Specific HRC Bad Pixel File

[CIAO 3.4 Science Threads]



Overview

Last Update: 1 Dec 2006 - new for CIAO 3.4

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.

Read this thread if:

you are working with an HRC dataset and you have either 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.

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




Contents



Get Started

Sample ObsID used: 6476 (HRC-I, HZ 43)

File types needed: evt1; bpix1

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 obs.par file for the observation, which contains the TSTART, TSTOP, and DETNAM parameters. This is created by running dmmakepar:

unix% dmmakepar hrcf06476_000N001_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"
creator,s,h,"hrc_process_events - Version DS7.6.8",,,"tool that created this output"
ascdsver,s,h,"7.6.8",,,"Processing system revision"
...


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 3.4): The following error occurred 3 times:
        dsHBBSETTLMINERR -- WARNING: chip coord. is outside of valid range. Set to TLMIN.
# hrc_build_badpix (CIAO 3.4): 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 hrc_6476_new_evt1.fits DEGAP echo+
hrciD1999-07-22gaplookupN0002.fits

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

In this case, the event data have been reprocessed with a newer version of the degap file. The bad pixel file should be remade to use the same calibration.


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/bcf/gaplookup/hrciD1999-07-22gaplookupN0002.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/bcf/gaplookup/hrciD1999-07-22gaplookupN0002.fits): 

# hrc_build_badpix (CIAO 3.4): The following error occurred 3 times:
        dsHBBSETTLMINERR -- WARNING: chip coord. is outside of valid range. Set to TLMIN.
# hrc_build_badpix (CIAO 3.4): 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, run hrc_process_events as shown in the Create a New Level=2 Event File thread. The bad pixel file is used in the badpixfile parameter:

unix% pset hrc_process_events badpixfile=hrcf06476_bpix1_match.fits

Also, set this as the the observation-specific bad pixel file for any subsequent analysis tasks; see the Use 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/bcf/gaplookup/hrciD1999-07-22gaplookupN0002.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

Return to Threads Page: Top | All | Data Prep
Hardcopy (PDF): A4 | Letter
Last modified: 1 Dec 2006


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.