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

Computing Average HRC Dead Time Corrections

CIAO 4.2 Science Threads

[S-Lang Syntax]



Overview

Last Update: 5 Feb 2010 - updated for CIAO 4.2: ChIPS version

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, DTCOR, LIVETIME, and EXPOSURE keyword values should be updated.

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.

Read 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.

Note that there is no harm in applying these steps to your data, even if you are unsure if it's necessary.




Contents



Get Started

Sample ObsID used: 5969 (HRC-S, Vega)

File types needed: evt1 or evt2; dtf1

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

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 hrcf05969_000N003_dtf1.fits ASCDSVER echo+
7.6.7

Since these data were processed with a processing version between 7.6.4 and 7.6.7, they are affected by the bug described in the Overview, so we will complete this thread in its entirety.



Examine the deadtime corrections (optional)

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

unix% dmstat "hrcf05969_000N003_dtf1.fits[cols dtf]"
DTF
    min:        0             @:        1159 
    max:        1             @:        1164 
   mean:        0.37251719964 
  sigma:        0.11368764576 
    sum:        436.59015798 
   good:        1172 
   null:        0 

The mean value is 0.37. The file may also be examined in ChIPS:

unix% chips
-----------------------------------------
Welcome to ChIPS: CXC's Plotting Package
-----------------------------------------
CIAO 4.2 Tuesday, July 6, 2010

chips> make_figure("hrcf05969_000N003_dtf1.fits[cols time,dtf]", "line.color=red symbol.style=none");

The plot is shown Figure 1. The curve indicates a sharp drop from ~1 to ~.4 in DTF around 2.253398e8 s and a rise back to ~1 near 2.253418e8 s, due to slewing on and off the target, a very bright x-ray source subject to telemetry saturation.

[Thumbnail image: The plot of time (s) vs DTF is steady at ~0.4 DTF for the majority of the interval.]

[Version: full-size, PNG]

[Print media version: The plot of time (s) vs DTF is steady at ~0.4 DTF for the majority of the interval.]

Figure 1: Plot of deadtime correction value vs. time

The sharp drop from ~1 to ~.4 in DTF around 2.253398e8 s and a rise back to ~1 near 2.253418e8 s is due to slewing on and off the target.

Quit ChIPS before continuing:

chips> quit

However, the average deadtime correction in the evt2 event list is ~0.97:

unix% dmlist hrcf05969N003_evt2.fits header | egrep 'DTCOR|ONTIME|LIVETIME|EXPOSURE'
0091 ONTIME                    2189.4000990987 [s]       Real8        
0092 DTCOR                    0.97910268724769           Real8        Dead time correction
0093 LIVETIME                  2143.6475204879           Real8        Ontime multiplied by DTCOR
0094 EXPOSURE                  2143.6475204879           Real8        Total exposure time, with all known corr. appl.

This indicates the the dtf1.fits data were not properly time-filtered in calculating the average deadtime correction.

An examination of the GTIs in the event list confirm the times cited above, with a bit more accuracy:

unix% dmlist hrcf05969N003_evt2.fits"[gti]" data,clean
#  START                STOP
 225339799.7114064991 225341989.1115055978


Recompute the deadtime statistics

These GTI information may be used to recompute the deadtime statistics using the tool hrc_dtfstats. The 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=hrcf05969_000N003_dtf1.fits
unix% pset hrc_dtfstats outfile=hrcf05969_dtfstats_new.fits
unix% pset hrc_dtfstats gtifile=hrcf05969N003_evt2.fits"[gti]"
unix% hrc_dtfstats
Input file (hrcf05969_000N003_dtf1.fits): 
Output file (hrcf05969_dtfstats_new.fits): 
File containing GTI to filter on (<filename>|NONE) (hrcf05969N003_evt2.fits[gti]): 

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

The new dtfstats file has a value of DTCOR=0.35535, which agrees with the plot in Figure 1:

unix% dmlist hrcf05969_dtfstats_new.fits"[cols DTCOR]" data,clean
#  DTCOR
     0.35535140943668


Update the Event File

Finally, we update the event list header values of LIVETIME and EXPOSURE, obtained by multiplying the ONTIME by the correct value of DTCOR. The file is copied first, to preserve the original, then edited with dmhedit.


2189.40009910*0.35535140943668 = 778.00641103599186717498

unix% dmcopy hrcf05969N003_evt2.fits hrcf05969N003_evt2_new.fits

unix% dmhedit hrcf05969N003_evt2_new.fits filelist="" op=add key=LIVETIME value=778.0064110
unix% dmhedit hrcf05969N003_evt2_new.fits filelist="" op=add key=EXPOSURE value=778.0064110
unix% dmhedit hrcf05969N003_evt2_new.fits filelist="" op=add key=DTCOR value=0.35535140943668

unix% dmlist hrcf05969N003_evt2_new.fits header | egrep 'ONTIME|LIVETIME|EXPOSURE|DTCOR'
0091 ONTIME                    2189.4000990987 [s]       Real8        
0092 DTCOR                    0.35535140943668           Real8        Dead time correction
0093 LIVETIME                   778.0064110              Real8        Ontime multiplied by DTCOR
0094 EXPOSURE                   778.0064110              Real8        Total exposure time, with all known corr. appl.

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




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


        infile = hrcf05969_000N003_dtf1.fits Input file
       outfile = hrcf05969_dtfstats_new.fits Output file
       gtifile = hrcf05969N003_evt2.fits[gti] 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

Return to Threads Page: Top | All | Data Prep

Where are the PDFs?
Last modified: 5 Feb 2010