-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpygettingstarted.html
407 lines (374 loc) · 27.2 KB
/
pygettingstarted.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
<!DOCTYPE html>
<html class="writer-html5" lang="en">
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Getting Started — slsDetectorPackage documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css" />
<link rel="stylesheet" type="text/css" href="_static/css/extra.css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Detector" href="pydetector.html" />
<link rel="prev" title="Examples" href="examples.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home">
slsDetectorPackage
</a>
<div class="version">
0.0.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Installation:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="dependencies.html">Dependencies</a></li>
<li class="toctree-l1"><a class="reference internal" href="consuming.html">Consuming slsDetectorPackage</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">C++ API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="detector.html">Detector</a></li>
<li class="toctree-l1"><a class="reference internal" href="result.html">Result</a></li>
<li class="toctree-l1"><a class="reference internal" href="receiver_api.html">Receiver</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Examples</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Python API</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Getting Started</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#which-python">Which Python?</a></li>
<li class="toctree-l2"><a class="reference internal" href="#building-from-source">Building from Source</a></li>
<li class="toctree-l2"><a class="reference internal" href="#pythonpath">PYTHONPATH</a></li>
<li class="toctree-l2"><a class="reference internal" href="#which-detector-class-should-i-use">Which detector class should I use?</a></li>
<li class="toctree-l2"><a class="reference internal" href="#hey-there-seems-to-be-two-apis">Hey, there seems to be two APIs?</a></li>
<li class="toctree-l2"><a class="reference internal" href="#finding-functions">Finding functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="#finding-out-what-the-function-does">Finding out what the function does</a></li>
<li class="toctree-l2"><a class="reference internal" href="#where-are-the-enums">Where are the ENUMs?</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="pydetector.html">Detector</a></li>
<li class="toctree-l1"><a class="reference internal" href="pyenums.html">Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="pyexamples.html">Examples</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Command line</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="commandline.html">Command line interface</a></li>
<li class="toctree-l1"><a class="reference internal" href="quick_start_guide.html">Quick Start Guide</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Developer</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="container_utils.html">ContainerUtils</a></li>
<li class="toctree-l1"><a class="reference internal" href="type_traits.html">TypeTraits</a></li>
<li class="toctree-l1"><a class="reference internal" href="ToString.html">ToString</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Firmware</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="firmware.html">Firmware Upgrade</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Detector Server</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="servers.html">Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="serverupgrade.html">Upgrade</a></li>
<li class="toctree-l1"><a class="reference internal" href="virtualserver.html">Simulators</a></li>
<li class="toctree-l1"><a class="reference internal" href="serverdefaults.html">Default Values</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Detector UDP Header</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="udpheader.html">Format</a></li>
<li class="toctree-l1"><a class="reference internal" href="udpconfig.html">Config file</a></li>
<li class="toctree-l1"><a class="reference internal" href="udpdetspec.html">Detector Specific Fields</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Receiver</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="receivers.html">Receivers</a></li>
<li class="toctree-l1"><a class="reference internal" href="slsreceiver.html">slsReceiver/ slsMultiReceiver</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Receiver Files</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="fileformat.html">File format</a></li>
<li class="toctree-l1"><a class="reference internal" href="slsreceiverheaderformat.html">SLS Receiver Header Format</a></li>
<li class="toctree-l1"><a class="reference internal" href="masterfileattributes.html">Master File Attributes</a></li>
<li class="toctree-l1"><a class="reference internal" href="binaryfileformat.html">Binary File Format</a></li>
<li class="toctree-l1"><a class="reference internal" href="hdf5fileformat.html">HDF5 File Format</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Receiver ZMQ Stream</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="zmqjsonheaderformat.html">ZMQ: Json Header Format</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Troubleshooting</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="troubleshooting.html">Troubleshooting</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">slsDetectorPackage</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Getting Started</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/pygettingstarted.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="getting-started">
<h1>Getting Started<a class="headerlink" href="#getting-started" title="Permalink to this heading"></a></h1>
<section id="which-python">
<h2>Which Python?<a class="headerlink" href="#which-python" title="Permalink to this heading"></a></h2>
<p>We require at least Python 3.8 and strongly recommended that you don’t use the system
Python installation. The examples in this documentation uses <a class="reference external" href="https://docs.conda.io/en/latest/miniconda.html">conda</a> since it provides good support
also for non Python packages but there are also other alternatives like, pyenv.</p>
<p>Using something like conda also allows you to quickly switch beteen different Python
environments.</p>
</section>
<section id="building-from-source">
<h2>Building from Source<a class="headerlink" href="#building-from-source" title="Permalink to this heading"></a></h2>
<p>If you are not installing slsdet binaries from conda, but instead building from
source, please refer to <a class="reference internal" href="installation.html#installation"><span class="std std-ref">the installation section</span></a> for details.</p>
<p>Don’t forget to compile with the option SLS_USE_PYTHON=ON to enable the Python
bindings or if you use the cmk.sh script -p.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Ensure that the sls det python lib compiled is for the expected python version.
For example, build/bin/_slsdet.cpython-39-x86_64-linux-gnu.so for Python v3.9.x</p>
</div>
</section>
<section id="pythonpath">
<h2>PYTHONPATH<a class="headerlink" href="#pythonpath" title="Permalink to this heading"></a></h2>
<p>If you install slsdet binaries using conda everything is set up and you can
directly start using the Python bindings. However, if you build
from source you need to tell Python where to find slsdet to use it. This
can be done by adding your build/bin directory to PYTHONPATH.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">export</span><span class="w"> </span><span class="nv">PYTHONPATH</span><span class="w"> </span><span class="o">=</span><span class="w"> </span>/path/to/your/build/bin:<span class="nv">$PYTHONPATH</span>
</pre></div>
</div>
</section>
<section id="which-detector-class-should-i-use">
<h2>Which detector class should I use?<a class="headerlink" href="#which-detector-class-should-i-use" title="Permalink to this heading"></a></h2>
<p>We provide a generic class called Detector and detector specific
versions like, Eiger, Jungfrau etc. The most or all functionality
is there in the base class except the convenient access to dacs
and temperatures.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">slsdet</span> <span class="kn">import</span> <span class="n">Detector</span><span class="p">,</span> <span class="n">Eiger</span>
<span class="n">d</span> <span class="o">=</span> <span class="n">Detector</span><span class="p">()</span>
<span class="n">e</span> <span class="o">=</span> <span class="n">Eiger</span><span class="p">()</span>
<span class="c1"># Both classes can be used to control an Eiger detector</span>
<span class="n">d</span><span class="o">.</span><span class="n">exptime</span> <span class="o">=</span> <span class="mf">0.5</span>
<span class="n">e</span><span class="o">.</span><span class="n">period</span> <span class="o">=</span> <span class="mi">1</span>
<span class="c1"># But Eiger gives a simpler interface to the dacs</span>
<span class="o">>>></span> <span class="n">e</span><span class="o">.</span><span class="n">dacs</span>
<span class="o">==========</span> <span class="n">DACS</span> <span class="o">=========</span>
<span class="n">vsvp</span> <span class="p">:</span> <span class="mi">0</span>
<span class="n">vtrim</span> <span class="p">:</span> <span class="mi">2480</span>
<span class="n">vrpreamp</span> <span class="p">:</span> <span class="mi">3300</span>
<span class="n">vrshaper</span> <span class="p">:</span> <span class="mi">1400</span>
<span class="n">vsvn</span> <span class="p">:</span> <span class="mi">4000</span>
<span class="n">vtgstv</span> <span class="p">:</span> <span class="mi">2556</span>
<span class="n">vcmp_ll</span> <span class="p">:</span> <span class="mi">1000</span>
<span class="n">vcmp_lr</span> <span class="p">:</span> <span class="mi">1000</span>
<span class="n">vcal</span> <span class="p">:</span> <span class="mi">0</span>
<span class="n">vcmp_rl</span> <span class="p">:</span> <span class="mi">1000</span>
<span class="n">rxb_rb</span> <span class="p">:</span> <span class="mi">1100</span>
<span class="n">rxb_lb</span> <span class="p">:</span> <span class="mi">1100</span>
<span class="n">vcmp_rr</span> <span class="p">:</span> <span class="mi">1000</span>
<span class="n">vcp</span> <span class="p">:</span> <span class="mi">1000</span>
<span class="n">vcn</span> <span class="p">:</span> <span class="mi">2000</span>
<span class="n">vishaper</span> <span class="p">:</span> <span class="mi">1550</span>
<span class="n">iodelay</span> <span class="p">:</span> <span class="mi">650</span>
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Depending on user feedback we might move some detector specific
functionality to the specialized classes.</p>
</div>
</section>
<section id="hey-there-seems-to-be-two-apis">
<h2>Hey, there seems to be two APIs?<a class="headerlink" href="#hey-there-seems-to-be-two-apis" title="Permalink to this heading"></a></h2>
<p>To make the Python API approachable, both if you come from the command line
or are using the C++ API, we provide two interfaces to the detector.
One is property based and tries to stay as close to the command line syntax
as is possible, and the other one directly maps the C++ API found in Detector.h.
There is also an underlying design reason for the two APIs since we auto
generate the bindings to the C++ code using a mix of pybind11 and clang-tools.
The property based API covers most of the functionality but in some cases
you have to reach for the C++ like interface.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">d</span> <span class="o">=</span> <span class="n">Detector</span><span class="p">()</span>
<span class="c1"># C++ like API</span>
<span class="n">d</span><span class="o">.</span><span class="n">setExptime</span><span class="p">(</span><span class="mf">0.1</span><span class="p">)</span>
<span class="c1"># or a bit more pythonic</span>
<span class="n">d</span><span class="o">.</span><span class="n">exptime</span> <span class="o">=</span> <span class="mf">0.1</span>
</pre></div>
</div>
<p>The c++ style API offers more control over access to individual modules
in a large detector.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Set exposure time for module 1, 5 and 7</span>
<span class="n">d</span><span class="o">.</span><span class="n">setExptime</span><span class="p">(</span><span class="mf">0.1</span><span class="p">,</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">7</span><span class="p">])</span>
</pre></div>
</div>
</section>
<section id="finding-functions">
<h2>Finding functions<a class="headerlink" href="#finding-functions" title="Permalink to this heading"></a></h2>
<p>To find out which properties and methods that a Python object have you
can use dir()</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">slsdet</span> <span class="kn">import</span> <span class="n">Detector</span>
<span class="gp">>>> </span><span class="n">d</span> <span class="o">=</span> <span class="n">Detector</span><span class="p">()</span>
<span class="gp">>>> </span><span class="nb">dir</span><span class="p">(</span><span class="n">d</span><span class="p">)</span>
<span class="go">['__class__', '__delattr__', '__dict__', '__dir__', '__doc__',</span>
<span class="go">'__eq__', '__format__', '__ge__', '__getattribute__', '__gt__',</span>
<span class="go">'__hash__', '__init__', '__init_subclass__', '__le__', '__len__',</span>
<span class="go">'__lt__', '__module__', '__ne__', '__new__', '__reduce__',</span>
<span class="go">'__reduce_ex__', '__repr__', '__setattr__', '__sizeof__',</span>
<span class="go">'__str__', '__subclasshook__', '_adc_register', '_frozen',</span>
<span class="go">'_register', 'acquire', 'adcclk', 'adcphase', 'adcpipeline',</span>
<span class="go">'adcreg', 'asamples', 'auto_comp_disable', 'clearAcquiringFlag',</span>
<span class="go">'clearBit', 'clearROI', 'client_version', 'config',</span>
<span class="go">'counters', 'daclist', 'dacvalues', 'dbitclk', 'dbitphase' ...</span>
</pre></div>
</div>
<p>Since the list for Detector is rather long it’s an good idea to filter it.
The following example gives you properties and methods containing time in
their name.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="p">[</span><span class="n">item</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="nb">dir</span><span class="p">(</span><span class="n">d</span><span class="p">)</span> <span class="k">if</span> <span class="s1">'time'</span> <span class="ow">in</span> <span class="n">item</span><span class="p">]</span>
<span class="go">['compdisabletime', 'exptime', 'exptimel', 'frametime', 'getExptime',</span>
<span class="go">'getExptimeForAllGates', 'getExptimeLeft', 'getSubExptime', 'patwaittime',</span>
<span class="go">'patwaittime0', 'patwaittime1', 'patwaittime2', 'runtime', 'setExptime',</span>
<span class="go">'setSubExptime', 'subdeadtime', 'subexptime']</span>
</pre></div>
</div>
<p>The above method works on any Python object but for convenience we also
included two functions to find names. View prints the names one per line
while find returns a list of names.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">slsdet.lookup</span> <span class="kn">import</span> <span class="n">view</span><span class="p">,</span> <span class="n">find</span>
<span class="o">>>></span> <span class="n">view</span><span class="p">(</span><span class="s1">'exptime'</span><span class="p">)</span>
<span class="n">exptime</span>
<span class="n">exptimel</span>
<span class="n">getExptime</span>
<span class="n">getExptimeForAllGates</span>
<span class="n">getExptimeLeft</span>
<span class="n">getSubExptime</span>
<span class="n">setExptime</span>
<span class="n">setSubExptime</span>
<span class="n">subexptime</span>
<span class="o">>>></span> <span class="n">find</span><span class="p">(</span><span class="s1">'exptime'</span><span class="p">)</span>
<span class="p">[</span><span class="s1">'exptime'</span><span class="p">,</span> <span class="s1">'getExptime'</span><span class="p">,</span> <span class="s1">'getExptimeForAllGates'</span><span class="p">,</span> <span class="s1">'getExptimeLeft'</span><span class="p">,</span>
<span class="s1">'getSubExptime'</span><span class="p">,</span> <span class="s1">'setExptime'</span><span class="p">,</span> <span class="s1">'setSubExptime'</span><span class="p">,</span> <span class="s1">'subexptime'</span><span class="p">]</span>
</pre></div>
</div>
</section>
<section id="finding-out-what-the-function-does">
<h2>Finding out what the function does<a class="headerlink" href="#finding-out-what-the-function-does" title="Permalink to this heading"></a></h2>
<p>To access the documentation of a function directly from the Python prompt use help().</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">help</span><span class="p">(</span><span class="n">Detector</span><span class="o">.</span><span class="n">period</span><span class="p">)</span>
<span class="go">Help on property:</span>
<span class="go"> Period between frames, accepts either a value in seconds or datetime.timedelta</span>
<span class="go"> Note</span>
<span class="go"> -----</span>
<span class="go"> :getter: always returns in seconds. To get in DurationWrapper, use getPeriod</span>
<span class="go"> Example</span>
<span class="go"> -----------</span>
<span class="go"> >>> # setting directly in seconds</span>
<span class="go"> >>> d.period = 1.05</span>
<span class="go"> >>></span>
<span class="go"> >>> # setting directly in seconds</span>
<span class="go"> >>> d.period = 5e-07</span>
<span class="go"> >>></span>
<span class="go"> >>> # using timedelta (up to microseconds precision)</span>
<span class="go"> >>> from datatime import timedelta</span>
<span class="go"> >>> d.period = timedelta(seconds = 1, microseconds = 3)</span>
<span class="go"> >>></span>
<span class="go"> >>> # using DurationWrapper to set in seconds</span>
<span class="go"> >>> from slsdet import DurationWrapper</span>
<span class="go"> >>> d.period = DurationWrapper(1.2)</span>
<span class="go"> >>></span>
<span class="go"> >>> # using DurationWrapper to set in ns</span>
<span class="go"> >>> t = DurationWrapper()</span>
<span class="go"> >>> t.set_count(500)</span>
<span class="go"> >>> d.period = t</span>
<span class="go"> >>></span>
<span class="go"> >>> # to get in seconds</span>
<span class="go"> >>> d.period</span>
<span class="go"> 181.23</span>
<span class="go"> >>></span>
<span class="go"> >>> d.getExptime()</span>
<span class="go"> [sls::DurationWrapper(total_seconds: 181.23 count: 181230000000)]</span>
</pre></div>
</div>
</section>
<section id="where-are-the-enums">
<h2>Where are the ENUMs?<a class="headerlink" href="#where-are-the-enums" title="Permalink to this heading"></a></h2>
<p>To set some of the detector settings like file format you have
to pass in an enum.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">d</span><span class="o">.</span><span class="n">setFileFormat</span><span class="p">(</span><span class="n">fileFormat</span><span class="o">.</span><span class="n">BINARY</span><span class="p">)</span>
</pre></div>
</div>
<p>The enums can be found in slsdet.enums</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">slsdet</span>
<span class="o">>>></span> <span class="p">[</span><span class="n">e</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="nb">dir</span><span class="p">(</span><span class="n">slsdet</span><span class="o">.</span><span class="n">enums</span><span class="p">)</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">e</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s1">'_'</span><span class="p">)]</span>
<span class="p">[</span><span class="s1">'M3_GainCaps'</span><span class="p">,</span> <span class="s1">'burstMode'</span><span class="p">,</span> <span class="s1">'clockIndex'</span><span class="p">,</span> <span class="s1">'cls'</span><span class="p">,</span> <span class="s1">'dacIndex'</span><span class="p">,</span> <span class="s1">'detectorSettings'</span><span class="p">,</span>
<span class="s1">'detectorType'</span><span class="p">,</span> <span class="s1">'dimension'</span><span class="p">,</span> <span class="s1">'externalSignalFlag'</span><span class="p">,</span> <span class="s1">'fileFormat'</span><span class="p">,</span>
<span class="s1">'frameDiscardPolicy'</span><span class="p">,</span> <span class="s1">'gainMode'</span><span class="p">,</span> <span class="s1">'name'</span><span class="p">,</span> <span class="s1">'polarity'</span><span class="p">,</span> <span class="s1">'portPosition'</span><span class="p">,</span>
<span class="s1">'readoutMode'</span><span class="p">,</span> <span class="s1">'runStatus'</span><span class="p">,</span> <span class="s1">'speedLevel'</span><span class="p">,</span> <span class="s1">'streamingInterface'</span><span class="p">,</span> <span class="s1">'timingMode'</span><span class="p">,</span>
<span class="s1">'timingSourceType'</span><span class="p">,</span> <span class="s1">'vetoAlgorithm'</span><span class="p">]</span>
<span class="c1"># Even though importing using * is not recommended one could</span>
<span class="c1"># get all the enums like this:</span>
<span class="o">>>></span> <span class="kn">from</span> <span class="nn">slsdet.enums</span> <span class="kn">import</span> <span class="o">*</span>
</pre></div>
</div>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="examples.html" class="btn btn-neutral float-left" title="Examples" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="pydetector.html" class="btn btn-neutral float-right" title="Detector" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 2020, PSD Detector Group.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>