0

I am attempting to gamma correct my screen and do a chromatic calibration using a PR650, Psychopy (latest version) and Mac OSx with Mavericks.

When running the gamma calibration without the PR650 attached I don't get any errors, but with it attached the psychopy freezes after one measurement and the below error is given. I am new to psychopy and so any help would be great!

Traceback (most recent call last):
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/monitors/MonitorCenter.py", line 729, in onCalibGammaBtn
    stimSize=stimSize, monitor=self.currentMon)
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/monitors/calibTools.py", line 851, in getLumSeries
actualLum = photometer.getLum()
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/hardware/pr.py", line 156, in getLum
    self.measure()
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/hardware/pr.py", line 443, in measure
    self.lastColorTemp = int(self.getLastColorTemp()[3])
ValueError: invalid literal for int() with base 10: '003208.'
4

1 回答 1

0

那很奇怪。该错误实际上是由 PsychoPy 试图解释字符串“003208”这一事实引起的。作为整数,Python 被 '.' 混淆了。在字符串中。

当 PR650 被发送命令以报告开尔文温度时,该字符串来自串行端口。我不确定为什么这最近成为一个问题(也许您的 PR650 将色温返回为小数,而我的返回整数?

无论如何,解决方法是编辑文件 /Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/hardware/pr.py 以便第 443 行显示:

self.lastColorTemp = int(float(self.getLastColorTemp()[3]))

这样字符串'003208'。首先转换为浮点数 3208.0,然后转换为整数 3208 (kelvin)

于 2014-08-14T09:59:30.553 回答