Skip to the navigation links
Last modified: 7 October 2024

URL: https://cxc.cfa.harvard.edu/ciao/merging/timing.html

Merging Central

Timing Analysis Across Multiple Observations



Using merged data sets.

Timing Analysis with Combined Observations

As in the spectral case, in general, merged observations should not be used for timing analysis. Different pointings, roll angles, bad pixels, and other instrumental effects can lead to incorrect count rates. However, in conditions similar to those described in Caveat: Extracting Spectra from Merged Datasets, "reasonable" results can be obtained when extracting a light curve.

In the following example(s), we use three pointings of the lenticular "Cartwheel" Galaxy (ObsIDs 2019, 9531, 9807) over a ~7 year period, of the 'ULX N10' point source (\(\alpha = \mathrm{00^{h}37^{m}39.38^{s}}, \delta = \mathrm{-33^{\circ} 43' 23.08''}\); A&A 426 787, MNRAS 406 1116), which corresponds to the Chandra Source Catalog master source 2CXO J003739.3-334323, which we make use of for our extraction source and background regions.

unix% cat ULX-N10.wcs.reg
ellipse(0:37:39.3936,-33:43:23.517,0.02693',0.02205',100.05401)

unix% cat ULX-N10.bkg.wcs.reg
ellipse(0:37:39.3929,-33:43:23.522,0.13467',0.11023',100.05404)
-ellipse(0:37:39.3929,-33:43:23.522,0.02963',0.02425',100.05404)

Approach I:

Time order matters when combining separate light curve files.

For example:

unix% set tbin=2592.8
unix% set lc_bin="bin time=::${tbin}"
unix% set src="sky=region(cartwheel.wcs.reg)"
unix% set bkg="sky=region(cartwheel.bkg.wcs.reg)"

unix% dmextract infile="cartwheel_2019_reproj_evt.fits[${src}][${lc_bin}]" \
? outfile=2019_${tbin}s.lc bkg="cartwheel_2019_reproj_evt.fits[${bkg}]" opt=ltc1 clobber+

unix% dmextract infile="cartwheel_9531_reproj_evt.fits[${src}][${lc_bin}]" \
? outfile=9531_${tbin}s.lc bkg="cartwheel_9531_reproj_evt.fits[${bkg}]" opt=ltc1 clobber+

unix% dmextract infile="cartwheel_9807_reproj_evt.fits[${src}][${lc_bin}]" \
? outfile=9807_${tbin}s.lc bkg="cartwheel_9807_reproj_evt.fits[${bkg}]" opt=ltc1 clobber+



unix% dmmerge infile=2019_${tbin}s.lc,9531_${tbin}s.lc,9807_${tbin}s.lc \
? outfile=lightcurve_merged_${tbin}s.lc clobber+

unix% dmmerge infile=9807_${tbin}s.lc,9531_${tbin}s.lc,2019_${tbin}s.lc \
? outfile=lightcurve_merged-timereverse_${tbin}s.lc clobber+

unix% dmmerge infile=9531_${tbin}s.lc,2019_${tbin}s.lc,9807_${tbin}s.lc \
? outfile=lightcurve_merged-timedisordered_${tbin}s.lc clobber+

For plotting purposes, if the light curve is being plotted as unconnected scatter plot, the order doesn't matter. However, for use in downstream processing, it will matter for many tools, if the software does not perform sorting internally, there can be a runtime failure.

Compare the Effect of Merging Order on Light Curve Files

[Thumbnail image: compare ordering on merging light curve files]

[Version: full-size]

[Print media version: compare ordering on merging light curve files]

Compare the Effect of Merging Order on Light Curve Files

The merging order of extracted light curve files affects the resultant combined light curve. The left hand plots are the light curves, as count rate as a function of time and the right hand side plots are the time stamped, extracted light curve row number (array index number). The upper plots are from combining the individual light curves in time order while the lower plots are combining the light curve files in time-reverse. The middle plots are from combining the light curves unordered with time. The color bar represents the FITS light curve table row of the plotted data set.

Approach II (not recommended):

Extracting a light curve from a merged event file, which was combined without concern for time order, will generate a properly ordered light curve.

For example:

unix% set filter="[cols time,expno,ccd_id,node_id,chip,tdet,det,sky, \
? pha,pha_ro,energy,pi,fltgrade,grade,status][subspace -expno,-phas]"

unix% set tbin=2592.8
unix% set lc_bin="bin time=::${tbin}"
unix% set src="sky=region(cartwheel.wcs.reg)"
unix% set bkg="sky=region(cartwheel.bkg.wcs.reg)"



unix% dmmerge infile="cartwheel_2019_reproj_evt.fits${filter}, \
? cartwheel_9531_reproj_evt.fits${filter}, \
? cartwheel_9807_reproj_evt.fits${filter}" \
? outfile=cartwheel_merged_evt.fits clobber+

unix% dmextract infile="cartwheel_merged_evt.fits[${src}][${lc_bin}]" \
? outfile=merged_${tbin}s.lc bkg="cartwheel_merged_evt.fits[${bkg}]" opt=ltc1 clobber+



unix% dmmerge infile="cartwheel_9807_reproj_evt.fits${filter}, \
? cartwheel_9531_reproj_evt.fits${filter}, \
? cartwheel_2019_reproj_evt.fits${filter}" \
? outfile=cartwheel_timereverse_merged_evt.fits clobber+

unix% dmextract infile="cartwheel_timereverse_merged_evt.fits[${src}][${lc_bin}]" \
? outfile=merged_timereverse_${tbin}s.lc bkg="cartwheel_timereverse_merged_evt.fits[${bkg}]" opt=ltc1 clobber+



unix% dmmerge infile="cartwheel_9531_reproj_evt.fits${filter}, \
? cartwheel_2019_reproj_evt.fits${filter}, \
? cartwheel_9807_reproj_evt.fits${filter}" \
? outfile=cartwheel_time-disordered_merged_evt.fits clobber+

unix% dmextract infile="cartwheel_time-disordered_merged_evt.fits[${src}][${lc_bin}]" \
? outfile=merged_time-disordered_${tbin}s.lc bkg="cartwheel_time-disordered_merged_evt.fits[${bkg}]" opt=ltc1 clobber+

The merging order of events files does not affect the resulting extracted light curve since dmextract will sort the events by time when extracted. However the large time gaps in the data will be included in the light curves since the data set is binned with time.

Compare the Effect of Merging Order on Events Files and Extracted Light Curve

[Thumbnail image: compare light curves extracted from merged event files]

[Version: full-size]

[Print media version: compare light curves extracted from merged event files]

Compare the Effect of Merging Order on Events Files and Extracted Light Curve

The merging order of events files does not affect the resulting extracted light curve. The left hand plots are the light curves, as count rate as a function of time and the right hand side plots are the time stamped, extracted light curve row number (array index number). The upper plots are extracted from events files merged in time order while the lower plots are extracted from events files merged in time-reverse. The middle plots are from light curves extracted events files unordered in time. Take note of the zero-valued time bins that are included for the time gaps between observations. The color bar represents the FITS light curve table row of the plotted data set.

[NOTE]
Note

If there are large time gaps, then extracting the lightcurve from a merged event file will result in a significantly larger output file since it will need to write time bins that contain zero counts.

  unix% ls -alh merged*2592.8s*.lc
  -rw-r--r-- 1 user group  14M Feb 17  2023 merged_2592.8s.lc
  -rw-r--r-- 1 user group  14M Feb 17  2023 merged_time-disordered_2592.8s.lc
  -rw-r--r-- 1 user group  14M Feb 26 14:11 merged_timereverse_2592.8s.lc

  unix% ls -alh lightcurve*2592.8s*.lc
  -rw-r--r-- 1 user group 155K Feb 26 16:41 lightcurve_merged_2592.8s.lc
  -rw-r--r-- 1 user group 155K Feb 26 16:41 lightcurve_merged-timedisordered_2592.8s.lc
  -rw-r--r-- 1 user group 155K Feb 26 16:41 lightcurve_merged-timereverse_2592.8s.lc

The general suggestion is to go along with Approach I and handle time ordering when merging the light curve files together. The minor hassle in doing so early on will avoid possible downstream headaches whilst also minimizing resultant file sizes.

Other Considerations

General Caveats