Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Monokeros deAstris
Nov 7, 2006
which means Magical Space Unicorn

I'm not sure if this deserves its own thread, but I'm not actually doing any work on this yet, so I thought I would post here to check feasibility. Any feedback people have for whether this would/should work, things to keep in mind, different ways to do things, ..., would be appreciated. If this goes anywhere, I'll start a thread about it.

Ok. I'm not really a programmer, I'm a cognitive psychologist who does some coding. At the moment, I primarily use Matlab with Psychtoolbox to deploy behavioral experiments, and Matlab proper for writing neural network simulations. I'm interested in moving to Python for both of these purposes, probably using PyGame for deploying experiments and SciPy for vectorized computations for the modeling. I'd also like to be able to run statistical analyses in Python -- basically be able to never leave Python for the entire course of an entire study.

Let me explain what is required in a typical experiment. Let's say I'm writing a simple Stroop task. I need to be able to do the following:
  • Display an instruction screen, then move on with a keypress
  • Throw a word (or several) up on the screen, possibly in color, at some very large size
  • Precisely record time elapsed since stimulus onset (time since word hits the screen)
  • Record keypresses from the user, along with reaction time (see above)
  • Spit resulting data into a CSV file for later analysis

If I were doing something like an artificial language learning task, I might not care about reaction time, but would want to be able to play sounds, and so forth. None of this is very complicated, and it seems like a library optimized for writing games should be able to handle everything I need with ease.

I guess my question is, how much work would it be to write something like the above from scratch, or at best, from snippets of reused code, using PyGame? I'm hoping that the answer is "not much", once the logic of the experiment has been determined, but I want to verify this with people who know the language and the libraries before I start sinking time into this project.

My ulterior motive in all of this is to implement this all as a project for the One Laptop Per Child program. Given a few sample experiment programs and some tutorials, I really think that kids as young as 10 or 12 could learn to conduct some fairly sophisticated cognitive psychology. Plus, how interesting would it be to learn about psychology by actually running the experiments on your friends and classmates, crunching the numbers yourself, and seeing that the results are valid? I really believe that a hands-on understanding of the human mind would be enormously valuable for more people to have, and a constructivist learning tool like the OLPC XO provides a means for even younger children to grasp some very subtle concepts and results. Since Python is the language of choice for the project, that's the language I have to learn -- though of course I've heard good things about it anyway.

So. Thoughts? Plausible? Waste of time?

Monokeros deAstris fucked around with this message at 06:14 on Nov 20, 2007

Adbot
ADBOT LOVES YOU

Monokeros deAstris
Nov 7, 2006
which means Magical Space Unicorn

Ugg boots posted:

I just got done with a project in PyGame, and this sounds really, really easy. Saving the data and dumping to CSV will be super-trivial in Python, and PyGame makes throwing things on the screen easy. Sounds are pretty easy, too. I don't know how high of a resolution timer Python has, though, if you want to be super awesomely precise (as much as the processor/OS/whatever can handle) in your timing measurements.

For my own experiments, I want to be as precise as possible, so I'll probably keep using Psychtoolbox. But as long as the timing errors don't correlate with any of the variables of interest, all they'll do is add noise to the outcome, which is a problem, but not a huge one. Thus, I think it'll probably be fine for educational purposes. Thanks, this is encouraging.

  • Locked thread