daplis_rtp.functions.unpack module

Module with scripts for unpacking data from LinoSPAD2.

This file can also be imported as a module and contains the following functions:

  • unpack_bin - function for unpacking data from LinoSPAD2. Utilizes

the numpy library to speed up the process. Works with firmware versions 2208 and 2212.

daplis_rtp.functions.unpack.unpack_bin(file, board_number: str, fw_ver: str, timestamps: int = 512)[source]

Unpack binary data from LinoSPAD2.

Unpacks binary-encoded .dat files with data from LinoSPAD2 into a matrix with dimensions [256, # of timestamps*cycles] for firwmare 2208, or [64, # of timestamps*cycles + cycles, 2] for firmware version 2212 where the third axis contains the timestamp and a pixel coordinate in the particular TDC.

Parameters:
  • file (str) – Name of the ‘.dat’ data file to unpack.

  • board_number (str) – LinoSPAD2 daugtherboard number.

  • fw_ver (str) – LinoSPAD2 firmware version.

  • timestamps (int, optional) – Number of timetstamps per pixel (firmware 2208) or per TDC firmware 2212 and per acquisition cycle, by default 512.

Returns:

data_matrix – Matrix of timestamps in each pixel (firmware 2208) or in each TDC with pixel number in that TDC (firmware 2212).

Return type:

ndarray

Raises:

FileNotFoundError – Raised if no calibration data were found.