##### Appendix
# TTTR Record Format

[Related Topics] |

### Basic record format

This page describes the format of the TTTR data saved in the section of raw data files.

Due to performance reasons the TTTR data are saved exactly as recieved from TCSPC device, hence the format of the TTTR records depends on the kind of TCSPC device and the type of measurement. The record format used in a particular file is denoted in the mandatory tag TTResultFormat_TTTRRecType.

Even though the record formats differ, the formal algorithms for the calculations on them don't: To get the global arrival time of a photon or a marker in seconds, count the overflows until the current position and multiply with the overflow period, then add the timetag (for T2) or nsync (for T3) and multiply with the MeasDesc_GlobalResolution.

The arrival time since the last sync event in T3 measurements is denoted in dtime. To get the time in seconds multiply dtime with MeasDesc_Resolution.

### Images

(all Formats, except LIN Camera)
To reconstruct the image one needs marker defined as a line start, line stop and frame trigger. The corresponding header entries are ImgHdr_LineStart, ImgHdr_LineStop and ImgHdr_Frame. The line start and line stop markers mark the real start and stop of image line, a frame marker define a change of the frame.

- The default setting is a linear movement of the scanner between line start and line stop marker, the length of one pixel in this case is given by the length of line (arrival time of line stop marker - arrival time of line start marker) divided by the number of pixels in the line.
- Some scanner have a sinusoidal movement, such files have the header entry ImgHdr_SinCorrection which defines the percentage of a sinus curve is covered by the line and must be used to calculate the length of every pixel.

The number of pixels in a line is defined by ImgHdr_PixX. The number of lines is given by ImgHdr_PixY. Attention, in some images one will find a different number of lines than defined by PixY (less or more, even different in every frame), so do not trust this value.

Notice 1: The markers are bit coded in the TTTR records (see below), multiple markers can appear at once; Especially the frame marker often overlay with a line start or line stop marker.
Notice 2: The marker positions in MicroTime200 images are different than before in the SymPhoTime 32. When a MicroTime200 image is converted for the new software the markers are relocated to match the real line start, line stop position.

(LIN Camera)
The LIN Camera directly supplies the X and Y position in the Image of every Photon.

## TCSPC specific record formats

Currently the following formats are defined:

- PicoHarp       T3 = $00010303
- PicoHarp       T2 = $00010203
- HydraHarp V1.x T3 = $00010304
- HydraHarp V1.x T2 = $00010204
- HydraHarp V2.x T3 = $01010304
- HydraHarp V2.x T2 = $01010204
- TimeHarp 260N  T2 = $00010205
- TimeHarp 260N  T3 = $00010305
- TimeHarp 260P  T2 = $00010206
- TimeHarp 260P  T3 = $00010306
- MultiHarpN  T2 = $00010207
- MultiHarpN  T3 = $00010307
- LIN Camera    T3 = $00010300

### PicoHarp T2 Format

RecType: | $00010203 |  | Overflow period: | 210698240 |  | Record Size: | 32 Bit = 4 Byte

The bit allocation in the record is, starting from the MSB:
`channel: 4
timetag: 28
` The channel code 15 (all bits ones) marks a special record.
Special records can be overflows or external markers. To differentiate this, the lower 4 bits of `timetag` must be checked.

- If they are all zero, the record marks an overflow.
- If they are >=1 the individual bits are external markers.

### PicoHarp T3 Format

RecType: | $00010303 |  | Overflow period: | 65536 |  | Record Size: | 32 Bit = 4 Byte

The bit allocation in the record is, starting from the MSB:
`channel: 4
dtime: 12
nsync: 16
` The `channel` code 15 (all bits ones) marks a special record.
Special records can be overflows or external markers. To differentiate this, `dtime` must be checked.

- If it is zero, the record marks an overflow.
- If it is >=1 the individual bits are external markers.

### HydraHarp, MultiHarp and TimeHarp260 T2 Format

RecType: | $00010204 |  | Overflow period: | 33552000 |  | Record Size: | 32 Bit = 4 Byte
RecTypes: | $01010204, $01010205, $01010206, $01010207 |  | Overflow period: | 33554432 |  | Record Size: | 32 Bit = 4 Byte

The bit allocation in the record is, starting from the MSB:
`special: 1
channel: 6
timetag: 25
` If the `special` bit is clear, it's a regular event record.
If the `special` bit is set, the following interpretation of the `channel` code is given:

- code 63 (all bits ones) identifies a timetag overflow, increment the overflow timetag accumulator. For HydraHarp V1 ($00010204) it always means one overflow. For all other types the number of overflows can be read from `timetag` value.
- code 0 (all bits zeroes) identifies a sync event,
- codes from 1 to 15 identify markers, the individual bits are external markers.

### HydraHarp, MultiHarp and TimeHarp260 T3 Format

RecType: | $00010304, $01010304, $00010305, $00010306, $00010307 |  | Overflow period: | 1024 |  | Record Size: | 32 Bit = 4 Byte

The bit allocation in the record is, starting from the MSB:
`special: 1
channel: 6
dtime: 15
nsync: 10
` If the `special` bit is clear, it's a regular event record.
If the `special` bit is set, the following interpretation of the channel code is given:

- code 63 (all bits ones) identifies a sync count overflow, increment the sync count overflow accumulator. For HydraHarp V1 ($00010304) it means always one overflow. For all other types the number of overflows can be read from `nsync` value.
- codes from 1 to 15 identify markers, the individual bits are external markers.

### LIN Camera Format

RecType: | $00010300 |  | Overflow period: | N/A |  | Record Size: | 64 Bit = 8 Byte

This is a file imported from a '.photons' File created by Recording software of LIN camera. The bit allocation in the record is, starting from the MSB:
`XPosition: 16
YPosition: 16
DTime: 16
MSTime: 16
` This records contains the absolute pixel positions (0 to PixX - 1; 0 to PixY - 1) as read from the instrument. MSTime equals the Number of Milliseconds since the last Record. The GlobalResolution for such files is always 1 ms, therefore one can treat this value as a timetag which accumulates with every count.

Related Topics: |

[Tag Dictionary]
[Support]