I need to generate dots that move at a constant speed with 100% coherence (i.e., no noise dots) within a circular aperture. The dots should move until they hit the boundary of the circle and then wrap around to the other side. This can almost be accomplished with the visual.DotStim
class, except for the wraparound. Once the dots reach they boundary, they are initialized at a random location within the field. I think this random initialization (following a dot reaching the boundary) is why the dot density ends up non-uniform, as in the attached figure (e.g., the dots are moving upwards, so there are more ways that a dot could end up near the top of the field relative to the bottom of the field).
Is there a way to use the visual.DotStim
class so that the dots wrap? Here’s a snippet with how I am generating the dots. Let me know if an executable demo would help.
dots = visual.DotStim(
win=win,
units='deg',
fieldShape="circle",
dotSize=deg2pix(0.08, mon),
dotLife=-1,
coherence=1,
nDots=1000,
fieldSize=10,
speed=0.03)