Introduction
USB driver
bpi_device
Overview
Module Constants
Controls
Statistics
Results
Histogram
List Mode
Oscilloscope Trace
Summation Weights
Time Slices
Two-bank List Mode
API
Overview
Data Server
Overview |
eMorpho Data Structures
Summary
The file emorpho_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 are transient. They are 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 eMorpho.
Data structures
The emorpho_data.py module defines all data classes used for communication. We show the ones pertaining to the standard FPGA firmware and those for special firmware in two different tables.
The common structure of all data classes is explained in the table below.
eMorpho 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. |
adc_sr | The ADC sampling rate is stored as it is needed to compute some of the evaluated data. |
cmd_addr | An ID that tells the eMorpho 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' or 'I' for unsigned int16 and unsigned int32. |
num_items | Number of data items to transmit between host and eMorpho. |
num_bytes | Number of bytes to transmit between host and eMorpho. |
eMorpho data class attributes.
eMorpho 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 some field values into physical quantities in SI units. |
user_2_fields | Convert user values from physical quantities in SI units into numerical fields |
eMorpho data class attributes.
eMorpho Data Classes |
Name | Description |
fpga_ctrl | FPGA control registers; These control all aspects of the real time data acquisition including triggers, count rate measurement, histograms, list mode, trace acquisition, pulse shape discrimination, etc. |
fpga_statistics | Statistics data (read only) from which count rates etc are computed. |
fpga_results | Status and telemetry data. |
fpga_histogram | Histogram data; at least 4Kx32 bins are available |
fpga_list_mode | List mode data for at least 341 events |
fpga_trace | Oscilloscope trace data; at least 1024 samples are available. |
fpga_weights | Weights can be used during the summation of ADC data to improve energy resolution in some scintillators. |
Table of standard data structures.
eMorpho Data Classes – Non-standard |
Name | Description |
fpga_time_slices | Used for streaming 105ms-long time slices of count-rate and histogram data. |
fpga_lm_2b | Two-bank list mode data with 2730 events per bank for loss-less list mode data acquisition. |
fpga_weights | Weights can be used during the summation of ADC data to improve energy resolution in some scintillators. |
Table of non-standard data structures. These will only work when the correct firmware is installed on the eMorpho. Not all options can be available at the same time.
|