Longden, Kit
2011-09-14 11:00:50 UTC
Hi,
I'd like to save the frame times during my code. Would anyone be so kind as to show me the lines I should add to the grating.py demo code (below) to make this happen? I'd be very grateful.
Apologies for such an obvious question, it remains unclear to me after checking the archives and documentation, no doubt because of my lack of Python.
Many thanks,
Kit
****************************
Kit Longden
The Krapp Lab: Insect vision, sensory
integration, motor control and robotics.
Contact: kit-AQ/***@public.gmane.org, +44 20759 40717
http://www3.imperial.ac.uk/people/c.longden <http://www3.imperial.ac.uk/people/c.longden>
Address: Dr Kit Longden, Department of Bioengineering,
Imperial College London, South Kensington campus, London, SW7 2AZ, U.K.
****************************
#!/usr/bin/env python
"""Sinusoidal grating calculated in realtime."""
############################
# Import various modules #
############################
import VisionEgg
VisionEgg.start_default_logging(); VisionEgg.watch_exceptions()
from VisionEgg.Core import *
from VisionEgg.FlowControl import Presentation
from VisionEgg.Gratings import *
#####################################
# Initialize OpenGL window/screen #
#####################################
screen = get_default_screen()
######################################
# Create sinusoidal grating object #
######################################
stimulus = SinGrating2D(position = ( screen.size[0]/2.0, screen.size[1]/2.0 ),
anchor = 'center',
size = ( 300.0 , 300.0 ),
spatial_freq = 10.0 / screen.size[0], # units of cycles/pixel
temporal_freq_hz = 1.0,
orientation = 45.0 )
###############################################################
# Create viewport - intermediary between stimuli and screen #
###############################################################
viewport = Viewport( screen=screen, stimuli=[stimulus] )
########################################
# Create presentation object and go! #
########################################
p = Presentation(go_duration=(5.0,'seconds'),viewports=[viewport])
p.go()=====================================The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html
I'd like to save the frame times during my code. Would anyone be so kind as to show me the lines I should add to the grating.py demo code (below) to make this happen? I'd be very grateful.
Apologies for such an obvious question, it remains unclear to me after checking the archives and documentation, no doubt because of my lack of Python.
Many thanks,
Kit
****************************
Kit Longden
The Krapp Lab: Insect vision, sensory
integration, motor control and robotics.
Contact: kit-AQ/***@public.gmane.org, +44 20759 40717
http://www3.imperial.ac.uk/people/c.longden <http://www3.imperial.ac.uk/people/c.longden>
Address: Dr Kit Longden, Department of Bioengineering,
Imperial College London, South Kensington campus, London, SW7 2AZ, U.K.
****************************
#!/usr/bin/env python
"""Sinusoidal grating calculated in realtime."""
############################
# Import various modules #
############################
import VisionEgg
VisionEgg.start_default_logging(); VisionEgg.watch_exceptions()
from VisionEgg.Core import *
from VisionEgg.FlowControl import Presentation
from VisionEgg.Gratings import *
#####################################
# Initialize OpenGL window/screen #
#####################################
screen = get_default_screen()
######################################
# Create sinusoidal grating object #
######################################
stimulus = SinGrating2D(position = ( screen.size[0]/2.0, screen.size[1]/2.0 ),
anchor = 'center',
size = ( 300.0 , 300.0 ),
spatial_freq = 10.0 / screen.size[0], # units of cycles/pixel
temporal_freq_hz = 1.0,
orientation = 45.0 )
###############################################################
# Create viewport - intermediary between stimuli and screen #
###############################################################
viewport = Viewport( screen=screen, stimuli=[stimulus] )
########################################
# Create presentation object and go! #
########################################
p = Presentation(go_duration=(5.0,'seconds'),viewports=[viewport])
p.go()=====================================The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html