import holocube.hc5 as hc5 from numpy import * from holocube.tools import mseq # horizon test expi = 1 # how long for the exp? numframes = 1023 # a set of points pts = hc5.stim.pts_class2(hc5.window, 4000, dims=[[-1.5,1.5],[-1.5,1.5],[-1.5,1.5]], color=.5, pt_size=3) # the motions wn1 = cumsum(mseq(2,10,0,1)) wn1_dir = array(sign(ediff1d(wn1,None, 0)), dtype='int') lights1 = mod(cumsum(wn1_dir),3) ampl = .02 # slip expnumspikes = array(hc5.schedulers.spikelist(expi, numframes)*255, dtype='int') hc5.scheduler.add_test(pts.on, 1, 0, hc5.window.set_bg, 0, 0, hc5.window.ref_light,-1, 0, pts.set_px, wn1*ampl, 1, hc5.window.ref_light,lights1, 1, hc5.window.ref_color_4,expnumspikes, 1,
# count exps expi = 1 bot_hor = hc5.stim.horizon_class(hc5.window, color=0) bar = hc5.stim.bar_class(hc5.window, height=2., color=(127, 127, 127)) numframes = 511 tri = arcsin(sin(linspace(0,4*pi,numframes))) tri_dir = array(sign(ediff1d(tri,None, 0)), dtype='int') tampl = .2 rampl = arcsin(tampl/(.5**(1/3.)))*180/pi #this makes the mean offset of rotation the same as translation in the frontal visual field trilights = mod(cumsum(tri_dir),3) # the motions wn1 = mseq(2,9,0,1) wn1_dir = array(sign(ediff1d(cumsum(wn1),None, 0)), dtype='int') wn1_lights = mod(cumsum(wn1_dir),3) rampl = 10. # first the wn bar for testing expnumspikes = array(hc5.schedulers.spikelist(expi, numframes)*255, dtype='int') hc5.scheduler.add_test(hc5.window.set_bg, 1, 0, hc5.window.set_far, 3, 0, bar.on, 1, 0, hc5.window.ref_light, -1, 0, hc5.window.ref_color_4, expnumspikes, 1, hc5.window.ref_light, wn1_lights, 1, bar.set_ry, wn1*rampl, 1,
expi = 1 bot_hor = hc5.stim.horizon_class(hc5.window, color=0) bar1 = hc5.stim.bar_class(hc5.window, height=2., color=(127, 127, 127)) bar2 = hc5.stim.bar_class(hc5.window, height=2., color=(127, 127, 127)) numframes = 511 tri = arcsin(sin(linspace(0,4*pi,numframes))) tri_dir = array(sign(ediff1d(tri,None, 0)), dtype='int') tampl = .2 rampl = arcsin(tampl/(.5**(1/3.)))*180/pi #this makes the mean offset of rotation the same as translation in the frontal visual field trilights = mod(cumsum(tri_dir),3) # the motions wn1 = mseq(2,9,0,1) wn1_dir = array(sign(ediff1d(cumsum(wn1),None, 0)), dtype='int') wn1_lights = mod(cumsum(wn1_dir),3) wn2 = mseq(2,9,0,2) rampl = 10. # first the wn bar for testing expnumspikes = array(hc5.schedulers.spikelist(expi, numframes)*255, dtype='int') hc5.scheduler.add_test(hc5.window.set_bg, 1, 0, hc5.window.set_far, 3, 0, bar1.on, 1, 0, bar2.on, 1, 0, bot_hor.set_elevation, 0, 0, bot_hor.set_rz, 25, 0, bot_hor.on, 1, 0,
import holocube.hc5 as hc5 from numpy import * from holocube.tools import mseq # horizon test expi = 1 # how long for the exp? numframes = 1023 # a set of points pts = hc5.stim.pts_class2(hc5.window, 4000, dims=[[-1.5,1.5],[-1.5,1.5],[-1.5,1.5]], color=.5, pt_size=3) # the motions wn1 = cumsum(mseq(2,10,0,1)) wn1_dir = array(sign(ediff1d(wn1,None, 0)), dtype='int') lights1 = mod(cumsum(wn1_dir),3) ampl = .02 # lift expnumspikes = array(hc5.schedulers.spikelist(expi, numframes)*255, dtype='int') hc5.scheduler.add_test(pts.on, 1, 0, hc5.window.set_bg, 0, 0, hc5.window.ref_light,-1, 0, pts.set_py, wn1*ampl, 1, hc5.window.ref_light,lights1, 1, hc5.window.ref_color_4,expnumspikes, 1,
# count exps test_num = 1 num_frames = 1400 num_pts = 10**4 num_exps = 1 # stimuli pts = hc.stim.Points(hc.window, num_pts, dims=[(-30,30),(-30,30),(-40,20)], color=1.0, pt_size=2) rbar = hc.stim.cbarr_class(hc.window, dist=1) ft = zeros([num_frames]) - .020 ss = zeros([num_frames]) ss[200:215] = -.1 ss[300:315] = .1 ss[-1023:] = mseq(2,10)*.1 frm = arange(num_frames) gain = 0.0017 hc.scheduler.add_exp() # add the tests starts = [[hc.window.set_far, 10], [hc.window.set_bg, [0,0,0,255]], [pts.on, True]] middles = [[hc.window.inc_thrust, ft], [hc.window.inc_slip, ss], [hc.window.save_png, frm]] ends = [[hc.window.reset_pos, True], [hc.window.reset_ori, True], [pts.on, False],
from holocube.tools import mseq # count exps expi = 1 bar = hc5.stim.bar_class(hc5.window, height=2., color=(127, 127, 127)) numframes = 255 tri = arcsin(sin(linspace(0,4*pi,numframes))) tri_dir = array(sign(ediff1d(tri,None, 0)), dtype='int') tampl = .2 rampl = arcsin(tampl/(.5**(1/3.)))*180/pi #this makes the mean offset of rotation the same as translation in the frontal visual field trilights = mod(cumsum(tri_dir),3) wn1 = mseq(2,8,0,1) wn1_dir = array(sign(ediff1d(cumsum(wn1),None, 0)), dtype='int') wn1_lights = mod(cumsum(wn1_dir),3) wn2 = mseq(2,8,0,2) wn2_dir = array(sign(ediff1d(cumsum(wn1),None, 0)), dtype='int') wn2_lights = mod(cumsum(wn1_dir),3) # h and v bar stimuli rampl = 20. h = (2.,1.,.5,.4,.2,.1) for a in arange(len(h)): expnumspikes = array(hc5.schedulers.spikelist(expi, numframes)*255, dtype='int') hc5.scheduler.add_test(hc5.window.set_bg, 1, 0, hc5.window.set_far, 3, 0,