This chapter provides the necessary information to write a one dimensional (1D) experimental channel controller in Sardana.
To write a 1D controller class you can follow the How to write a counter/timer controller guide keeping in mind differences explained in continuation.
1D controller should provide a shape of the spectrum which will be produced by acquisition. The shape can be either static e.g. defined by the detector’s sensor size or dynamic e.g. depending on the detector’s (or an intermediate control software layer e.g. LImA) configuration like RoI or binning.
In any case you should provide the shape in the format of a one-element sequence
with the length of the spectrum using
Here is an example of the possible implementation of
class SpringfieldOneDController(TwoDController): def GetAxisPar(self, axis, par): if par == "shape": return self.springfield.getShape(axis)
For backwards compatibility, in case of not implementing the
parameter, shape will be determined from the
MaxDimSize of the
attribute, currently (4096,).
from sardana.pool.controller import OneDController class SpringfieldOneDController(OneDController): def __init__(self, inst, props, *args, **kwargs): super().__init__(inst, props, *args, **kwargs)
Get counter values
chapter explains how to read counter/timer values
ReadOne() method while
acquiring with external (hardware) synchronization.
Here you need to implement the same method but its return value
must be a sequence with one-dimensional
numpy.array objects (or eventually
SardanaValue objects) containing spectrums
instead of scalar values.
1D experimental channels may produce significant arrays of data at high frame rate. Reading this data and storing it using sardana is not always optimal. SEP2 introduced data saving duality, optionally, leaving the data storage at the responsibility of the detector (or an intermediate software layer e.g. LImA). In this case sardana just deals with the reference to the data.