diff --git a/docs/src/commandline.rst b/docs/src/commandline.rst index 25afce8ad..b65cf1cef 100644 --- a/docs/src/commandline.rst +++ b/docs/src/commandline.rst @@ -6,6 +6,8 @@ Usage The syntax is *'[detector index]-[module index]:[command]'*, where the indices are by default '0', when not specified. +.. _cl-module-index-label: + Module index ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Modules are indexed based on their order in the hostname command. They are used to configure a specific module within a detector and are followed by a ':' in syntax. diff --git a/docs/src/multidet.rst b/docs/src/multidet.rst index ab9c1afd2..ead3d79d5 100644 --- a/docs/src/multidet.rst +++ b/docs/src/multidet.rst @@ -4,9 +4,18 @@ Using multiple detectors The slsDetectorPackage supports using several detectors on the same computer. This can either be two users, that need to use the same computer without interfering with each other, or the same user that wants to use multiple detectors at the same time. -The detectors in turn can consist of multiple modules. +The detectors in turn can consist of multiple modules. For example, a 9M Jungfrau detector +consists of 18 modules which typically are addressed at once as a single detector. -In order to do this we have two tools to our disposal: +.. note :: + + To address a single module of a multi-module detector you can use the module index. + + - Command line: :ref:`cl-module-index-label` + - Python: :ref:`py-module-index-label` + + +Coming back to multiple detectors we have two tools to our disposal: #. Detector index #. The SLSDETNAME environment variable @@ -186,4 +195,5 @@ using the same: .. attention :: The computer that you are using need to have enough resources to run multiple detectors at the same time. - This includes CPU and network bandwidth. Please coordinate with the other users! \ No newline at end of file + This includes CPU and network bandwidth. Please coordinate with the other users! + diff --git a/docs/src/pygettingstarted.rst b/docs/src/pygettingstarted.rst index 547d597e0..6f234d5ae 100644 --- a/docs/src/pygettingstarted.rst +++ b/docs/src/pygettingstarted.rst @@ -123,6 +123,47 @@ in a large detector. # Set exposure time for module 1, 5 and 7 d.setExptime(0.1, [1,5,7]) + + +.. _py-module-index-label: + +---------------------------------- +Accessing individual modules +---------------------------------- + +Using the C++ like API you can access individual modules in a large detector +by passing in the module index as an argument to the function. + +:: + + # Read the UDP destination port for all modules + >>> d.getDestinationUDPPort() + [50001, 50002, 50003] + + + # Read it for module 0 and 1 + >>> d.getDestinationUDPPort([0, 1]) + [50001, 50002] + + >>> d.setDestinationUDPPort(50010, 1) + >>> d.getDestinationUDPPort() + [50001, 50010, 50003] + +From the more pythonic API there is no way to read from only one module but you can read +and then use list slicing to get the values for the modules you are interested in. + +:: + + >>> d.udp_dstport + [50001, 50010, 50003] + >>> d.udp_dstport[0] + 50001 + + #For some but not all properties you can also pass in a dictionary with module index as key + >>> ip = IpAddr('127.0.0.1') + >>> d.udp_dstip = {1:ip} + + -------------------- Finding functions --------------------