MCPcopy Create free account
hub / github.com/LabPy/lantz / average_voltage

Method average_voltage

lantz/drivers/legacy/kentech/hri.py:171–184  ·  view source on GitHub ↗

Cathode potential bias with respect of MCP.

(self)

Source from the content-addressed store, hash-verified

169
170 @Feat(units='volt', limits=(-50, 50))
171 def average_voltage(self):
172 """Cathode potential bias with respect of MCP.
173 """
174 if self.revision >= 2.0:
175 ans = self.query_expect('AVE ?')
176 ans = between(ans, 'AVE ?', 'ok')
177 return float(ans.strip()) / 10.
178 else:
179 ans = self.query_expect('THRESHV @ .')[8:]
180 try:
181 pos = ans.index('.')
182 except ValueError:
183 raise InstrumentError('Unsupported operation.')
184 return float(ans[pos+2:pos+7]) / 10.
185
186 @average_voltage.setter
187 def average_voltage(self, value):

Callers

nothing calls this directly

Calls 4

query_expectMethod · 0.95
InstrumentErrorClass · 0.90
indexMethod · 0.80
betweenFunction · 0.70

Tested by

no test coverage detected