Thaiz / psychopy

Automatically exported from code.google.com/p/psychopy
0 stars 0 forks source link

QuestHandler Truncation Error #75

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Attempting to learn how to use data.QuestHandler.  Tutorial does not run, 
attempted:

from psychopy import core, visual, gui, data, misc, event
import time, numpy, random

mywin = visual.Window([1920,1080], fullscr=True,monitor="testMonitor", 
units="deg") 

stimulus = visual.RadialStim(win=mywin, tex='sinXsin', size=1, pos=[0,0], 
units='deg')

staircase=data.QuestHandler(0,2,pThreshold=0.63,gamma=0.01,nTrials=20,minVal=0,m
axVal=4)

for eachTrial in staircase:
    targetSide=random.choice([-1,1])
    stimulus.setPos([10*targetSide, 0])
    stimulus.draw()
    mywin.flip()
    thisResp=None
    while thisResp==None:
        allKeys=event.waitKeys()
        for thisKey in allKeys:
                if thisKey=='left':
                    if targetSide==-1: thisResp=1 
                    else: thisResp = 2
                elif thisKey=='right':
                        if targetSide==-1: thisResp = 1 
                        else: thisResp = 2 
                elif thisKey in ['q', 'escape']:
                        core.quit() 
        event.clearEvents() 
        staircase.addData(thisResp)
    core.wait(0.5)

What is the expected output? What do you see instead?
Aiming for correct response reducing intensity of image or decreasing contrast. 
 Produces "raise ValueError('truncation error') on line 373 of 
data.QuestHandler.

What version of the product are you using? On what operating system?
PsychoPy 1.71.01-py2.7 stand-alone app on Windows 7 Ultimate Service Pack 1.

Please provide any additional information below.
I am ultimately trying to learn how to use the QuestHandler.  I'm still too new 
to Python to try to tweak the program itself, or know exactly what I'm doing 
wrong as I've not used the Quest algorithm before.  Any assistance would be 
appreciated.

Original issue reported on code.google.com by soka...@gmail.com on 4 Jan 2012 at 5:10

GoogleCodeExporter commented 8 years ago
I get the same error. Not sure why

Original comment by azra...@gmail.com on 28 Oct 2014 at 3:36

GoogleCodeExporter commented 8 years ago
That was annoying -- it looks like your starting value has to be >0 if your 
step type is 'db' or 'log' ('log' is the default).

Original comment by azra...@gmail.com on 28 Oct 2014 at 4:28