Skip to the navigation links
Last modified: 10 June 2010
Where are the PDFs?

The HRC-I Background Event Files

CIAO 4.2 Science Threads


Last Update: 10 Jun 2010 - new for CIAO 4.2/CALDB 4.3.0


The High Resolution Camera (HRC) detectors are occasionally active while they are in a stowed position. Data taken during these active intervals have been released by the HRC calibration team as a set of stowed background event files for the HRC-I detector.


To create an HRC-I background event file tailored to a specific observation for imaging or spatial analyses, e.g. for use in the HRC-I Exposure Map and Fluxed Image thread.

For information on using the HRC-I background spectra files to select the "optimal" PI range to reduce the background signal in imaging analysis, follow the HRC-I Background Spectra Files thread instead.

Calibration Updates:

Related Links:


Get Started

Sample ObsID used: 144 (HRC-I, G21.5-0.9)

File types needed: evt2

Download the background event files

The HRC background event files are not included in the main CALDB download file, due to the substantial filesize. If you have not already installed them, you must download the HRC background events tarfile via ciao-install or from the the CALDB Download page before continuing with this thread.

The background event files are installed in the $CALDB/data/chandra/hrc/bkgrnd/ directory.

Download the script

This thread uses the hrc_bkgrnd_lookup script.

The script is part of the CIAO Scripts distribution. The CIAO scripts package should be the following version or newer:

09 June 2010

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.

Choosing the Correct File

Naming scheme

The HRC background event datasets are stored in the CALDB at $CALDB/data/chandra/hrc/bkgrnd/. There is a file for each year from 2000-2009:

unix% ls -1 $CALDB/data/chandra/hrc/bkgrnd/

Note that the file hrciD1999-12-06bkgrndN0001.fits is valid from 1999-12-06 to 2001-01-01. It is used for analysis for data taken in 2000. All the other files are valid from 01 January of the year in the filename to 01 January of the following year.

The naming scheme is:


Using hrc_bkgrnd_lookup

The hrc_bkgrnd_lookup script makes it easy to find an HRC-I background file that matches your data. The script takes an input event file and what background filetype is desired - event or spectrum - and returns the background file:

unix% hrc_bkgrnd_lookup hrcf00144N005_evt2.fits event

hrciD1999-12-06bkgrndN0001.fits is valid for all observations from 1999-12-06 to 2001-01-01, and ObsID 144 was observed in 2000:

unix% dmkeypar hrcf00144N005_evt2.fits DATE-OBS echo+

In addition to being printed to the screen, the background filename is also stored in the outfile parameter:

unix% pget hrc_bkgrnd_lookup outfile

Make a Local Copy of the Background File

Make a local copy of the file:

unix% cp \
      $CALDB/data/chandra/hrc/bkgrnd/hrciD1999-12-06bkgrndN0001.fits \

The tailor the background file to your dataset section explains what data processing is required in order to use the background in the analysis.

Tailor the background file to your dataset

Add the PNT header keywords

The pointing (PNT) header keyword values in the background files are set to zero:

unix% dmlist 144_bg.fits header |grep PNT
0072 RA_PNT                                  0           Real8        Pointing RA
0073 DEC_PNT                                 0           Real8        Pointing Dec
0074 ROLL_PNT                                0           Real8        Pointing Roll

These values indicate where the optical axis was during the observation. Having zero-values will cause the CIAO tool dmcoords to produce incorrect results when run with the background file.

To avoid this problem later in the analysis, the PNT values from the event file are copied into the background file header. This is done by creating a file of the event file header keywords with dmmakepar, extracting the PNT values, then adding them to the background file header with dmreadpar:

unix% dmmakepar hrcf00144N005_evt2.fits event_header.par

unix% grep _pnt event_header.par > event_pnt.par

unix% cat event_pnt.par
ra_pnt,r,h,278.38757642566,,,"Pointing RA"
dec_pnt,r,h,-10.572481776435,,,"Pointing Dec"
roll_pnt,r,h,266.2642947201,,,"Pointing Roll"

unix% chmod +w 144_bg.fits
unix% dmreadpar event_pnt.par "144_bg.fits[events]" clobber+

unix% dmlist 144_bg.fits header |grep PNT
0072 RA_PNT                     278.3875764257           Real8        Pointing RA
0073 DEC_PNT                    -10.5724817764           Real8        Pointing Dec
0074 ROLL_PNT                   266.2642947201           Real8        Pointing Roll

It is necessary to specify the "[events]" extension of the background file, or the keywords will be added to the NULL block header. The "clobber+" setting tells dmreadpar to overwrite the existing (zero) header PNT values.

Apply the status bit filter

A status-bit filter is applied to remove the events that standard processing would have removed as likely "background" events in generating the level=2 event file. The status filter is recorded in the file history:

unix% dmhistory hrcf00144N005_evt2.fits dmcopy

dmcopy infile=".../output/tmpf00144N005_evt2.fits[status=xxxxxx00xxxx0xxx00000000x0000000]"
kernel="default" option="" verbose="0" clobber="no" 

The standard HRC-I status filter - "status=xxxxxx00xxxx0xxx00000000x0000000" - was applied to this dataset. If a custom filter was used in creating the level=2 event file, use the same filter in this step:

unix% dmcopy "144_bg.fits[status=xxxxxx00xxxx0xxx00000000x0000000]" \

Reproject the background data

The reproject_events tool takes the time range covered by the aspect solution of the observation (intersected with GTIs from the match file) and shifts and expands it to cover the time range in the background dataset. Then a random time within the range of the background data subspace is selected and assigned to the event. The GTIs used are taken from the specified match file.

ObsID 144 has only one aspect solution file, which we assume to be in the current working directory. It is possible to use multiple asol files by using a stack for the aspect parameter; see this FAQ for more information.

The random parameter is set to a value other than -1. This tells the tool to apply a random aspect solution to each background event, thus sampling the dither of the observation.

unix% punlearn reproject_events
unix% pset reproject_events infile=144_filt_bg.fits
unix% pset reproject_events outfile=144_reproj_bg.fits
unix% pset reproject_events aspect=pcadf084154631N004_asol1.fits
unix% pset reproject_events match=hrcf00144N005_evt2.fits
unix% pset reproject_events random=0
unix% reproject_events
Input dataset/block specification (144_filt_bg.fits):
Output dataset/block specification (144_reproj_bg.fits):
Match file (hrcf00144N005_evt2.fits):

You can check the parameter file that was used with plist reproject_events.

The file 144_reproj_bg.fits can now be used in your analysis, e.g. for use in the HRC-I Exposure Map and Fluxed Image thread

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

        infile = 144_filt_bg.fits Input dataset/block specification
       outfile = 144_reproj_bg.fits Output dataset/block specification
         match = hrcf00144N005_evt2.fits Match file
       (aspect = pcadf084154631N004_asol1.fits) Aspect file
       (random = 0)               random seed (0 use time, -1 no randomize)
      (geompar = geom)            Parameter file for Pixlib Geometry files
      (verbose = 0)               Debug Level(0-5)
      (clobber = no)              Clobber existing file
         (mode = ql)


10 Jun 2010 new for CIAO 4.2/CALDB 4.3.0

Return to Threads Page: Top | All | Data Prep | Imag

Where are the PDFs?
Last modified: 10 June 2010