HDF5 Logger Interface

class larpix.logger.h5_logger.HDF5Logger(filename=None, buffer_length=10000, directory='', version='2.4', enabled=False)[source]

The HDF5Logger is a logger class for logging packets to the LArPix+HDF5 format.

The file format is implemented in larpix.format.hdf5format, which also contains a function to convert back from LArPix+HDF5 to LArPix packets.

Variables:

data_desc_map – specifies the mapping between objects sent to the logger and the specific logger buffer to store them in. As of LArPix+HDF5 version 1.0 and larpix-control version 2.3.0 there is only one buffer called 'packets' which stores all of the data to send to LArPix+HDF5.

Parameters:
  • filename – filename to store data (appended to directory) (optional, default: None)
  • buffer_length – how many data messages to hang on to before flushing buffer to the file (optional, default: 10000)
  • directory – the directory to save the data in (optional, default: ‘’)
  • version – the format version of LArPix+HDF5 to use (optional, default: larpix.format.hdf5format.latest_version)
record_configs(chips)[source]

Write the specified chip configurations to the log file

Note

this method will also flush any data in the buffer to the log file

Parameters:chips – list of chips to record timestamps
record(data, direction=0)[source]

Send the specified data to log file

Note

buffer is flushed after all data is placed in buffer, this means that the buffer size will exceed the set value temporarily

Parameters:
  • data – list of data to be written to log
  • directionLogger.WRITE if packets were sent to ASICs, Logger.READ if packets were received from ASICs. (default: Logger.WRITE)
enable()[source]

Enable the logger and set up output file.

If the file already exists then data will be appended to the end of arrays.

Parameters:enableTrue if you want to enable the logger after initializing (Optional, default=``True``)
flush(block=True)[source]

Flushes any held data from memory to the destination