How to jump in and out of different staircase loops?

539 views
Skip to first unread message

richf

unread,
Apr 5, 2013, 11:10:18 AM4/5/13
to psychop...@googlegroups.com
Is it possible to present 3 staircases during the same experiment where the selection is random, i.e. if i have three different staircases at 3 points in a temporal interval (early, middle and late), then i want to begin a trial with one particular staircase (e.g. middle), then after the first response, leap into another staircase (e.g.early), then another etc. So instead of going through each staircase in turn, i would like to randomly dip in and out of three independent stairs.

I've had a look through old posts and through python forums and such a thing seems impossible. At the simplest level i want to know how i can iterate through 3 different 'for' loops by randomly leaping through each 'for' loop until the cycle is over.

Can anyone help?

Cheers

Richard

Van Atta, Alexander B CTR USAF AFMC USAFSAM/FECO

unread,
Apr 5, 2013, 12:07:51 PM4/5/13
to psychop...@googlegroups.com
Richard,

I would think that it's possible. I just started to looking in to using
psychopy as the framework to re-implement some tests I currently have in
VB.Net and need this same functionality. I have a LMS cone contrast
threshold test that uses three Quest methods to converge to the
threshold for each of the LMS cones. I will let you know when I get it
working in psychopy.

Alexander B. Van Atta
USAFSAM/FECO
711th Human Performance Wing
2510 Fifth Street
Bldg 840, Rm E123.06
Wright-Patterson AFB, OH 45433-7901
Phone (937)-938-2691

CONFIDENTIALITY NOTICE: This message and any attachments or files
transmitted with it (collectively, the "Message") are intended only for
the
addressee and may contain information that is privileged, proprietary
and/or
prohibited from disclosure by law or contract. If you are not the
intended
recipient: (a) please do not read, copy or retransmit the Message; (b)
permanently delete and/or destroy all electronic and hard copies of the
Message; (c) notify us by return email; and (d) you are hereby notified
that
any dissemination, distribution or copying of the Message is strictly
prohibited.
--
You received this message because you are subscribed to the Google
Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msg/psychopy-users/-/wAoAaKt0taUJ.
For more options, visit https://groups.google.com/groups/opt_out.



Jonathan Peirce

unread,
Apr 5, 2013, 12:49:18 PM4/5/13
to psychop...@googlegroups.com
There's a class called MultiStairHandler for running independent
interleaved staircases.
http://www.psychopy.org/api/data.html#multistairhandler

Jon
> --
> You received this message because you are subscribed to the Google
> Groups "psychopy-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to psychopy-user...@googlegroups.com.
> To post to this group, send email to psychop...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/psychopy-users/-/wAoAaKt0taUJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk

This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

Richard fereday

unread,
Apr 5, 2013, 1:39:05 PM4/5/13
to psychop...@googlegroups.com
Thanks for replies. Will the multistairhandler return a different values for each staircase then? (i assume it would). Also, the main thing i wish to vary is the time when each staircase is presented. So, for example, 2 frames after a keypress will be one staircase, then the second will be 5 frames after a button press etc. So the parameters are the same for each staircase, only the onset time will change (one staircase for key press + 2frames, another for keypress + 5frames , and another for keypress + 10 frames). 

Is this possible with the multistairhandler?

Cheers
Richard


On Fri, Apr 5, 2013 at 5:49 PM, Jonathan Peirce <jonatha...@nottingham.ac.uk> wrote:
There's a class called MultiStairHandler for running independent interleaved staircases.
http://www.psychopy.org/api/data.html#multistairhandler

Jon


On 05/04/2013 16:10, richf wrote:
Is it possible to present 3 staircases during the same experiment where the selection is random, i.e. if i have three different staircases at 3 points in a temporal interval (early, middle and late), then i want to begin a trial with one particular staircase (e.g. middle), then after the first response, leap into another staircase (e.g.early), then another etc. So instead of going through each staircase in turn, i would like to randomly dip in and out of three independent stairs.

I've had a look through old posts and through python forums and such a thing seems impossible. At the simplest level i want to know how i can iterate through 3 different 'for' loops by randomly leaping through each 'for' loop until the cycle is over.

Can anyone help?

Cheers

Richard
--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-users+unsubscribe@googlegroups.com.

To post to this group, send email to psychopy-users@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/psychopy-users/-/wAoAaKt0taUJ.
For more options, visit https://groups.google.com/groups/opt_out.



--
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk

This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.


--
You received this message because you are subscribed to a topic in the Google Groups "psychopy-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/psychopy-users/qpgk3CHumLw/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to psychopy-users+unsubscribe@googlegroups.com.
To post to this group, send email to psychopy-users@googlegroups.com.

Jan

unread,
Apr 12, 2013, 5:52:56 PM4/12/13
to psychop...@googlegroups.com
Without using the multistairhandler, I use two interleaved staircases , like so:

    while len(staircaseList) > 0:
        shuffle(staircaseList)
        currentStaircase = staircase_list.pop()
        try:
            currentLevel=currentStaircase.next()
        except StopIteration:
            print "finished staircase"
        else:
            /do stuff/
            ## re-append staircase back to list
            staircaseList.append(currentStaircase)

So you keep randomly taking out a staircase from the list and putting it back, except you don't put them back if they're finished (and calling next() gives you a StopIteration exception). There's no particular reason I use pop() and append() instead of accessing the particular staircase by index.


On Friday, April 5, 2013 1:39:05 PM UTC-4, richf wrote:
Thanks for replies. Will the multistairhandler return a different values for each staircase then? (i assume it would). Also, the main thing i wish to vary is the time when each staircase is presented. So, for example, 2 frames after a keypress will be one staircase, then the second will be 5 frames after a button press etc. So the parameters are the same for each staircase, only the onset time will change (one staircase for key press + 2frames, another for keypress + 5frames , and another for keypress + 10 frames). 

Is this possible with the multistairhandler?

Cheers
Richard
On Fri, Apr 5, 2013 at 5:49 PM, Jonathan Peirce <jonatha...@nottingham.ac.uk> wrote:
There's a class called MultiStairHandler for running independent interleaved staircases.
http://www.psychopy.org/api/data.html#multistairhandler

Jon


On 05/04/2013 16:10, richf wrote:
Is it possible to present 3 staircases during the same experiment where the selection is random, i.e. if i have three different staircases at 3 points in a temporal interval (early, middle and late), then i want to begin a trial with one particular staircase (e.g. middle), then after the first response, leap into another staircase (e.g.early), then another etc. So instead of going through each staircase in turn, i would like to randomly dip in and out of three independent stairs.

I've had a look through old posts and through python forums and such a thing seems impossible. At the simplest level i want to know how i can iterate through 3 different 'for' loops by randomly leaping through each 'for' loop until the cycle is over.

Can anyone help?

Cheers

Richard
--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.

To post to this group, send email to psychop...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/psychopy-users/-/wAoAaKt0taUJ.
For more options, visit https://groups.google.com/groups/opt_out.



--
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk

This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.


--
You received this message because you are subscribed to a topic in the Google Groups "psychopy-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/psychopy-users/qpgk3CHumLw/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.

ShoinExp

unread,
Apr 17, 2013, 5:48:17 AM4/17/13
to psychop...@googlegroups.com
Hi,
    I don't suppose anyone has an example multistairhandler experiment (preferably in Builder) that they'd be willing to share?  I've got an upcoming experiment that will need interleaved staircases and I'm a bit vague on how that would work.  I always find that tinkering with an existing example is the best way to learn.
    Thanks,
    Mark

Richard fereday

unread,
Apr 18, 2013, 7:33:54 AM4/18/13
to psychop...@googlegroups.com
Jan,
Many thanks for your reply. Your code worked fine. It is so simple yet effective too! I very much appreciate you help, especially considering you are the ONLY person to reply.

Mark - afraid i did not use the MultiStairHandler so am unable to help. I think you're best off posting a new topic, as very few (if any) people will contribute to this post.

Best of luck

Richard.


To view this discussion on the web visit https://groups.google.com/d/msg/psychopy-users/-/ciuraLxGDHgJ.

Jonathan Peirce

unread,
Apr 18, 2013, 8:59:37 AM4/18/13
to psychop...@googlegroups.com
Richard,

You seem upset about the lack of support you've received? Do bear in mind that we're all quite busy people, writing this code, providing it free, wiring documentation and writing replies to your questions for nothing. None of us get paid for it, nor promoted for it. We do it out of good will and sometimes a question doesn't get answered because nobody had time at the moment you asked the question.

best wishes,
Jon

Michael MacAskill

unread,
Apr 18, 2013, 9:04:35 PM4/18/13
to psychop...@googlegroups.com

On 19 Apr, 2013, at 00:59, Jonathan Peirce <jonatha...@nottingham.ac.uk> wrote:

> You seem upset about the lack of support you've received? Do bear in mind that we're all quite busy people, writing this code, providing it free, wiring documentation and writing replies to your questions for nothing.

Two of those replies (from Alexander Van Atta and Jon Peirce) came within 2 hours of the original post from Richard on April 6th. Then Jan followed up to a further question from Richard, evidently with some consideration and regard as it came some days later, with a detailed answer that seemed to solve the problem. This prompted Mark to post a related request of his own, for an example multistairhandler experiment (sorry, I can't help with that myself, Mark).

This seems like a collaborative and well-working online community to me. As Jon notes, this is all voluntary, which will be improved by further contributions rather than criticism.

Welcome aboard Richard, I sincerely hope you'll soon be able to improve our collective responsiveness by contributing answers in turn, as you develop your own particular area of expertise with the software.

Regards,

Mike

Richard fereday

unread,
Apr 19, 2013, 6:34:01 AM4/19/13
to psychop...@googlegroups.com
Jon and Mike,

Many thanks for your replies. I do sincerely appreciate all replies, so please don't mistake my comments as feelings of anger or the like. It can be frustrating due to my inexperience - i still regard myself as a beginner so even obvious solutions often elude me. However, i have learned a great deal since September and this is largely due to responses on this forum. I am particularly grateful for all your posts on flicker fusion/LED's/monitor refresh rates - you have both helped very much in this area. If i come across areas that i may assist with then i will naturally respond. I hope i have learned enough to be able to do this soon.

Many thanks for support
Richard


ShoinExp

unread,
Apr 23, 2013, 2:34:28 AM4/23/13
to psychop...@googlegroups.com
Hi all,
    I have got my staircases working, mostly, in Builder (using the staircase demo that comes with Psychopy).  I nested one "staircase" loop inside one "interleaved staircase" loop.  I set all of the parameters in a .xlsx spreadsheet and set all the parameters in the inner "staircase" loop to variables specified in that spreadsheet.  Everything seems to be working fine.  I have 2 staircases that seem to be following the right number of reversals.... but they are not being interleaved, they are done sequentially.  I tried including a column in the spreadsheet for "method" and have it evaluate to random, but that didn't help.
      Any thoughts?
      Sorry for my continuing string of newbie questions,
      Thanks,
      Mark

Jonathan Peirce

unread,
Apr 29, 2013, 11:00:45 AM4/29/13
to psychop...@googlegroups.com
If you put a loop around another loop they don't get interleaved. The inner loop gets run to completion for each repeat of the outer loop. If you want interleaved staircases then just use one (interleaved-staircase) loop.
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.

To post to this group, send email to psychop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/psychopy-users/-/ylAm7OFLM-cJ.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Justyna Hobot

unread,
Jun 10, 2016, 10:24:23 AM6/10/16
to psychopy-users
Hi, I have 2 stimuli that are presented in random order and I use a simple staircase, created by inserting a loop (loopType=staircase, N up=1, N down=3,step sizes=[0.1,0.1,0.05,0.05,0.025], start value=0.075). I've noticed that I get different accuracy levels for different stimuli. I would like use the same staircase but separately for each of 2 stimuli. Do you have any suggestions how to code it?

jonathan.peirce from smtp.nottingham

unread,
Jun 15, 2016, 4:57:16 AM6/15/16
to psychop...@googlegroups.com
Are you sure you want to use the same staircase but for two stimuli? Not multiple interleaved staircases? Are you trying to measure the (different) thresholds to each stimulus?

Jon
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.

To post to this group, send email to psychop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/591d1b32-ba74-4aca-b6c0-479e39309d72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it. 

Please do not use, copy or disclose the information contained in this
message or in any attachment.  Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.

This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.
Reply all
Reply to author
Forward
0 new messages