Write two different csv files for tasks running in parallel?

Hi Everyone,

I have two tasks running in parallel , a visual search and an auditory oddball task. Currently my csv file saves data from both tasks to the same file, the visual search is per row, with the auditory oddball task saved as a list per row. Is it possible to save two csv files, one for my visual search task, and one for my auditory oddball tasks, both in long format?

Kind regards,

Rob

You should be able to manually save custom csv files if you are running the experiment locally.

Hi Wakefield,

That sounds good.

I’ll do that when I do my in person testing! Are there any good forum links on examples? I did have a look but the last link I found was one from 2020 stating multiple CSV are not possible.

I was hoping to pilot my study online before, I’m assuming then you must have a singular csv from an online study.

Kind regards,

Rob

Here’s some code I’ve previously used to save a mouse tracking data file for each trial.

Begin Routine

matrix = ['participant', 'trial', 'rotation', 'ghost', 'startx', 'starty', 'targetx', 'targety', 'mousex', 'mousey', 'proximity']

Each Frame

# The mouse is really at
[realmousex,realmousey] = mouse.getPos()

# Calculate position for visible mouse
mousex = round(realmousex*cos(rotation)+realmousey*sin(rotation))
mousey = round(realmousey*cos(rotation)-realmousex*sin(rotation))

# Full tracking for each trial
matrix.append(expInfo['participant'])
matrix.append(trials.thisN)
matrix.append(rotation)
matrix.append(ghosttail)
matrix.append(startx)
matrix.append(starty)
matrix.append(viewx)
matrix.append(viewy)
matrix.append(mousex)
matrix.append(mousey)
matrix.append(proximity)

End Routine (Python only)

matrixsave = np.reshape(matrix,(-1,11))
mousedatafile = 'data\mousedata_'+expInfo['participant']+'_'+str(trials.thisN)+'.txt'
np.savetxt(mousedatafile, matrixsave,fmt='%s')

Hi Wakefield,

Thank you so much for this! Once I’ve piloted my experiment online, I’ll work on this to separate the data from the two tasks.

Hope you had a nice weekend.

Kind regards,

Rob