diff --git a/devices/statistics_writer/README.md b/devices/statistics_writer/README.md index 82927efc877b90975c106e27f0ae7485983f6e42..ea722c6cf552443364b196264034d768690955be 100644 --- a/devices/statistics_writer/README.md +++ b/devices/statistics_writer/README.md @@ -22,7 +22,7 @@ This script can be called with the following arguments: ##HFD5 structure -Statistics packets are collected with the StatisticsCollector in to a matrix. Once the matrix is done or a newer +Statistics packets are collected by the StatisticsCollector in to a matrix. Once the matrix is done or a newer timestamp arrives this matrix along with the header of first packet header, nof_payload_errors and nof_valid_payloads. The file will be named after the mode it is in and the timestamp of the statistics packets. For example: `SST_1970-01-01-00-00-00.h5`. @@ -45,13 +45,14 @@ File ###explorer There is an hdf5 explorer that will walk through specified hdf5 files. -Its called `hdf5_explorer.py` and can be called with a filename argument -ex: `python3 hdf5_explorer.py --filename data/SST_1970-01-01-00-00-00.h5` This allows for easy manual checking +Its called `hdf5_explorer.py` and can be called with a `--file` argument +ex: `python3 hdf5_explorer.py --file data/SST_1970-01-01-00-00-00.h5` This allows for easy manual checking of the structure and content of hdf5 files. useful for testing and debugging. - +Can also be used as example of how to read the HDF5 statistics data files. +Provides a number of example functions inside that go through the file in various ways. ###test server There is a test server that will continuously send out the same statistics packet. -Its called `test_server.py`. Takes `host` and `port` as optional input arguments. -Defaults to address `'127.0.0.1'` and port `65433` +Its called `test_server.py`. Takes `--host`, `--port` and `--file` as optional input arguments. +Defaults to address `'127.0.0.1'`, port `65433` and file `devices_test_SDP_SST_statistics_packets.bin` diff --git a/devices/statistics_writer/test/hdf5_explorer.py b/devices/statistics_writer/test/hdf5_explorer.py index b6a65e9bbf07f0fd61b195aa4636ad93c3a63336..29cc88049086f5bea22c441d1ca12f91769c7135 100644 --- a/devices/statistics_writer/test/hdf5_explorer.py +++ b/devices/statistics_writer/test/hdf5_explorer.py @@ -4,7 +4,7 @@ import numpy import argparse parser = argparse.ArgumentParser(description='Select a file to explore') -parser.add_argument('--filename', type=str, help='the name and path of the file') +parser.add_argument('--file', type=str, help='the name and path of the file') import logging logging.basicConfig(level=logging.INFO) @@ -112,7 +112,7 @@ class explorer: # create a data dumper that creates a new file every 10s (for testing) if __name__ == "__main__": args = parser.parse_args() - Explorer = explorer(args.filename) + Explorer = explorer(args.file) """ Print the entire files content