From fe4ed30d1c8ac82e98d47df4a3f681cd63dad5e2 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Sat, 23 Apr 2016 15:07:35 -0700 Subject: [PATCH] getuserdark, getfactorydark --- dump.py | 2 ++ ilt1000.py | 19 +++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/dump.py b/dump.py index 068595e..0638e04 100755 --- a/dump.py +++ b/dump.py @@ -44,6 +44,8 @@ LINES = [ ('Irradiance', ilt.GetIrradiance, ''), ('Clock frequency', ilt.GetClockFrequencyHz, '㎐'), ('Feedback resistance', ilt.GetFeedbackResistanceOhm, 'Ω'), + ('Factory dark', ilt.GetFactoryDarkVoltages, 'V'), + ('User dark', ilt.GetUserDarkVoltages, 'V'), ] diff --git a/ilt1000.py b/ilt1000.py index e7891b3..7d4b06c 100755 --- a/ilt1000.py +++ b/ilt1000.py @@ -47,7 +47,6 @@ class CommandError(Error): # setcurrentloop # setuserdark -# getuserdark # setfactorydark # startlogdata @@ -257,18 +256,18 @@ class ILT1000(object): self._SendCommandOrDie(self._DARK_MODE_COMMANDS[mode]) def GetFactoryDarkVoltages(self): - # SPEC ERROR - # Actual return value sample: - # R1 12149 9733 9251 R2 12476 10080 9604 R3 13940 11894 11435 ret = self._SendCommand('getfactorydark') - return [float(x) / 1000000 for x in ret.split()] + values = ret.split(' ') + return [ + [float(values[4 * r + i + 1]) / 1000000 for i in range(3)] + for r in range(3)] def GetUserDarkVoltages(self): - # SPEC ERROR - # Actual return value sample: - # R1 12149 9733 9251 R2 12476 10080 9604 R3 13940 11894 11435 - ret = self._SendCommand('getfactorydark') - return [float(x) / 1000000 for x in ret.split()] + ret = self._SendCommand('getuserdark') + values = ret.split(' ') + return [ + [float(values[4 * r + i + 1]) / 1000000 for i in range(3)] + for r in range(3)] def GetClockFrequencyHz(self): ret = self._SendCommand('getclockfreq')