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

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

Computing Average HRC Dead Time Corrections

CIAO 4.7 Science Threads


Overview

Synopsis:

HRC deadtime corrections are determined as a function of time from detector total event and valid event counters (usually sampled every 2.05 seconds but may differ, depending on telemetry format) and written to a deadtime factor (dtf1) file. The average deadtime correction (DTCOR) for an observation is computed from the dtf1 file, filtered by the relevant good time intervals, and is applied to the corresponding ONTIME to compute the LIVETIME (and EXPOSURE) of the observation. If the user applies different time filters then the DTCOR, LIVETIME, and EXPOSURE keyword values should be updated to match.

Purpose:

To recompute deadtime statistics from an HRC deadtime factor file (dtf1.fits) with different time filters from those used in standard processing, and to use them to update the DTCOR, LIVETIME, and EXPOSURE of the observation.

[NOTE]
Note

This thread is needed to correct the count rates (counts/sec) when doing photometry. Light curves and exposure maps take the dtf1.fits file in as a separate input and do not require the DTCOR keyword value be updated in this way.

Run this thread if:

The event file was filtered on time, changing the good time intervals (GTIs), e.g. as a result of application of a background. Time filters may also be applied if the deadtime factors have been flagged as variable in the standard deadtime statistics (std_dtfstat1) file.

This thread is also required if your data was processed with software version 7.6.4 through 7.6.7: a bug in HRC standard processing led to the use of incorrect good time intervals (GTIs) in the calculation of DTCOR in the dtfstats file, and hence the LIVETIME and EXPOSURE. Get Started shows how to determine what version of the software has been applied to your data.

Related Links:

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


Contents


Get Started

Download the sample data: 3698 (HRC-I, CAS A)

unix% download_chandra_obsid 3698 evt2,dtf

This thread should be done after any necessary reprocessing is completed (e.g. running chandra_repro).

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

The software version is stored in the ASCDSVER header keyword:

unix% dmkeypar hrcf03698_000N004_dtf1.fits ASCDSVER echo+
8.4.5

This example will use a time filter on the event file.

unix% dmcopy "hrcf03698N004_evt2.fits[time=164259750:164261850]" filter_evt2.fits

The time range corresponds to a period of quiescent background. We can check that the time filter updated the ONTIME and related keywords; however, the DTCOR value is not automatically updated

unix% dmlist hrcf03698N004_evt2.fits  header,clean | egrep 'DTCOR|ONTIME|LIVETIME|EXPOSURE'
ONTIME                    5171.3814679682 [s]       
DTCOR                    0.755343479530             Dead time correction
LIVETIME                  3906.1692719921           Ontime multiplied by DTCOR
EXPOSURE                  3906.1692719921           Total exposure time, with all known corr. appl.

unix% dmlist filter_evt2.fits header,clean | egrep 'DTCOR|ONTIME|LIVETIME|EXPOSURE'
ONTIME                    2100.0 [s]                
DTCOR                    0.755343479530             Dead time correction
LIVETIME                  1586.2213070130           Ontime multiplied by DTCOR
EXPOSURE                  1586.2213070130           Total exposure time, with all known corr. appl.

Examine the deadtime corrections

We can find the average, mean, deadtime correction in the dtf1.fits file using dmstat:

unix% dmstat "hrcf03698_000N004_dtf1.fits[cols dtf]"
DTF
    min:    0         @:    1 
    max:    1         @:    2 
   mean:    0.76564416062 
  sigma:    0.270005164 
    sum:    2081.0208286 
   good:    2718 
   null:    0 

This value, 0.766, is slightly different from the value in the header of the event file

unix% dmkeypar filter_evt2.fits DTCOR echo+
0.75534347953

The value in the event file is computed with hrc_dtfstats which uses data during the good time intervals and is computed using a good-time weighted average.

The other thing to note is the large standard deviation (sigma) reported by dmstat. This indicates that the DTF values are highly variable. It can therefore be useful to examine the files in ChIPS:

unix% chips -n
chips> make_figure("hrcf03698_000N004_dtf1.fits[cols time,dtf]", "line.color=blue symbol.style=none")
chips> add_vline(164259750, "color=red")
chips> add_vline(164261850, "color=red")

The plot is shown Figure 1. The dead time factors are highly variable due to a combination of the bright extended source and mildly varying background.

[Thumbnail image: The plot of time (s) vs DTF is highly variable.]

[Version: full-size]

[Print media version: The plot of time (s) vs DTF is highly variable.]

Figure 1: Plot of deadtime correction value vs. time

The dead time factors are highly variable due to a combination of the bright extended source and mildly varying background.

The red lines indicate the time range that is being used in this example. The individual DTF values in this range are much closer to 1 and therefore the DTCOR value needs to be recomputed.

Quit ChIPS before continuing:

chips> quit()

Since a time filter was applied over a time range where the DTF values are different from the mean, the DTCOR value must be recomputed.


Recompute the deadtime statistics

The new GTI created by the time filter needs to be used to recompute the deadtime statistics using the hrc_dtfstats tool. This tool takes the existing dtf1.fits file and creates a new file with the event GTI information applied.

unix% punlearn hrc_dtfstats
unix% pset hrc_dtfstats infile=hrcf03698_000N004_dtf1.fits
unix% pset hrc_dtfstats outfile=dtf.stats
unix% pset hrc_dtfstats gtifile=filter_evt2.fits
unix% hrc_dtfstats
Input file (hrcf03698_000N004_dtf1.fits): 
Output file (dtf.stats): 
File containing GTI to filter on (<filename>|NONE) (filter_evt2.fits): 

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

The new dtfstats file has a value of DTCOR=0.964

unix% dmlist dtf.stats"[cols DTCOR]" data,clean
#  DTCOR
     0.96380777655308

which agrees with the range of values plotted in Figure 1.


Update the Event File

Finally, we update the event list header with dmhedit.

unix% dmhedit filter_evt2.fits file= op=add key=DTCOR value=0.963807

The LIVETIME and ONTIME also need to be corrected for the change in DTCOR. They will automatically get updated whenever any time filter is applied to the file. We can use an empty filter to trigger the update

unix% dmcopy filter_evt2.fits"[time=:]" dtcorr_evt2.fits

We can check the results using dmdiff

unix% dmdiff filter_evt2.fits dtcorr_evt2.fits data=no comments=no
Infile 1:  filter_evt2.fits
Infile 2:  dtcorr_evt2.fits

-----------------------
HEADER VALUE DIFFERENCES
-----------------------


Message:                                Keyword:              Value(s):                    Diff:
--------                                 -------              ---------                    -----
Values are not equal                    CHECKSUM 3Gd6AGZ36Gd3AGZ3  V9meW7lbV7lbV7lb
Values are not equal                     HISTNUM              475  482                        +7
Values are not equal                    LIVETIME   1586.221307013  2023.9947            +437.773
Values are not equal                    EXPOSURE   1586.221307013  2023.9947            +437.773
...

Which shows the expected change in the LIVETIME and the EXPOSURE keywords.

The corrected event list, dtcorr_evt2.fits, should be used for all further analysis.



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


        infile = hrcf03698_000N004_dtf1.fits Input file
       outfile = dtf.stats        Output file
       gtifile = filter_evt2.fits File containing GTI to filter on (<filename>|NONE)
    (lookupTab = ${ASCDS_CALIB}/dmmerge_header_lookup.txt -> /soft/ciao/data/dmmerge_header_lookup.txt) lookup table
      (maincol = DTF)             Name of the deadtime factor column
       (errcol = DTF_ERR)         Name of the deadtime factor error column
     (chisqlim = 5)               Limit for the variability test
      (clobber = no)              Clobber the output file if it exists
      (verbose = 0)               Verbose level.
         (mode = ql)              
    

History

01 Dec 2006 new for CIAO 3.4
25 Jan 2008 updated for CIAO 4.0: updated ChIPS plotting; added dmstat command; new lookupTab parameter for header merging rules
24 Jun 2008 updated image display to place figures inline with text
06 Feb 2009 updated for CIAO 4.1: Python and S-Lang syntax included for ChIPS plotting
05 Feb 2010 updated for CIAO 4.2: ChIPS version
13 Jan 2011 reviewed for CIAO 4.3: no changes
15 Feb 2011 added link to the HRC Deadtime Correction with Telemetry Saturation caveat
28 Jun 2011 The CIAO 4.3 version of hrc_dtfstats should not be run on data processed with SDP version DS 8.4 (released 28 June 2011) or higher
15 Dec 2011 reviewed for CIAO 4.4: the hrc_dtfstats tool computes a simple average instead of an error-weighted average; minor updates to screen output. This software update makes the tool consistent with standard data processing (SDP); running this thread on recently-processed datasets will no longer introduce a regression into the data processing.
03 Dec 2012 Review for CIAO 4.5
02 Dec 2013 Review for CIAO 4.6
15 Jul 2014 Updated to use different OBS_ID that shows time variation within an observation.
18 Dec 2014 Reviewed 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.