 # Creating noise in radial motion stimulus

Hello,
I’m new to Psychopy and I’m trying to convey radial and translational motion using an RDK.
I have two questions:

1. Can I modulate the motion coherence of an RDK using ElementArrayStim? I know the dotStim has a coherence and noiseDots (direction, walk etc.) parameters but I wasn’t able to create radial motion using DotStim. If there’s some way to do this, any pointers would be greatly appreciated!

2. Can I also modulate the motion of an RDK using ElementArrayStim to create translational motion or is it better to use dotStim for translational and Element ArrayStim for radial motion? Again, any info on this would very helpful

M

For ElementArrayStim there’s no coherence calculatton done for you in any coordinate system. You calculate the XY values yourself and supply them on each frame. There’s a coder demo showing a dynamic semi-coherent oriented pattern that should give you some ideas.

Hello MMBB,

You can produce radial motion by specifying the initial XY positions of your elements as rows in a two column numpy array and taking its dot product with a rotation matrix. You just need to change the theta every frame to achieve the angular velocity you want.

``````theta = numpy.radians(deg) # could use radians if you like
rot_mat = numpy.matrix([[numpy.cos(theta), -numpy.sin(theta)], [numpy.sin(theta),  numpy.cos(theta)]])
element_array.xys = numpy.dot(init_points, rot_mat)
``````

You can do all sorts of transformations to your points in a similar manner.

Hi MDC,
Thanks so much for that, I was getting totally stuck!
Cheers,
M

next step is to click the “solved” button @MMBB, was your problem solved? If yes, please tick solved. If not, it would be nice with a follow-up on what happened, so we can solve this.

Hi,

I also would like to create radial motion (clockwise / CCW, not expanding / contracting). Where do I add this piece of code to the script? In the visual.DotStim block or later in the updates section.

This is my first time trying to use psychopy for an experiment, so thanks in advance for any help you can provide!

Regards,
Wendy