BAT Timing Test
BAT Cal Memo 2004-04-21
21 Apr 2004
Analysis by C. Markwardt & S. Barthelmy
BAT Timing Test
Summary
The BAT Timing Test is designed to measure the time delay of the BAT
instrument: the time from X-rays entering the BAT to the time stamping
of events and telemetering them to the "ground" station. By cross
correlating the emission of an external X-ray source with the BAT
count rates, we have detected a signal with chance probability of
detection 1/100000, when considered most conservatively. The
instrumental delay is 68 +/- 3 usec. The delay profile is
significantly broadened (FWHM 66 +/- 7 usec), as would be consistent
with the random jitter that would occur when BAT events are time
stamped with 100 usec time quantization. However, it is worth noting
that this test cannot distinguish the possibility of a N sec + 68 usec
delay, where N is any integer, however unlikely that possibility may
be. Such a gross timing error must be detected in flight by comparing
to known X-ray pulsars.
Introduction
The BAT timing test was performed to determine the end-to-end time
delays within the BAT acquisition system. End-to-end refers to the
relative time between X-rays entering the instrument, a BAT-derived
time stamp being assigned to the associated event, and the data being
telemetered to the downlink station.
Knowing the system time delay is scientifically important because the
primary goal of Swift is to detect and characterize gamma ray bursts
(GRBs). Knowledge of the absolute time of arrival of GRBs facilitates
their localization (via the IPN), and aids in cross-correlation with
other observatories. Also, X-ray pulsar timing studies require a
reliable understanding of any instrumental delays. There have been
several well known X-ray and Gamma-ray observatories that have flown
with unknown timing errors, which were only corrected after
considerable difficulty and loss of confidence. This timing test is
designed to detect and or measure instrumental delays before flight.
The BAT can derive its time from either the spacecraft 1PPS signal
(primary or redundant clock), or from an internal clock. BAT event
timestamps have 100 usec resolution.
Test Setup
The successful test was performed on 21 Apr 2004, between about 16:00
UT and 1800 UT. The BAT was integrated onto the Swift spacecraft bus
and in the EMI chamber.
The BAT array was illuminated by the BAT ETU Tagged Source. The tagged
source device consists of an Am241 radioactive source embedded in a
scintillator detector. When a Am241 nucleus decays, it and its
daughter products typically produce an alpha particle and a 60 keV
X-ray. The X-ray escapes the scintillator and a fraction of them
enter the BAT array. The alpha particle is detected in the
scintillator. The ETU tagged source was placed 9 cm above the BAT
mask tiles, and has a strength of 70 nCi.
X-rays are detected by the BAT and processed by the flight software.
The BAT was configured with surveys enabled and triggers disabled.
The 1PPS time source was configured to "PRIMARY EXTERNAL." Three
pairs of gain/offset calibrations were run before the test, and two
during an intermission in the middle of the test.
The tagged source scintillator events were captured by a PC equipped
with a capture card in channel 1. The capture card records all times
in GPS-based UT, as it contains a GPS receiver (the Building 7 GPS
antenna was connected to the card). Also, the spacecraft primary 1PPS
signal was captured in channel 0. Log files were sent to disk (see
Appendix A). Typically each capture contained about 120,000 events
(with typical duration 75 seconds) although there was some variation.
A total of 40 captures were done.
At the end of each PC capture, the test conductor commanded the BAT to
send the preceding 60 seconds of event ring buffer data. Thus, there
were typically 75 seconds of tag source + 1PPS data, overlapping with
60 seconds of BAT event data. There were a total of 41 BAT event
dumps (one dump did not overlap the PC capture).
The data were transmitted to the S/C I&T station, to the Penn State
MOC, and finally downloaded to Goddard Building 2. The PC captures
were sent directly to Building 2.
Analysis - Reduction to GPS Time
The analysis was done in two steps. First, the data from the
spacecraft and the capture PC must be combined into the same time
system (GPS). Second, the two event streams must be cross-correlated
to determine the delay.
The first step involves determining the conversion from spacecraft to
GPS time. This is possible because the capture card measures the 1PPS
epochs in the GPS time system. These epochs were extracted from the
PC capture files, and the expected linear relation between time and
pulse number was found (see Figure 1).
Figure 1. Linear relation between pulse number and time.
This curve was fitted by a second order polynomial (i.e. quadratic) of
the following form:
T_GPS = T_o + r * (T_SC - T_ZP) + r2 * (T_SC - T_ZP)^2
where Fitted Value
T_o is the fitted offset time (in GPS system) ........ 9734495.2
r is the clock rate (GPS s/ SC s) ................. 1 + 9.23e-9
r2 is the clock drift term (GPS s / SC s)^2 .......... 9.2e-15
T_SC is the time expressed in the spacecraft system
T_ZP is an arbitrary "zero pulse" (arbitrarily fixed).. 104256092 (MET)
We should note that since it is not possible to match a specific 1 PPS
pulse to a specific MET value, there will always be an ambiguity of
a multiple of 1 second. Thus the choice of T_ZP is totally
arbitrary, but we chose it to be near the expected MET at the start of
the first capture.
The residuals after the linear fit are shown in Figure 2.
Clearly the residuals are small and the fit is good. The remaining
saw-tooth pattern is due to quantization of the capture file time
format at the 1 usec level. The quadratic term is negligible over
this time baseline.
Figure 2. Residuals after subtracting linear trend to Figure 1.
The BAT event data is primarily consists of background events, plus
events from the on-board Am241 source and the ETU tagged source
outside the array. The spectrum is shown in Figure 3. The strong 60
keV Am 241 peak is evident. Since all of the expected tagged source
events are also expected to be near 60 keV, the data were filtered to
only include energies between 45-70 keV. This should have the
effect of reducing noise in the correlation spectrum. The energy
scale was calibrated using gain/offset file
sw99999999000bcbo0005g0005.dph.
Figure 3. BAT Energy spectrum of all data of the Timing Test. The 60
keV Am 241 line is present (and a probable 26 keV line), as well as
weaker fluorescent lines of lead, and the overall background level.
Detectors excluded because of noise are shown in red.
Noisy detectors were filtered to remove contamination. This was done
at a the total data-set level (searching for high total counts pixels),
and also in individual time segments (searching for flares).
Figure 4. Total tagged source (black) and BAT 45-70 keV rates
(red). Data is only shown during captures or event dumps. The X-axis
is time measured in seconds since GPS time 9734494.
Figure 4 shows the total light curve of both the tag source and the
BAT (selected to remove noisy detectors and only 45-70 keV). The mean
rates for the tagged source and BAT are 1600 ct/s and 190 ct/s
respectively.
Figure 5. Zoom into a portion of Figure 4 at the start of the test.
Figures 5 and 6 show details of Figure 4. First, Figure 5
demonstrates that the two data sets are overlapping. However, it's
clear that the tagged source is behaving strangely. While ~2200 ct/s
were expected, only ~1600 ct/s were detected. In addition, the actual
rate has non-statistical fluctuations in the range 1500-2000 ct/s
which could not be related to the Am241 source. It is possible that
there are still light leaks that are partially saturating the
detector.
Figure 6. Zoom into the BAT-only 45-70 keV light curve at a
time of strange rate behavior.
Figure 6 shows the BAT-only light curve at another time. The rate
drops significantly around sample numbers 2700-2900. I believe this
is because there was a particularly noisy detector around that time,
which increased the dead time. Because of the energy cut, the low
energy noise events aren't seen. Figure 7 shows the total event rate
around that time. What is not clear to me is how a noisy detectors in
block 11 can depress the array total rate so much.
Figure 7. Total light curve (ALL ENERGIES) around the
same time as Figure 6 (which is only 45-70 keV), showing the general
rate increase and noise spikes. Note that the typical rate at other
times was only 1600 ct/s.
Analysis - Cross Correlation
The time delay was estimated using a cross correlation. The method
was to divide the total data set into overlapping segments of 60
seconds. These corresponded to the capture intervals. Light curves
were constructed, which were cross correlated by FFT. Light curves
were mean-subtracted, and times of noisy detectors were zeroed out in
the light curve.
Because the tagged source signal is so weak, I was forced to combine
all 40 data segments into a single average cross correlation spectrum.
The time bin size was 20 usec, which were then re-sampled to 10 usec so
that the correlation spectrum could be over-sampled.
Figure 8. Total cross correlation spectrum for lags within 5 seconds.
The resulting cross correlation spectrum is shown in Figure 8. The
tallest peak is approximately 5.61 sigma (for a single trial).
However, one must take into account the total number of trials in
examining the lag range -5 to +5 s (approx. 500000 trials), which
degrades the significance level to about 1% (~2.6 sigma).
I attempted to rebin the correlation spectrum. This is legitimate,
since the correlation feature may be significantly broadened. What I
found is that the same peak near 2.0 consistently appears, and becomes
relatively stronger, even as the spectrum is further rebinned and the
correlation noise level is reduced (see Table).
Binning | Peak Value | Variance | S/N Ratio | Time Lag (s) |
None | 1.64e-4 | 0.29e-4 | 5.6 | ~2.000 |
30 us | 1.47e-4 | 0.26e-4 | 5.8 | ~2.000 |
50 us | 1.39e-4 | 0.22e-4 | 6.5 | ~2.000 |
100 us | 0.83e-4 | 0.15e-4 | 5.3 | ~2.000 |
Thus, there is strong evidence of a broad feature. The strongest
significance of 6.5 sigma, reduced by the number of trials, is
approximately 10^-5, or 4.5 sigma. Our confidence is further
increased when we consider a priori that the delay should lie near an
integer value (the instrumental delay is expected to be small), which
is exactly what was found. Because of the integer ambiguity, we
cannot say which integer, but it should be one near zero, since
we chose a "zero pulse" which was close to the starting pulse of the
capture.
Examining this peak in detail (Figure 9) shows it to indeed be a peak
centered near +50 usec, which is stronger and broader than any other
peak in the correlation spectrum. Given the integer ambiguity, we
will choose to eliminate the two second offset.
Figure 9. Cross correlation near 2 seconds (X-axis is offset from +2).
There is a strong peak centered at approx. +50 usec. The best fit
gaussian is shown in red.
Dividing the data into two segments, composed of twenty captures each,
one finds two suggestive, although more marginal peaks, consistent
with the centroid of Figure 9 (see Figure 10). Thus, I am reasonably
convinced that we have detected a real correlation peak and that it is
not spurious.
Figure 10. Cross correlation near 2 seconds for the first and second
halves of the full data set. The vertical dashed lines indicate the
location of the peak in Figure 9.
A gaussian function is highly consistent with the peak in the data
(fit chi^2 = 406 for 395 d.o.f.). The best fit parameters are:
centroid delay = 68 +/- 3 usec
sigma = 28 +/- 3 usec (FWHM = 66 +/- 7 usec)
Considering that the BAT time stamps its events with 100 usec
granularity, one expects a ~100 usec wide distribution of delays
between the true X-ray time and the recorded time, and the fitted
profile is consistent with this supposition.
Conclusion
We have detected the cross correlation between an external X-ray
source and the BAT array. This allows us to determine the delay to be
68 +/- 3 usec. This test appears to be a success, despite the strange
behavior of the tagged source count rate.
Appendix A.
The following table contains a list of files and start/stop times.
The times are expressed in seconds since 31.0 Dec 2003 in the GPS time
system, less 9730000. The number of tagged source events (channel 1)
is also listed.
File Name Start / Stop - 9730000 Num. Evt.
timetag115139.dat 4494.5762 4617.6432 200000
timetag115556.dat 4744.5374 4840.6130 150000
timetag115810.dat 4884.6416 4947.9499 100000
timetag120025.dat 5021.2649 5089.9475 110000
timetag120305.dat 5188.3987 5263.4041 120000
timetag120511.dat 5349.1130 5423.1235 120000
timetag120854.dat 5519.4915 5593.5649 120000
timetag121109.dat 5662.7074 5737.6107 120000
timetag121509.dat 5902.1397 5976.3722 120000
timetag121802.dat 6202.9159 6275.7782 120000
timetag122206.dat 6323.5107 6398.2866 120000
timetag122408.dat 6533.5367 6608.5583 120000
timetag122737.dat 6683.6136 6757.6149 120000
timetag123056.dat 6862.0370 6936.3530 120000
timetag123315.dat 6997.5643 7071.5378 120000
timetag123529.dat 7148.9017 7223.5015 120000
timetag123808.dat 7282.6587 7354.9335 120000
timetag123951.dat 7402.5681 7478.2574 120001
timetag124157.dat 7522.2647 7597.4752 119999
timetag124426.dat 7648.4554 7722.0255 120000
timetag124612.dat 7807.6333 7880.0102 120000
timetag124838.dat 7927.4958 8000.8000 120000
timetag125127.dat 8077.9057 8152.2396 120000
timetag125309.dat 8184.1247 8259.4807 120000
timetag130834.dat 9098.4443 9171.0346 120000
timetag131013.dat 9207.2393 9282.0084 120000
timetag131209.dat 9338.2792 9412.3902 120000
timetag131412.dat 9443.4384 9516.1918 120000
timetag131551.dat 9563.5691 9637.9937 120000
timetag131753.dat 9714.0885 9787.2876 120000
timetag132025.dat 9834.0767 9907.2745 120000
timetag132220.dat 9938.5772 10012.668 120000
timetag132407.dat 10042.388 10117.483 120000
timetag132551.dat 10148.934 10222.111 120000
timetag132735.dat 10253.308 10326.904 120000
timetag132923.dat 10358.442 10433.846 120000
timetag133111.dat 10478.851 10554.235 120000
timetag133311.dat 10583.619 10660.094 120000
timetag133455.dat 10702.973 10778.918 120000
timetag133656.dat 10823.423 10895.818 120000
Appendix B.
Same as Appendix A, for the BAT event data dumps. (Times in GPS time
frame).
File Name Start / Stop - 9730000 Num. Evt.
sw00000001000bevshto_001uf.evt 4557.2311 4617.4683 11324
sw00000001000bevshto_002uf.evt 4767.2311 4827.4566 11341
sw00000001000bevshto_003uf.evt 4887.2340 4947.4427 11618
sw00000001000bevshto_004uf.evt 5022.2304 5082.4025 11507
sw00000001000bevshto_005uf.evt 5202.2300 5262.4731 11452
sw00000001000bevshto_006uf.evt 5352.2346 5412.4243 11499
sw00000001000bevshto_007uf.evt 5532.2356 5592.3252 11479
sw00000001000bevshto_008uf.evt 5667.2322 5727.4096 11658
sw00000001000bevshto_009uf.evt 5907.2318 5967.3628 11813
sw00000001000bevshto_010uf.evt 6207.2307 6267.4062 11632
sw00000001000bevshto_011uf.evt 6327.2345 6387.3371 11444
sw00000001000bevshto_012uf.evt 6537.2346 6597.2630 11655
sw00000001000bevshto_013uf.evt 6702.2373 6762.4459 11519
sw00000001000bevshto_014uf.evt 6792.2329 6852.3750 11603
sw00000001000bevshto_015uf.evt 6867.2325 6927.3802 11499
sw00000001000bevshto_016uf.evt 7002.2347 7062.2914 11457
sw00000001000bevshto_017uf.evt 7152.2525 7212.2789 9204
sw00000001000bevshto_018uf.evt 7287.2321 7347.3530 6685
sw00000001000bevshto_019uf.evt 7407.2333 7467.3978 10611
sw00000001000bevshto_020uf.evt 7527.2366 7587.3349 11073
sw00000001000bevshto_021uf.evt 7662.2303 7722.3259 11577
sw00000001000bevshto_022uf.evt 7812.2520 7872.3449 11643
sw00000001000bevshto_023uf.evt 7932.2451 7992.4114 11591
sw00000001000bevshto_024uf.evt 8082.2332 8142.2826 11611
sw00000001000bevshto_025uf.evt 8187.2332 8247.3307 11443
sw00000001000bevshto_026uf.evt 9102.2338 9162.4111 11713
sw00000001000bevshto_027uf.evt 9222.2351 9282.2791 11654
sw00000001000bevshto_028uf.evt 9342.2345 9402.4709 11622
sw00000001000bevshto_029uf.evt 9447.2317 9507.4086 11373
sw00000001000bevshto_030uf.evt 9567.2305 9627.2468 11705
sw00000001000bevshto_031uf.evt 9717.2382 9777.2859 11389
sw00000001000bevshto_032uf.evt 9837.2372 9897.3377 11480
sw00000001000bevshto_033uf.evt 9942.2309 10002.483 11770
sw00000001000bevshto_034uf.evt 10047.237 10107.438 11740
sw00000001000bevshto_035uf.evt 10152.233 10212.403 11605
sw00000001000bevshto_036uf.evt 10257.233 10317.316 11614
sw00000001000bevshto_037uf.evt 10362.238 10422.445 11601
sw00000001000bevshto_038uf.evt 10482.231 10542.404 11461
sw00000001000bevshto_039uf.evt 10587.234 10647.458 11489
sw00000001000bevshto_040uf.evt 10707.240 10767.458 11566
sw00000001000bevshto_041uf.evt 10827.245 10887.407 11669