123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- pro makemovie_pinedobj
- default, filename, "$HOME/prog/objsim/data/movies/pinedobjmovie.idlmov"
- retw=50
- reth=1
- modw=50
- modh=1
- a = obj_new('movieinput', /create, filename=filename)
- a->generatefile, owarray=[retw,modw], oharray=[reth,modh], nfilters=2
- pic = fltarr(retw,reth)
- pic2 = fltarr(modw,modh)
- nretneurons=retw*reth
- nmodneurons=modw*modh
- nkombi=nretneurons*nmodneurons
- g=indgen(5)-2
- b=fltarr(5)
- for i=0,4 do begin
- b(i)=exp(-g(i)*g(i)/5.)
- endfor
- h=indgen(5)-2
- c=fltarr(5)
- for i=0,4 do begin
- c(i)=exp(-h(i)*h(i)/5.)
- endfor
-
- objposition=intarr(3)
- objposition(0)=-15
- objposition(1)=0
- objposition(2)=15
- modposition=intarr(9)
- retposition=intarr(9)
- ;for i=0,8 do begin
- ; modposition(i)=5*(i+1)-25
- ; retposition(i)=5*(i+1)-25
- ;endfor
- counter=0
- for objpos=0,2 do begin
- for modpos=0,45 do begin
- for retpos=0,45 do begin
- pic(*)=0
- pic2(*)=0
- if (modpos-retpos eq objposition(objpos)) then begin
- for j=0,4 do begin
- pic(retpos+j)=1*b(j)
- endfor
- for j=0,4 do begin
- pic2(objposition(objpos)+retpos+j)=1*b(j)
- endfor
- a->WriteFrame, pic
- a->WriteFrame, pic2
- counter=counter+1
- endif else begin
- pic(retpos)=0
- pic2(modpos)=0
- endelse
- tvscl, rebin(pic, 10*retw, reth*10, /sample)
- endfor
- endfor
- endfor
- infos=intarr(counter,2)
- counter=0
- for objpos=0,2 do begin
- for modpos=0,45 do begin
- for retpos=0,45 do begin
- pic(*)=0
- pic2(*)=0
- if (modpos-retpos eq objposition(objpos)) then begin
- for j=0,4 do begin
- pic(retpos+j)=1*b(j)
- endfor
- for j=0,4 do begin
- pic2(objposition(objpos)+retpos+j)=1*b(j)
- endfor
- infos(counter,0)=retpos
- infos(counter,1)=modpos
- counter=counter+1
- endif else begin
- pic(retpos)=0
- pic2(modpos)=0
- endelse
- tvscl, rebin(pic, 10*retw, reth*10, /sample)
- endfor
- endfor
- endfor
- uwriteu, filename+'.info',infos
- print, counter
- ;for u=0,nmodneurons-5 do begin
- ; for i=0, nretneurons-5 do begin
- ; frame = pic
- ; frame2 = pic2
- ; for j=0,4 do begin
- ; frame(i+j)=1*b(j)
- ; frame2(u+j)=1*b(j)
- ; ;;frame2(i+j)=1+b(j)
- ; endfor
- ; ;frame2(u)=1
- ; ;wait, 0.15
- ; tvscl, rebin(frame, 10*retw, reth*10, /sample)
- ; ;tvscl, 0, 0.3, /norm, rebin(frame2, 10*modw, modh*10, /sample)
- ; a->WriteFrame, frame
- ; a->WriteFrame, frame2
- ; endfor
- ;endfor
- ;endfor
- obj_destroy, a
- end
|