mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 13:27:14 +02:00
WIP doc
This commit is contained in:
@ -159,6 +159,15 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def dr(self):
|
def dr(self):
|
||||||
|
"""
|
||||||
|
Dynamic range or number of bits per pixel/channel.
|
||||||
|
|
||||||
|
Note
|
||||||
|
-----
|
||||||
|
[Eiger] Options: 4, 8, 16, 32. If set to 32, also sets clkdivider to 2 (quarter speed), else to 0 (full speed)\n
|
||||||
|
[Mythen3] Options: 8, 16, 32 \n
|
||||||
|
[Jungfrau][Gotthard][Ctb][Moench][Mythen3][Gotthard2] 16
|
||||||
|
"""
|
||||||
return element_if_equal(self.getDynamicRange())
|
return element_if_equal(self.getDynamicRange())
|
||||||
|
|
||||||
@dr.setter
|
@dr.setter
|
||||||
@ -397,6 +406,17 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def fformat(self):
|
def fformat(self):
|
||||||
|
""" File format of data file in receiver.
|
||||||
|
|
||||||
|
Note
|
||||||
|
-----
|
||||||
|
For HDF5, package must be compiled with HDF5 flags. Default is binary.
|
||||||
|
|
||||||
|
Example
|
||||||
|
--------
|
||||||
|
d.fformat = slsDetectorDefs.fileFormat.BINARY
|
||||||
|
|
||||||
|
"""
|
||||||
return element_if_equal(self.getFileFormat())
|
return element_if_equal(self.getFileFormat())
|
||||||
|
|
||||||
@fformat.setter
|
@fformat.setter
|
||||||
@ -405,6 +425,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def findex(self):
|
def findex(self):
|
||||||
|
"""File or Acquisition index in receiver."""
|
||||||
return element_if_equal(self.getAcquisitionIndex())
|
return element_if_equal(self.getAcquisitionIndex())
|
||||||
|
|
||||||
@findex.setter
|
@findex.setter
|
||||||
@ -413,6 +434,17 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def fname(self):
|
def fname(self):
|
||||||
|
"""File name prefix for output data file in receiver. Default is run.
|
||||||
|
|
||||||
|
Note
|
||||||
|
-----
|
||||||
|
File name: [file name prefix]_d[detector index]_f[sub file index]_[acquisition/file index].[raw/h5].
|
||||||
|
|
||||||
|
Examples
|
||||||
|
--------
|
||||||
|
d.fname = 'run'
|
||||||
|
eg. file name: run_d0_f0_5.raw
|
||||||
|
"""
|
||||||
return element_if_equal(self.getFileNamePrefix())
|
return element_if_equal(self.getFileNamePrefix())
|
||||||
|
|
||||||
@fname.setter
|
@fname.setter
|
||||||
@ -421,6 +453,16 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def fpath(self):
|
def fpath(self):
|
||||||
|
"""Directory where output data files are written in receiver.
|
||||||
|
|
||||||
|
Note
|
||||||
|
----
|
||||||
|
If path does not exist, it will try to create it.
|
||||||
|
|
||||||
|
Examples
|
||||||
|
--------
|
||||||
|
d.fpath = '/tmp/run_20201705'
|
||||||
|
"""
|
||||||
return element_if_equal(self.getFilePath())
|
return element_if_equal(self.getFilePath())
|
||||||
|
|
||||||
@fpath.setter
|
@fpath.setter
|
||||||
@ -438,6 +480,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def foverwrite(self):
|
def foverwrite(self):
|
||||||
|
"""Enable or disable receiver file overwriting. Default is enabled. """
|
||||||
return element_if_equal(self.getFileOverWrite())
|
return element_if_equal(self.getFileOverWrite())
|
||||||
|
|
||||||
@foverwrite.setter
|
@foverwrite.setter
|
||||||
@ -446,6 +489,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def fmaster(self):
|
def fmaster(self):
|
||||||
|
"""Enable or disable receiver master file. Default is enabled."""
|
||||||
return element_if_equal(self.getMasterFileWrite())
|
return element_if_equal(self.getMasterFileWrite())
|
||||||
|
|
||||||
@fmaster.setter
|
@fmaster.setter
|
||||||
@ -685,10 +729,12 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def daclist(self):
|
def daclist(self):
|
||||||
|
"""Gets the list of enums for every dac for this detector."""
|
||||||
return self.getDacList()
|
return self.getDacList()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def dacvalues(self):
|
def dacvalues(self):
|
||||||
|
"""Gets the dac values for every dac for this detector."""
|
||||||
return {
|
return {
|
||||||
dac.name.lower(): np.array(self.getDAC(dac, False))
|
dac.name.lower(): np.array(self.getDAC(dac, False))
|
||||||
for dac in self.getDacList()
|
for dac in self.getDacList()
|
||||||
@ -839,6 +885,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def flowcontrol10g(self):
|
def flowcontrol10g(self):
|
||||||
|
"""[Eiger][Jungfrau] Enable or disable 10GbE Flow Control."""
|
||||||
return element_if_equal(self.getTenGigaFlowControl())
|
return element_if_equal(self.getTenGigaFlowControl())
|
||||||
|
|
||||||
@flowcontrol10g.setter
|
@flowcontrol10g.setter
|
||||||
@ -1045,6 +1092,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def dsamples(self):
|
def dsamples(self):
|
||||||
|
"""[CTB] Number of digital samples expected. """
|
||||||
return element_if_equal(self.getNumberOfDigitalSamples())
|
return element_if_equal(self.getNumberOfDigitalSamples())
|
||||||
|
|
||||||
@dsamples.setter
|
@dsamples.setter
|
||||||
|
@ -214,10 +214,9 @@ class Detector {
|
|||||||
Result<int> getDynamicRange(Positions pos = {}) const;
|
Result<int> getDynamicRange(Positions pos = {}) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [Eiger] Options: 4, 8, 16, 32
|
* [Eiger] Options: 4, 8, 16, 32. If i is 32, also sets clkdivider to 2, if
|
||||||
* [Mythen3] Options: 8, 16, 32
|
* 16, sets clkdivider to 1 \n [Mythen3] Options: 8, 16, 32 \n
|
||||||
* [Eiger] If i is 32, also sets clkdivider to 2, if 16, sets clkdivider to
|
* [Jungfrau][Gotthard][Ctb][Moench][Mythen3][Gotthard2] 16
|
||||||
* 1
|
|
||||||
*/
|
*/
|
||||||
void setDynamicRange(int value);
|
void setDynamicRange(int value);
|
||||||
|
|
||||||
@ -355,7 +354,7 @@ class Detector {
|
|||||||
*/
|
*/
|
||||||
Result<int> getTemperature(defs::dacIndex index, Positions pos = {}) const;
|
Result<int> getTemperature(defs::dacIndex index, Positions pos = {}) const;
|
||||||
|
|
||||||
/** gets list of dac indices for this detector */
|
/** gets list of dac enums for this detector */
|
||||||
std::vector<defs::dacIndex> getDacList() const;
|
std::vector<defs::dacIndex> getDacList() const;
|
||||||
|
|
||||||
Result<int> getDAC(defs::dacIndex index, bool mV, Positions pos = {}) const;
|
Result<int> getDAC(defs::dacIndex index, bool mV, Positions pos = {}) const;
|
||||||
@ -680,6 +679,7 @@ class Detector {
|
|||||||
|
|
||||||
Result<std::string> getFilePath(Positions pos = {}) const;
|
Result<std::string> getFilePath(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/** If path does not exist, it will try to create it */
|
||||||
void setFilePath(const std::string &fpath, Positions pos = {});
|
void setFilePath(const std::string &fpath, Positions pos = {});
|
||||||
|
|
||||||
Result<std::string> getFileNamePrefix(Positions pos = {}) const;
|
Result<std::string> getFileNamePrefix(Positions pos = {}) const;
|
||||||
@ -692,16 +692,17 @@ class Detector {
|
|||||||
|
|
||||||
Result<int64_t> getAcquisitionIndex(Positions pos = {}) const;
|
Result<int64_t> getAcquisitionIndex(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/** file or Acquisition index in receiver */
|
||||||
void setAcquisitionIndex(int64_t i, Positions pos = {});
|
void setAcquisitionIndex(int64_t i, Positions pos = {});
|
||||||
|
|
||||||
Result<bool> getFileWrite(Positions pos = {}) const;
|
Result<bool> getFileWrite(Positions pos = {}) const;
|
||||||
|
|
||||||
/** default writes */
|
/** default enabled */
|
||||||
void setFileWrite(bool value, Positions pos = {});
|
void setFileWrite(bool value, Positions pos = {});
|
||||||
|
|
||||||
Result<bool> getMasterFileWrite(Positions pos = {}) const;
|
Result<bool> getMasterFileWrite(Positions pos = {}) const;
|
||||||
|
|
||||||
/* default writes */
|
/* default enabled */
|
||||||
void setMasterFileWrite(bool value, Positions pos = {});
|
void setMasterFileWrite(bool value, Positions pos = {});
|
||||||
|
|
||||||
Result<bool> getFileOverWrite(Positions pos = {}) const;
|
Result<bool> getFileOverWrite(Positions pos = {}) const;
|
||||||
|
@ -472,7 +472,8 @@ std::string CmdProxy::DynamicRange(int action) {
|
|||||||
os << "[value]\n\tDynamic Range or number of bits per "
|
os << "[value]\n\tDynamic Range or number of bits per "
|
||||||
"pixel in detector.\n\t"
|
"pixel in detector.\n\t"
|
||||||
"[Eiger] Options: 4, 8, 16, 32\n\t"
|
"[Eiger] Options: 4, 8, 16, 32\n\t"
|
||||||
"[Mythen3] Options: 8, 16, 32"
|
"[Mythen3] Options: 8, 16, 32\n\t"
|
||||||
|
"[Jungfrau][Gotthard][Ctb][Moench][Mythen3][Gotthard2] 16"
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (action == defs::GET_ACTION) {
|
} else if (action == defs::GET_ACTION) {
|
||||||
if (!args.empty()) {
|
if (!args.empty()) {
|
||||||
|
@ -1805,15 +1805,17 @@ class CmdProxy {
|
|||||||
|
|
||||||
STRING_COMMAND(
|
STRING_COMMAND(
|
||||||
fpath, getFilePath, setFilePath,
|
fpath, getFilePath, setFilePath,
|
||||||
"[path]\n\tDirectory where output data files are written in receiver.");
|
"[path]\n\tDirectory where output data files are written in receiver. "
|
||||||
|
"If path does not exist, it will try to create it.");
|
||||||
|
|
||||||
STRING_COMMAND(fname, getFileNamePrefix, setFileNamePrefix,
|
STRING_COMMAND(fname, getFileNamePrefix, setFileNamePrefix,
|
||||||
"[path]\n\tFile name prefix for output data file. Default "
|
"[name]\n\tFile name prefix for output data file. Default "
|
||||||
"is run. File name: [file name prefix]_d[detector "
|
"is run. File name: [file name prefix]_d[detector "
|
||||||
"index]_f[sub file index]_[acquisition/file index].raw.");
|
"index]_f[sub file index]_[acquisition/file index].raw.");
|
||||||
|
|
||||||
INTEGER_COMMAND(findex, getAcquisitionIndex, setAcquisitionIndex,
|
INTEGER_COMMAND(findex, getAcquisitionIndex, setAcquisitionIndex,
|
||||||
StringTo<int64_t>, "[0, 1]\n\tFile or Acquisition index.");
|
StringTo<int64_t>,
|
||||||
|
"[n_value]\n\tFile or Acquisition index.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND(
|
||||||
fwrite, getFileWrite, setFileWrite, StringTo<int>,
|
fwrite, getFileWrite, setFileWrite, StringTo<int>,
|
||||||
|
Reference in New Issue
Block a user