Пример #1
0
for ri in range(ntrials):
    # this run settings
    this_pos = pos[ri]
    this_rew = rewtype[ri]
    flip = {'start': nextonset, 'pos': this_pos, 'rew': this_rew}

    nextonset += dur['iti']

    # reward display setup
    rewon = nextonset
    ringimg[this_rew].draw()
    task.cue_fix.color = 'white'
    task.cue_fix.draw()
    task.win.callOnFlip(print_and_ttl, 'rew', this_pos, this_rew)
    # timing
    wait_until(rewon)
    flip['rew'] = task.win.flip()
    nextonset += dur['rew']

    # cue setup
    cueon = nextonset
    task.cue_fix.color = cue_fix_color
    task.win.callOnFlip(print_and_ttl, 'cue', this_pos, this_rew)
    task.cue_fix.draw()
    # timing
    wait_until(cueon)
    flip['cue'] = task.win.flip()
    nextonset += dur['cue']

    # show dot
    doton = nextonset
Пример #2
0
    task.eyetracking_newfile('%s' % eyetrackingfile)
    blockstarttime = task.wait_for_scanner(scannerTriggerKeys, run_getReadyMsg)
    logging.log(level=logging.INFO,
                msg='scanner trigger recieved at %d' % blockstarttime)

    # for all trials in this run
    for t in sacc_trials:
        if midwayPause and t['trial'] == int(sacc_trials.nTotal / 2.0):
            # setup pause screen
            task.textbox.pos = (-.2, -.1)
            task.textbox.text = 'Half way break!'
            task.iti_fix.draw()
            task.textbox.draw()
            # wait out the previous iti
            break_at = blockstarttime + t['cue']
            wait_until(break_at)
            # and pause
            task.send_code('end', None, None)

            # wait for a keep press then flip
            task.instruction_flip()

            # dispaly another screen before going into task
            task.textbox.pos = (-.2, 0)
            task.textbox.text = 'Ready!?'
            task.textbox.draw()
            task.instruction_flip()

            # compensate for break in future onsets
            task.addTime = core.getTime() - break_at
            task.send_code('start', None, None)
Пример #3
0
    i = ridx[ri]
    p = pos_rep[i] * winwidth

    fixttl = 0
    posttl = pos_rep[i]

    # draw cricle
    task.crcl.pos = (p, 0)
    task.crcl.draw()
    task.win.callOnFlip(print_and_ttl,
                        "p at %.02fx (%.02fpx)" % (pos_rep[i], p), posttl)
    ft = task.win.flip()
    # save dot flip to info
    info[2 * (i - 1)] = [ft - starttime, pos_rep[i]]
    # wait a bit
    wait_until(ft + dotdur)

    # for testing
    # event.waitKeys()

    # draw cross
    task.iti_fix.draw()
    task.win.callOnFlip(print_and_ttl, "back to fix", fixttl)
    ft = task.win.flip()
    # update list
    info[2 * (i - 1) + 1] = [ft - starttime, 0.0]
    # wait a bit
    wait_until(ft + fixdur)

# all done, wrap up
task.send_code('end', None, None)