Data access and Vizualisation
Data access
Here is the overall high level interface of Lima2. Client such as Flint control the acquisition and access the data using the Client API that manages the distributed nature of data receivers. The Client API knows where to get the data for a given frame.
flowchart BT
flint(FLINT)
api(Client API) --- flint
cds(Control DS) --- api
rds1(Receiver DS #1) --- api
rdsn(Receiver DS #n) --- api
Data in the processing graph are made available using a circular buffer node that can be inserted anywhere in the processing graph:
flowchart LR
src(Source) --> proc1(OpenCL - Energy Reconstruction + pyFAI) --> buf1{{Circular buffer for sparse data}}
src --> proc2(CPU - Image reconstruction) --> buf2{{Circular buffer for dense data}} --> proc3(ROI counters) --> buf3{{Circular buffer for ROI counters}}
The receiver API gives read access to the cyclic buffer -which size is configurable. A Tango DS is used to serve this data.
Tango
Reusing the same DevEncoded
for images called DATA_ARRAY
:
# The DATA_ARRAY definition
#struct {
#unsigned int Magic= 0x44544159;
#unsigned short Version;
#unsigned short HeaderLength;
#DataArrayCategory Category;
#DataArrayType DataType;
#unsigned short DataEndianness;
#unsigned short NbDim;
#unsigned short Dim[8]
#unsigned int DimStep[8]
#} DataArrayHeaderStruct;
# With
DataArrayVersion = 3
DataArrayPackStr = '<IHHIIHHHHHHHHIIIIIIII'
DataArrayMagic = struct.unpack('>I', b'DTAY')[0] # 0x44544159
DataArrayHeaderLen = 64
DataArrayMaxNbDim = 6
DATA_ARRAY v3.0
New catergories for sparse images are introduced:
Category | NbDim |
---|---|
ScalarStack | 1 |
Spectrum | 1 |
Image | 2 |
SparseImage | 3 |
SpectrumStack | 2 |
ImageStack | 3 |
SparseImageStack | 4 |
For SparseImageStack
, the dimensions are:
dims[0] = nb pixels
dims[1] = width
dims[2] = height
dims[3] = nb images (for stacks)
The data block (or bytes) is the concatenation of
Category | Type | Size |
---|---|---|
Pixel value | ImageType2DataArrayType | nb pixels |
Padding to 32 bits | ||
Pixel index | Int32 | nb pixels |
Frame index | Int32 | nb frames |
Vizualisation
GUI - Flint
Live display of BLISS scans
Flint listens to scan data source to know if there’s something to display.
Poll the image counter of Lima. Call read_image
according to the refresh rate.
Users data plotting
New user plotting are introduced:
- Image plot of the reduced data (without background). The Lima Client API would do the densification.
- Time curve plot with the number of peaks over time.
Specific options
Display images with a number of peaks higher than a given threshold.
GUI - Web beam viewer
Lima web server used to display camera image with beam position (bpm) statistics built on top of the Tango DS.