controling Looping
Eric Altshuler
ela at COLA.IGES.ORG
Tue Sep 22 13:33:00 EDT 2009
Kim WonMoo's method sets up a script loop that does nothing except use CPU cycles to cause a delay between frames in the animation. This is a brute force method that may result in drastically different delay lengths depending on machine speed and CPU usage by other processes at any given time. A better way to introduce a delay between frames is to use double buffer mode and the Unix 'sleep' command, e.g.
'set dbuff on'
it=1
while (it<=20)
'set t 'it
'd slp'
'swap'
'!sleep 1'
it=it+1
endwhile
The only problem here is that the minimum sleep time is 1 second, which is rather long for an animation. On some Linux machines there is a 'usleep' command that allows the user to specify the delay time in microseconds, e.g.
'!usleep 500000'
to sleep for 0.5 second. If your system has the usleep command, use it instead of sleep so you can specify a delay of less than 1 second. Using double buffer mode along with the sleep or usleep command produces a nice animation without having to use the mouse or keyboard to advance the frames.
Best regards,
Eric L. Altshuler
Assistant Research Scientist
Center for Ocean-Land-Atmosphere Studies
4041 Powder Mill Road, Suite 302
Calverton, MD 20705-3106
USA
E-mail: ela at cola.iges.org
Phone: (301) 902-1257
Fax: (301) 595-9793
----- Original Message -----
From: "Yan Libin" <zjuyanlibin at 163.COM>
To: GRADSUSR at LIST.CINECA.IT
Sent: Tuesday, September 22, 2009 5:02:26 AM GMT -05:00 US/Canada Eastern
Subject: Re: Re: controling Looping

idummy??? what is this variable?
2009-09-22
Yan Libin
åä»¶äººï¼ Kim WonMoo
åéæ¶é´ï¼ 2009-09-22 16:48:49
æ¶ä»¶äººï¼ GRADSUSR
æ éï¼
主é¢ï¼ Re: controling Looping
Or, just insert dummy loop inside,
it=1
while (it<=20)
'set t 'it
'd slp'
idummy=1
while (idummy<=100000)
idummy=idummy+1
endwhile
it=it+1
endwhile
to avoid keep pressing key-board.
Good luck,
Kim,WonMoo
From: Yan Libin
Sent: Tuesday, September 22, 2009 5:40 PM
To: GRADSUSR at LIST.CINECA.IT
Subject: Re: controling Looping
it=1
while(it<=20)
set t 'it'
d slp
pull down
c
endwhile
2009-09-22
Yan Libin
åä»¶äººï¼ hiren dave
åéæ¶é´ï¼ 2009-09-22 16:29:43
æ¶ä»¶äººï¼ GRADSUSR
æ éï¼
主é¢ï¼ controling Looping
Dear,
Friends
I have netCDf file containing the daily average value of a parameter. I am using following script to view the plots of 5 to 10 days in looping. But the speed of looping is so fast and it is difficult to see any pattern in the output. I want to control the speed of this looping. Is there any way?
'set t 1 20'
'd slp'
Hiren Dave
JRF
Dept. of Physics, Electronics & Space Science
University School of Sciences
Gujarat University
Navrangpura
Ahmedabad-09
Gujarat-India
M:- 9426976862
More information about the gradsusr
mailing list