|
| 1 | +- Feature: Acquisition interface classes |
| 2 | +- Status: Open |
| 3 | +- Submit Date: 2025-02-12 |
| 4 | +- Authors: Georg Brandl < [email protected]> |
| 5 | +- Type: Modules |
| 6 | +- PR: |
| 7 | + |
| 8 | +Summary |
| 9 | +======= |
| 10 | + |
| 11 | +This RFC (carried over from `issue 76 |
| 12 | +<https://github.com/SampleEnvironment/SECoP/blob/master/protocol/issues/076%20Interface%20for%20Measurable%20hardware.rst>`_) |
| 13 | +proposes the addition of two new interface classes, specific to modules that |
| 14 | +support longer-running data acquisition. |
| 15 | + |
| 16 | +Goal |
| 17 | +==== |
| 18 | + |
| 19 | +In order to support a wider spectrum of hardware, SECoP should support |
| 20 | +integrating devices used for data acquisition, and define appropriate |
| 21 | +interfaces. This hardware can range in complexity from devices that simply |
| 22 | +provide values after some acquisition time, to multi-channel detector setups |
| 23 | +common in large scale facilities. |
| 24 | + |
| 25 | + |
| 26 | +Technical explanation |
| 27 | +===================== |
| 28 | + |
| 29 | +It is proposed to add three new interface classes. |
| 30 | + |
| 31 | +All modules belonging to an acquisition MUST have a ``group`` property, which is |
| 32 | +set to the same identifier. |
| 33 | + |
| 34 | + |
| 35 | +Definitions |
| 36 | +~~~~~~~~~~~ |
| 37 | + |
| 38 | +- "acquisition": a complete data acquisition system consisting of one |
| 39 | + AcquisitionController module and optionally some AcquisitionChannel modules. |
| 40 | + |
| 41 | +- "acquisition cycle": a single cycle of data acquisition, started by the |
| 42 | + controller's ``go`` command. |
| 43 | + |
| 44 | +- "channel": a part of the data acquisition system representing a measured |
| 45 | + quantity. An acquisition can acquire data for one or more channels at the |
| 46 | + same time. |
| 47 | + |
| 48 | +- "matrix type channel": a channel whose measured data is not a single |
| 49 | + value/handful of values that is manageable as the ``value`` parameter. |
| 50 | + |
| 51 | + |
| 52 | +``AcquisitionController`` (no base interface) |
| 53 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 54 | + |
| 55 | +Accessibles: |
| 56 | + |
| 57 | +``status`` |
| 58 | + Mandatory: Standard SECoP status. |
| 59 | + The module is in ``BUSY`` state while the acquisition is acquiring. |
| 60 | + The module is in ``PREPARED`` state after ``prepare`` is called or data |
| 61 | + acquisition is paused by ``hold``. |
| 62 | + |
| 63 | +command ``prepare`` |
| 64 | + Optional command: prepares a data acquisition so that triggering with ``go`` |
| 65 | + is immediate. No-op if already prepared. Cannot be called when busy. |
| 66 | + |
| 67 | +command ``go`` |
| 68 | + Mandatory command: starts a data acquisition. No-op if busy. |
| 69 | + Data acquisition runs until one of the channels' active presets is hit or |
| 70 | + ``stop`` is called explicitly. Runs the ``prepare`` sequence first if |
| 71 | + module is not already prepared. |
| 72 | + |
| 73 | +command ``hold`` |
| 74 | + Optional command: pauses a data acquisition. No-op if not busy. |
| 75 | + Subsequent ``go`` continues the acquisition without clearing currently |
| 76 | + acquired data. |
| 77 | + |
| 78 | +command ``stop`` |
| 79 | + Optional command: stops a data acquisition. No-op if not busy. |
| 80 | + Subsequent ``go`` starts a new acquisition with clearing currently |
| 81 | + acquired data. |
| 82 | + |
| 83 | + |
| 84 | +``AcquisitionChannel`` (derived from ``Readable``) |
| 85 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 86 | + |
| 87 | +Accessibles: |
| 88 | + |
| 89 | +``value`` |
| 90 | + Mandatory: Interpretation as in ``Readable``. |
| 91 | + |
| 92 | + If the hardware allows, this parameter should be readable during the |
| 93 | + acquisition and return the current intermediate state. |
| 94 | + |
| 95 | + Outside of a data acquisition, the value MUST stay unchanged and |
| 96 | + represent the result of the latest cycle. |
| 97 | + |
| 98 | +``status`` |
| 99 | + Mandatory: Standard SECoP status. |
| 100 | + The module is in ``BUSY`` state while the channel is acquiring. |
| 101 | + |
| 102 | +``goal`` |
| 103 | + Optional: a ``value`` that, when reached, stops the data acquisition. |
| 104 | + |
| 105 | + Interpretation is channel specific: It can represent time for timer |
| 106 | + channels, or a certain number of events, or even a desired statistical |
| 107 | + significance. |
| 108 | + |
| 109 | +``use_goal`` |
| 110 | + Optional: a Boolean, if false, the goal is ignored and the acquisition |
| 111 | + does not stop due to this channel. |
| 112 | + |
| 113 | + If ``goal`` is present but not ``use_goal``, it is never ignored. |
| 114 | + |
| 115 | + |
| 116 | +``Acquisition`` |
| 117 | +~~~~~~~~~~~~~~~ |
| 118 | + |
| 119 | +Combines both AcquisitionController and AcquisitionChannel accessibles into one |
| 120 | +interface, for simple devices where only one channel is needed. |
| 121 | + |
| 122 | + |
| 123 | +"Matrix" type channels |
| 124 | +~~~~~~~~~~~~~~~~~~~~~~ |
| 125 | + |
| 126 | +Not an additional interface class, but an optional extension of |
| 127 | +``AcquisitionChannel``. |
| 128 | + |
| 129 | +Accessibles: |
| 130 | + |
| 131 | +``roi`` |
| 132 | + Optional: a list containing a ``(min, max)`` tuple per dimension, to specify |
| 133 | + a sub-slice of matrix data to consider in ``value`` and return in |
| 134 | + ``get_data``. |
| 135 | + |
| 136 | +command ``get_data`` |
| 137 | + Optional: returns the channel's data, with a ``matrix`` data type. |
| 138 | + |
| 139 | +The ``value`` parameter only contains a useful "reduced" form of the data, for |
| 140 | +example, the sum of all events in the matrix, or the average of all intensity |
| 141 | +values in a spectrum. If ``roi`` exists, only the selected sub-slice of matrix |
| 142 | +data is considered for this reduction. |
| 143 | + |
| 144 | +``binning`` |
| 145 | + Optional: allows reduction of the matrix size by re-binning data already |
| 146 | + on the server side. (Precise semantics to be specified.) |
| 147 | + |
| 148 | +``axes`` |
| 149 | + Optional: a list of axes ticks for the dimensions of the matrix data, if |
| 150 | + useful (i.e. not just "pixel 1..N"). (Precise semantics to be specified.) |
| 151 | + |
| 152 | + |
| 153 | +Disadvantages, Alternatives |
| 154 | +=========================== |
| 155 | + |
| 156 | +Disadvantages |
| 157 | +------------- |
| 158 | + |
| 159 | +None except for more complexity in the specification. |
| 160 | + |
| 161 | +Alternatives |
| 162 | +------------ |
| 163 | + |
| 164 | +- Instead of having three new classes, let ``AcqusitionController`` optionally |
| 165 | + have the interface of ``AcquisitionChannel`` as well. However, this gets |
| 166 | + messy and repetitive when later more accessibles for the channel class are |
| 167 | + added. |
| 168 | + |
| 169 | + |
| 170 | +Open Questions |
| 171 | +============== |
| 172 | + |
| 173 | +- Should we add an optional parameter ``progress`` on the |
| 174 | + ``AcqusitionController``, which gives an (approximate) percentage (or |
| 175 | + elapsed/remaining timings) for the acquisition process? |
| 176 | + |
| 177 | +- How to map channel names to "preset names" in ECS like NICOS? |
0 commit comments