This commit is contained in:
2022-12-07 16:02:29 +01:00
parent ce6c8cddf1
commit aa3542c1cb
11 changed files with 379 additions and 113 deletions

View File

@ -21,10 +21,8 @@ the shared libraries these are needed:
GUI
-----------------------
The GUI is currently using Qt4 but watch out for an upgrade to 5.
* Qt 4.8
* Qwt 6.1
* Qt 5.9
* Qwt 6.1.5 (packaged in libs/)
-----------------------
Python bindings

View File

@ -92,19 +92,30 @@ Download
Upgrade
^^^^^^^^
.. note ::
.. warning ::
In case you have had issues in the past with programming via software:
* 6.1.2 server has a fix for seamless fpga programming
* We recommend first updating the on-board detector server to 6.1.2 (with client 6.1.x) using command 'updatedetectorserver' or 'copydetectorserver'.
* Then use command 'programfpga' to only update firmware or use command 'update' to update firmware and server to the latest release.
These instructions are for upgrades from v5.0.0. For earlier versions, contact us.
Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you run into issues while programming firmware.
Always ensure that the client and server software are of the same release.
Program from console
.. code-block:: bash
# These instructions are for upgrades from v5.0.0. For earlier versions, please contact us.
# Always ensure that the client and server software are of the same release.
# copies server from tftp folder of pc, links new server to jungfrauDetectorServer,
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga,
@ -155,10 +166,6 @@ Upgrade
Mythen III
-----------
.. note ::
As it is still in development, the rbf files must be picked up from us.
Download
^^^^^^^^^^^^^
@ -170,11 +177,11 @@ Download
Upgrade
^^^^^^^^
Always ensure that the client and server software are of the same release.
Program from console
.. code-block:: bash
# Always ensure that the client and server software are of the same release.
# copies server from tftp folder of pc, links new server to mythen3DetectorServer,
# programs fpga,
# reboots
@ -199,11 +206,11 @@ Download
Upgrade
^^^^^^^^
Always ensure that the client and server software are of the same release.
Program from console
.. code-block:: bash
# Always ensure that the client and server software are of the same release.
# copies server from tftp folder of pc, links new server to gotthard2DetectorServer,
# programs fpga,
# reboots
@ -230,13 +237,26 @@ Download
Upgrade
^^^^^^^^
.. warning ::
In case you have had issues in the past with programming via software:
* 6.1.2 server has a fix for seamless fpga programming
* We recommend first updating the on-board detector server to 6.1.2 (with client 6.1.x) using command 'updatedetectorserver' or 'copydetectorserver'.
* Then use command 'programfpga' to only update firmware or use command 'update' to update firmware and server to the latest release.
Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you run into issues while programming firmware.
Always ensure that the client and server software are of the same release.
Program from console
.. code-block:: bash
# Always ensure that the client and server software are of the same release.
# copies server from tftp folder of pc, links new server to moenchDetectorServer,
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga,
@ -262,11 +282,12 @@ Upgrade
Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you run into issues while programming firmware.
Always ensure that the client and server software are of the same release.
Program from console
.. code-block:: bash
# Always ensure that the client and server software are of the same release.
# copies server from tftp folder of pc, links new server to ctbDetectorServer,
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga,

View File

@ -10,27 +10,46 @@ open an issue in our our `github repo
Setting exposure time
------------------------------------
Setting and reading back exposure time can be done either using a Python datetime.timedelta
or by setting the time in seconds.
Setting and reading back exposure time can be done either using a Python
datetime.timedelta, DurationWrapper or by setting the time in seconds.
::
# Set exposure time to 1.2 seconds
>>> d.exptime = 1.2
>>> d.exptime = 5e-07
# Setting exposure time using timedelta
# Setting exposure time using timedelta (upto microseconds precision)
import datetime as dt
>>> d.exptime = dt.timedelta(seconds = 1.2)
>>> d.exptime = dt.timedelta(seconds = 1, microseconds = 3)
# With timedelta any arbitrary combination of units can be used
>>> t = dt.timedelta(microseconds = 100, seconds = 5.3, minutes = .3)
# using DurationWrapper to set in seconds
>>> from slsdet import DurationWrapper
>>> d.exptime = DurationWrapper(1.2)
# using DurationWrapper to set in ns
>>> t = DurationWrapper()
>>> t.set_count(500)
>>> d.exptime = t
# To set exposure time for individual detector one have to resort
# to the C++ style API.
# Sets exposure time to 1.2 seconds for module 0, 6 and 12
>>> d.setExptime(1.2, [0, 6, 12])
>>> d.setExptime(dt.timedelta(seconds = 1.2), [0, 6, 12])
# to get in seconds
>>> d.period
181.23
# to get in DurationWrapper
>>> d.getExptime()
[sls::DurationWrapper(total_seconds: 181.23 count: 181230000000)]
------------------------------------
@ -220,8 +239,7 @@ Setting and getting times
# This sets the exposure time for all modules
d.exptime = 0.5
# exptime also accepts a python datetime.timedelta
# which can be used to set the time in almost any unit
# exptime also accepts a python datetime.timedelta (upto microseconds resolution)
t = dt.timedelta(milliseconds = 2.3)
d.exptime = t
@ -229,16 +247,25 @@ Setting and getting times
t = dt.timedelta(minutes = 3, seconds = 1.23)
d.exptime = t
# using DurationWrapper to set in seconds
>>> from slsdet import DurationWrapper
>>> d.exptime = DurationWrapper(1.2)
# using DurationWrapper to set in ns
>>> t = DurationWrapper()
>>> t.set_count(500)
>>> d.exptime = t
# exptime however always returns the time in seconds
>>> d.exptime
181.23
# To get back the exposure time for each module
# it's possible to use getExptime, this also returns
# the values as datetime.timedelta
# the values as DurationWrapper
>>> d.getExptime()
[datetime.timedelta(seconds=181, microseconds=230000), datetime.timedelta(seconds=181, microseconds=230000)]
[sls::DurationWrapper(total_seconds: 181.23 count: 181230000000)]
# In case the values are the same it's possible to use the
# element_if_equal function to reduce the values to a single
@ -246,7 +273,8 @@ Setting and getting times
>>> t = d.getExptime()
>>> element_if_equal(t)
datetime.timedelta(seconds=1)
sls::DurationWrapper(total_seconds: 1.2 count: 1200000000)
--------------
Reading dacs

View File

@ -6,7 +6,7 @@ Getting Started
Which Python?
--------------------
We require at lest Python 3.6 and strongly recommended that you don't use the system
We require at least Python 3.6 and strongly recommended that you don't use the system
Python installation. The examples in this documentation uses `conda
<https://docs.conda.io/en/latest/miniconda.html>`_ since it provides good support
also for non Python packages but there are also other alternatives like, pyenv.
@ -14,29 +14,35 @@ also for non Python packages but there are also other alternatives like, pyenv.
Using something like conda also allows you to quickly switch beteen different Python
environments.
---------------------
Building from Source
---------------------
If you are not installing slsdet binaries from conda, but instead building from
source, please refer to :ref:`the installation section<Installation>` for details.
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.
.. note ::
Ensure that the python lib compiled is for the expected python version.
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
---------------------
PYTHONPATH
---------------------
If you install slsdet using conda everything is set up and you can
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. This
is be done by adding your build/bin directory to PYTHONPATH.
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.
.. code-block:: bash
export PYTHONPATH = /path/to/your/build/bin:$PYTHONPATH
.. note ::
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.
--------------------------------------
Which detector class should I use?
--------------------------------------
@ -147,9 +153,11 @@ their name.
::
>>> [item for item in dir(d) if 'time' in item]
['exptime', 'getExptime', 'getExptimeForAllGates', 'getExptimeLeft',
'getSubExptime', 'patwaittime0', 'patwaittime1', 'patwaittime2',
'setExptime', 'setSubExptime', 'subdeadtime', 'subexptime']
['compdisabletime', 'exptime', 'exptimel', 'frametime', 'getExptime',
'getExptimeForAllGates', 'getExptimeLeft', 'getSubExptime', 'patwaittime',
'patwaittime0', 'patwaittime1', 'patwaittime2', 'runtime', 'setExptime',
'setSubExptime', 'subdeadtime', 'subexptime']
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
@ -161,6 +169,7 @@ while find returns a list of names.
>>> view('exptime')
exptime
exptimel
getExptime
getExptimeForAllGates
getExptimeLeft
@ -169,6 +178,7 @@ while find returns a list of names.
setSubExptime
subexptime
>>> find('exptime')
['exptime', 'getExptime', 'getExptimeForAllGates', 'getExptimeLeft',
'getSubExptime', 'setExptime', 'setSubExptime', 'subexptime']
@ -186,19 +196,39 @@ To access the documentation of a function directly from the Python prompt use he
Help on property:
Period between frames, accepts either a value in seconds or datetime.timedelta
Note
-----
:getter: always returns in seconds. To get in datetime.delta, use getPeriod
Examples
:getter: always returns in seconds. To get in DurationWrapper, use getPeriod
Example
-----------
>>> # setting directly in seconds
>>> d.period = 1.05
>>> d.period = datetime.timedelta(minutes = 3, seconds = 1.23)
>>>
>>> # setting directly in seconds
>>> d.period = 5e-07
>>>
>>> # using timedelta (up to microseconds precision)
>>> from datatime import timedelta
>>> d.period = timedelta(seconds = 1, microseconds = 3)
>>>
>>> # using DurationWrapper to set in seconds
>>> from slsdet import DurationWrapper
>>> d.period = DurationWrapper(1.2)
>>>
>>> # using DurationWrapper to set in ns
>>> t = DurationWrapper()
>>> t.set_count(500)
>>> d.period = t
>>>
>>> # to get in seconds
>>> d.period
181.23
>>> d.getPeriod()
[datetime.timedelta(seconds=181, microseconds=230000)]
>>>
>>> d.getExptime()
[sls::DurationWrapper(total_seconds: 181.23 count: 181230000000)]
----------------------
@ -218,11 +248,12 @@ The enums can be found in slsdet.enums
import slsdet
>>> [e for e in dir(slsdet.enums) if not e.startswith('_')]
['burstMode', 'clockIndex', 'dacIndex',
'detectorSettings', 'detectorType', 'dimension', 'externalSignalFlag',
'fileFormat', 'frameDiscardPolicy',
'readoutMode', 'runStatus', 'speedLevel', 'timingMode',
'timingSourceType']
['M3_GainCaps', 'burstMode', 'clockIndex', 'cls', 'dacIndex', 'detectorSettings',
'detectorType', 'dimension', 'externalSignalFlag', 'fileFormat',
'frameDiscardPolicy', 'gainMode', 'name', 'polarity', 'portPosition',
'readoutMode', 'runStatus', 'speedLevel', 'streamingInterface', 'timingMode',
'timingSourceType', 'vetoAlgorithm']
# Even though importing using * is not recommended one could
# get all the enums like this:

View File

@ -23,15 +23,19 @@ Arguments
.. code-block:: bash
Possible arguments are:
-v, --version : Software version
-p, --port <port> : TCP communication port with client.
-g, --nomodule : [Mythen3][Gotthard2] Generic or No Module mode.
Skips detector type checks.
-f, --phaseshift <value> : [Gotthard] only. Sets phase shift.
-d, --devel : Developer mode. Skips firmware checks.
-u, --update : Update mode. Skips firmware checks and initial detector setup.
-s, --stopserver : Stop server. Do not use as it is created by control server
-v, --version : Software version
-p, --port <port> : TCP communication port with client.
-g, --nomodule : [Mythen3][Gotthard2]
Generic or No Module mode. Skips detector type checks.
-f, --phaseshift <value> : [Gotthard] only. Sets phase shift.
-d, --devel : Developer mode. Skips firmware checks.
-u, --update : Update mode. Skips firmware checks and initial detector setup.
-i, --ignore-config : [Eiger][Jungfrau][Gotthard][Gotthard2][Moench]
Ignore config file.
-m, --master <master> : [Eiger][Mythen3][Gotthard][Gotthard2]
Set Master to 0 or 1. Precedence over config file. Only for virtual servers except Eiger.
-t, --top <top> : [Eiger] Set Top to 0 or 1. Precedence over config file.
-s, --stopserver : Stop server. Do not use as it is created by control server
.. _Automatic start servers:
@ -88,6 +92,8 @@ One can start the on-board detector server automatically upon powering on the bo
.. code-block:: bash
sync
# physically reboot for Gotthard II or Mythen III
reboot
# verify

View File

@ -6,6 +6,10 @@ Config file
Commands to configure the UDP in the config file:
.. note ::
These command are recommended to be placed before "rx_hostname" if it is used.
Source Port
-----------
Hardcoded in detector server, starting at 32410.

View File

@ -110,7 +110,7 @@ Jungfrau
| | | | last exposure. |
| | +-----+----------------------------------------+
| | | 0 | External input flag not detected in the|
| | | | last exposure. |
| | | | last exposure. |
+----------+--------------------+-----+----------------------------------------+

View File

@ -9,7 +9,7 @@ The UDP data format for the packets consist of a common header for all detectors
Current Version
---------------------------
**v3.0 (slsDetectorPackage v7.0.0+)**
**v2.0 (slsDetectorPackage v7.0.0+)**
.. table:: <---------------------------------------------------- 8 bytes ---------------------------------------------------->
:align: center
@ -30,6 +30,18 @@ Current Version
+-------------------------------+---------------+-------+-------+
.. note ::
Since there is no difference in the format of the UDP header from the detector
from the previous version (v2.0), the version number stays the same.
Only the struture member names have changed in sls_detector_defs.h
Description
------------
* **Detector specific field** descriptions are found :ref:`here<detector specific fields>`.
* **frameNumber**: framenumber to which the current packet belongs to.
@ -48,6 +60,12 @@ Current Version
* **detType**: detector type from enum of detectorType in the package.
* **version**: current version of the detector header (0x2).
Detector Enum
--------------
================ ========
Detector Type Value
================ ========
@ -61,7 +79,6 @@ Current Version
GOTTHARD2 7
================ ========
* **version**: current version of the detector header. It is at 0x3.
Previous Versions

View File

@ -13,16 +13,14 @@ Compilation
* Using cmk.sh script,
.. code-block:: bash
./cmk.sh -bsj9 #option s is for simulator
./cmk.sh -bsj9 # option -s is for simulator
Binaries
^^^^^^^^
.. code-block:: bash
eigerDetectorServerMaster_virtual
eigerDetectorServerSlaveTop_virtual
eigerDetectorServerSlaveBottom_virtual
eigerDetectorServer_virtual
jungfrauDetectorServer_virtual
gotthardDetectorServer_virtual
gotthard2DetectorServer_virtual
@ -67,7 +65,15 @@ Sample Config file
^^^^^^^^^^^^^^^^^^
There are sample config files for each detector in slsDetectorPackage/examples folder.
For a Single Module
For a Single Module (Basic)
.. code-block:: bash
hostname localhost
rx_hostname localhost
udp_dstip auto
For a Single Module (With Options)
.. code-block:: bash
# connects to control port 1912
@ -140,7 +146,7 @@ Gui
Limitations
-----------
#. Data coming out of virtual server is fake. Value at each pixel/ channel is incremented by 1.
#. Data coming out of virtual server is fake.
#. A stop will stop the virtual acquisition only at the start of every new frame.