StimPy user guide

This guide is an overview and explains the important features.

Quickstart

Import StimPy:

import stimpy as sp

Instantiate a circle that moves in a rectangular trajectory:

circle = sp.visual.Circle(
    size=(2, 2), fillColor=(1, 1, 1),
    pos=sp.Animate([(-40, -20), (-40, 20), (40, 20), (40, -20)], [1, 1, 1, 1])
)

Add the circle to a scene:

scene = sp.Scene(color=(-1, -1, -1), units="deg")
scene.add(circle, begin=0, dur=4)

Create a window and display the stimulus:

win = sp.Window(distance=13, width=26)
trial = sp.Trial(scene, win=win)
trial.start()

(Optional) Save the stimulus as a movie:

trial.save_movie("example.mp4", fps=60)
../_images/example.gif