Wiki source code of PythonDOOCS

Version 25.2 by sndueste on 2025/02/05 11:23

Hide last authors
sndueste 25.2 1 = =
2
3 {{toc minLevel="2"/}}
4
5 = How to read and write DOOCS properties with Python: =
6
7 \\
8
9 **Here is a link to an extensive documentation of the  [[python3 client interface to DOOCS>>url:https://confluence.desy.de/display/DOOCS/Python+Client+Interface||shape="rect"]]  and the link to the [[ IPython notebook>>attach:pydoocs_introduction.ipynb]] on which the documentation is based.**
10
11 \\
12
13 **See also a link to [[DOOCSPIE>>url:https://hasfcpkg.desy.de/doocspie/||shape="rect"]] for pulse synchronized readout**
14
15 **[[~[~[image:attach:image2023-10-4_13-30-7.png~|~|thumbnail="true" height="148"~]~]>>url:https://hasfcpkg.desy.de/doocspie/||shape="rect"]]**
16
17 \\
18
19 In the following there is a short introduction to a few basic first steps:
20
21 == Quickstart - Pydoocs ==
22
23 [[image:attach:pydoocs_read-write.png||width="700"]]
24
25 \\
26
27 == How to read Train IDs at FLASH synchronous readout ==
28
29 It is possible to pass the trainID (historically called macropulse) in pydoocs {{code language="none"}}read{{/code}} methode and ensure related data. For this purpose the [[doc:FLASHUSER.Data Acquisition and controls.DAQ and controls overview.Online data analysis.DAQmonitor.WebHome]] provides a ring buffer. [[An example>>url:https://stash.desy.de/projects/FSFL/repos/jupyter-notebook/browse/examples/pydoocs_read_bytrainId/MHzADC_via_DAQmonitor.ipynb||shape="rect"]] how to read the data from the ring buffer can be found in the [[repository>>url:https://stash.desy.de/projects/FSFL/repos/jupyter-notebook/browse||shape="rect"]]
30
31 [[image:attach:pydoocs_read-trainID.png||width="700"]]
32
33 == In development - Conda virtual environments ==
34
35 There are currently efforts to build a pydoocs conda package and distribute and manage python on the FLASH user consoles via virtual environments. On this way it is possible to use pydoocs on the Maxwell cluster and the corresponding [[ JupyterHub>>doc:FLASHUSER.Data Acquisition and controls.DAQ and controls overview.Online data analysis.Anaconda Python at FLASH.JupyterHub on Maxwell.WebHome]].
36
37 == Examples ==
38
39 * There are basic examples explained via [[jupyter notebooks>>url:https://stash.desy.de/projects/FSFL/repos/jupyter-notebook/browse||shape="rect"]] for accessing camera images and ADC traces. Further examples will be added gradually.
40 * Demo how to read ADC data partially. There are also options to only read part of the trace to limit the network traffic for online analysis:  [[attach:Pydoocs_read sliced ADC data.pdf]] (and as [[html>>attach:Pydoocs_read sliced ADC data.html]])
41 * (((
42 and some useful scripts from PG2 - [[attach:mono-scan.py]] and [[attach:delay-scan.py]]- as always be careful using DOOCS adresses that you know what you are doing / moving !!
43 )))
44
45 == Caveat ==
46
47 **//for images//**
48
49 Returns the camera images as seen on the jDDD panel (including e.g. ROIs):
50 doocspath = 'FLASH.FEL/FBL1.CAM/FOCUS_MICROSCOPE/IMAGE_EXT'
51
52 Returns the raw camera image~:
53 doocspath = 'FLASH.FEL/FBL1.CAM/FOCUS_MICROSCOPE/IMAGE_EXT**_ZMQ**'
54
55 **//for ADC traces//**
56
57 Returns the whole trace which is acquird from the ADC:
58 doocspath ='FLASH.FEL/ADC.ADQ.BL1/EXP1.CH01/CH00.TD'
59
60 Returns the trace which is written to DAQ (the range is adjustable via jDDD) :
61 doocspath ='FLASH.FEL/ADC.ADQ.BL1/EXP1.CH01/CH00.**DAQ.**TD'
62
63 == Big caveat: anaconda5 ==
64
65 As this is an quite big caveat it is possible to compile pydoocs yourself and is done for all linux console in the FLASH1 &2 hall.
66
67 * [[attach:howto-compile-pydoocs.txt]]: Step-by-Step Guide from Soeren Grunewald to compile it yourself
68
69 With the introduction of pydoocs as a conda package this will be redundant in the near future.