Search code examples
psychopy

ElementArrayStim and advice on wrapping a background


visual.ElementArrayStim(win, units=None, fieldPos=(0.0, 0.0), fieldSize=(3000.0, 1000.0), fieldShape='sqr', nElements=100, sizes=5.0, xys=None, rgbs=None, colors=(1.0, 1.0, 1.0), colorSpace='rgb', opacities=1.0, depths=0, fieldDepth=0, oris=0, sfs=1.0, contrs=1, phases=0, elementTex='none', elementMask='circle', texRes=48, interpolate=True, name=None, autoLog=None, maskParams=None)

I tried to google a guide for ElementArrayStim but the one provided by the psychopy website did not elaborate on the functions available for this. May I ask what the bolded xys and sfs in this command refers to?

Also, how do you wrap a stimulus presentation window? For instance, in my case, a cluster of random dots derived from ElementArrayStim spreaded across the stimulus window with the cluster centred on (0,0) moving at x=5. Eventually, each of these dots will hit the window's right boundary. How do I make these dots reappear on the left window boundary in a smooth transition?


Solution

  • Below are comments from the source code. Not sure why they aren’t appearing in the online documentation:

    xys: The xy positions of the elements centres, relative to the field centre. Values should be:

    • None
    • an array/list of Nx2 coordinates.

    If value is None then the xy positions will be generated automatically, based on the fieldSize and fieldPos. In this case opacity will also be overridden by this function (it is used to make elements outside the field invisible).

    sfs: The spatial frequency for each element. Should either be:

    • a single value
    • an Nx1 array/list
    • an Nx2 array/list (spatial frequency of the element in X and Y).

    If the units for the stimulus are 'pix' or 'norm' then the units of sf are cycles per stimulus width. For units of 'deg' or 'cm' the units are c/cm or c/deg respectively.