This commit is contained in:
maliakal_d 2020-08-20 16:59:38 +02:00
parent a2ec86006d
commit 550ab51f34
3 changed files with 41 additions and 11 deletions

View File

@ -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

View File

@ -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<ns> 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<ns> getPeriod(Positions pos = {}) const;

View File

@ -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) {