currently, we’re using the trial handler and experiment handler like this: see code
Now we want to integrate the following: randomly sample from a uniform distribution 80 times, round the values between 0 and 1, with 0 and 1 representing signal presence or not. then traverse this list as the trials.
I can’t figure out how to do this using the trial handler. Can someone help? Thanks!
triallist = [
{"condition": "signal"},
{"condition": "noise"}
]
...
exphandler = data.ExperimentHandler(name=expName, extraInfo=expinfo, saveWideText=True, dataFileName=filename)
for b in blocks:
exphandler.addLoop(data.TrialHandler(triallist, nReps=ntrials, method='random', originPath=-1, extraInfo=expinfo) )
...
for trials in exphandler.loops:
# traverse through trials
for trial in trials:
...
So how about creating 80 rows in a spreadsheet with noise increasing from 0 to 1 in .025 increments (twice) and reading the spreadsheet into the trial handler in random order?
exactly, the list could be set up with the below code for example. But then how do I give it to the trial handler? Could you show me some example code?