diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 471637d94..fe30e5541 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -206,6 +206,21 @@ class Detector(CppDetectorApi): def exptime(self): """ Exposure time, accepts either a value in seconds or datetime.timedelta + + Note + ----- + [Mythen3] sets exposure time to all gate signals in auto and trigger mode (internal gating). To specify gateIndex, use getExptime or setExptime. + + :getter: always returns in seconds. To get in datetime.delta, use getExptime + + Examples + ----------- + >>> d.exptime = 1.05 + >>> d.exptime = datetime.timedelta(minutes = 3, seconds = 1.23) + >>> d.exptime + 181.23 + >>> d.getExptime() + [datetime.timedelta(seconds=181, microseconds=230000)] """ if self.type == detectorType.MYTHEN3: res = self.getExptimeForAllGates() @@ -231,6 +246,22 @@ class Detector(CppDetectorApi): @property @element def delay(self): + """ + [Gotthard][Jungfrau][CTB][Moench][Mythen3][Gotthard2] Delay after trigger, accepts either a value in seconds or datetime.timedelta + + Note + ----- + :getter: always returns in seconds. To get in datetime.delta, use getDelayAfterTrigger + + Examples + ----------- + >>> d.delay = 1.05 + >>> d.delay = datetime.timedelta(minutes = 3, seconds = 1.23) + >>> d.delay + 181.23 + >>> d.getDelayAfterTrigger() + [datetime.timedelta(seconds=181, microseconds=230000)] + """ return ut.reduce_time(self.getDelayAfterTrigger()) @delay.setter diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index 58a127c50..8ea73c241 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -176,10 +176,13 @@ class Detector { void setNumberOfTriggers(int64_t value); - /** [Gotthard][Jungfrau][Eiger][CTB][Moench][Gotthard2] For Mythen3, use - * function with gate index **/ + /** [Gotthard][Jungfrau][Eiger][CTB][Moench][Gotthard2] \n + * [Mythen3] use function with gate index **/ Result getExptime(Positions pos = {}) const; + /** [Gotthard][Jungfrau][Eiger][CTB][Moench][Gotthard2] \n + * [Mythen3] sets exptime for all gate signals. To specify gate index, use + * function with gate index **/ void setExptime(ns t, Positions pos = {}); Result getPeriod(Positions pos = {}) const; diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index efd75fe49..362e7ea65 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -387,25 +387,21 @@ std::string CmdProxy::Exptime(int action) { os << "[duration] [(optional unit) " "ns|us|ms|s]\n\t[Eiger][Jungfrau][Gotthard][Gotthard2][" "Moench][Ctb] Exposure time" - "\n\t[Gotthard2] Uploaded to detector just before " - "acquisition starts" "\n\t[Mythen3] Exposure time of all gate signals in auto and " - "trigger mode (internal gating)." + "trigger mode (internal gating). To specify gate index, use " + "exptime1, exptime2, exptime3." << '\n'; } else if (cmd == "exptime1") { os << "[n_value]\n\t[Mythen3] Exposure time of gate signal 1 in " - "auto and " - "trigger mode (internal gating)." + "auto and trigger mode (internal gating)." << '\n'; } else if (cmd == "exptime2") { os << "[n_value]\n\t[Mythen3] Exposure time of gate signal 2 in " - "auto and " - "trigger mode (internal gating)." + "auto and trigger mode (internal gating)." << '\n'; } else { os << "[n_value]\n\t[Mythen3] Exposure time of gate signal 3 in " - "auto and " - "trigger mode (internal gating)." + "auto and trigger mode (internal gating)." << '\n'; } } else if (action == defs::GET_ACTION) {