## FLASH1 PhotDiag stream

## FLASH2 PhotDiag stream

## Data Formats

The DOOCS and DAQ data formats are documented in the DOOCS Programmers manual. This paragraph extends the documentation with some details and compares data types as used by DOOCS and the DAQ.

### GSPECTRUM

GSPECTRUM is a grouped spectrum type. Grouped means, the spectrums time axis can be discontinuous, i.e. allow to drop uninteresting sections of a otherwise very long spectrum. The following table lists end user relevant parameters of the GSPECTRUM types.

DOOCS Property^{*)} | DOOCS field | daq_read (Matlab) | pydoocs, pydaq | IMAGE field | Comment |
---|---|---|---|---|---|

SAMPLE_FREQ : float DAQ_SAMPLE_INCR : float | s_inc : float | inc | data[1,0]-data[0,0] : np.float32 | fspare3 | s_inc/µs = inc/µs = fspare3/µs = SAMPLE_FREQ |

DAQ_SAMPLE_START : float | s_start : float | start | data[0,0] : np.float32 | fspare2 | s_start, start, fspare2: t DAQ_SAMPLE_START is the integer number of the first raw sample, counting from zero |

DAQ_GROUPS_NUM : int | groups : int | groups | -- | ispare2 | number of groups |

DAQ_GROUPS_INC : float | group_inc : float | group_inc | -- | fspare4 | group_inc/µs = DAQ_GROUPS_INC * inc DAQ_GROUPS_INC is the number of samples skipped between sample groups |

DAQ_GROUP_LENGTH : float | group_size : int | ndata | -- | ispare3 | number of samples per group |

-- | -- | -- | data.shape[1] | aoi_width | total number of samples in spectrum aoi_width = groups * ndata |

DAQ_SAMPLE_START | -- | -- | -- | -- | index of first sample to be stored in the DAQ, the value is reflected by s_start |

^{*)} Note: For the given interpretation of the DOOCS properties to hold, the property "DAQ_PARAM_MODE" must be 0.

So, a GSPECTRUM is composed of a number of sections of a complete SPECTRUM. The sections are aequidistant (group_inc/inc, the number of skipped samples between groups) and of equal length each (group_size or ndata).

While pydoocs and pydaq for real GSPECTRUM types compute a spectrum's time axis, the spectra stored as one-line images or retrieved via the Matlab Mex functions require to reconstruct the time axis from the fields specified above.

Note, the value of property CH00.SAMPLES must be greater than DAQ_SAMPLE_START + groups*(group_size*DAQ_SAMPLE_INCR + group_inc/inc)

Given

t_{0,0} | time of first sample of the first group (=start) |

dt | time between samples (=inc) |

t_{0,1} | time of first sample of the second group |

t_{i,j} | time of sample i of the group j (counting from zero) |

n | number of samples per group (=ndata) |

m | number of samples (at distance dt) skipped between groups (=group_inc/inc) |

N | number of groups (=groups) |

the times are computed as

t_{0,1} = t_{0,0} + (n + m)*dt

t_{i,j} = t_{0,0} + i*dt + j*(n + m)*dt

with i = 0..n-1 and j = 0..N-1. Thus the last sample's time is t_{n-1,N-1} = t_{0,0} + (n - 1)*dt + (N - 1)*(n + m)*dt .