Introduction
USB driver
Counter Device
Overview
Module Constants
ARM Data structures
Version
Status
Controls
Calibration
Two-channel Logger
Time histogram
API
Overview
|
Counter Data Structures
Summary
The file counter_data.py contains definitions for data classes. Each data class describes one set of control data or acquired data as shown in the table below. All classes have the same structure: They contain data and a set of standardized functions which the API level uses when executing commands. The data objects transient. They created, used and then discarded during the execution of a command. The data object functions mostly serve to translate between human-readable data in Si units and the bit-fields and register contents on board the Counter.
Data structures
The counter_data.py module defines all data classes used for communication. The common structure of all data classes is explained in the table below.
Counter Data Class Structure |
Attribute | Description |
registers | On board data are stored in registers as arrays of data. 'registers' is a copy of that array. |
fields | 'fields' is a dictionary where the various components of the registers and any bit fields are stored by name. |
user | 'user' is a dictionary where data are stored as physical quantities in SI units. Since this is not meaningful for all data, 'user' may only capture a subset of all data. On the other hand, when reading data, 'user' may present an enhanced set of data containing evaluated data; eg when reading count rates. |
wr_type | Identifies the device to write to; here always ARM. |
rd_type | Identifies the device to read from; here always ARM. |
cmd_addr | An ID that tells the Counter device which data section is being addressed; cf the Data Classes tables below. |
data_type | Tells the device driver what kind of data are being transmitted; they can be 'H', 'I' and 'f' for unsigned int16, unsigned int32 and float32 data. |
num_items | Number of data items to transmit between host and Counter. |
num_bytes | Number of bytes to transmit between host and Counter. |
Counter data class attributes.
Counter Data Class Functions |
Function | Description |
registers_2_fields | Convert FPGA control register values into a control register dictionary which has names for the bit fields. |
fields_2_registess | Compute the values of the control registers from the fields dictionary. |
fields_2_user | Convert a few field values into physical quantities in SI units. |
user_2_fields | Convert user values from physical quantities in SI units into numerical fields |
add_to_cmd_out_list(mca) | If a command requires auxiliary data to be sent with it (up to 14 unsigned int16) those could be copied from a designated member of an mca object. The standard Counter software does not use this feature. |
Counter data class functions.
Counter Data Classes |
Name | Description |
arm_version | Version and serial number information for the ARM software. |
arm_status | Status information (unsigned int32) from the slow-control system, including temperatures, operating voltage, etc. |
arm_ctrl | Parameters (float32) to set the SiPM operating voltage, apply gain stabilization and more. |
arm_cal | Calibration data (float32) used by the gain stabilization; eg a voltage vs temperature lookup table. |
arm_logger | Two selectable 1K data arrays, acquired simultaneously; eg operating voltage and count rate or net counts above background and alarm probability. Each time bin can be as short as 50ms or as long 12.75s. |
Table of Counter data structures.
|