Re: Overwriting printings [message #20438] |
Fri, 23 June 2000 00:00 |
Paul van Delst
Messages: 364 Registered: March 1997
|
Senior Member |
|
|
Pavel Romashkin wrote:
>
> Paul van Delst wrote:
>
> snip-snip
>
>> I absolutely agree with the original posters comment about code
>> slow-down vs. psychological benefits. It's like getting stuck in the
>> subway with no info about why..... yoicks.
>
> A lot more productive would be to put in an audible end-of-loop alert,
> switch to your web browser and, while IDL is crunching, to check for the
> best and latest on http://www.dfanning.com :-)
No no no... while IDL is crunching on my prototype software, I would be implementing the same in Fortran-90 for production run where
speed is really needed. :o)
I've shifted from "Use IDL for everything" mode to "Use IDL for testing mode" simply because everyone here has a Fortran compiler,
but very few people have an IDL license. I have found my IDL experience very handy now that Fortran-90/95 has array based syntax and
luckily there is enough highly robust freeware out there that replicates most of the IDL mathematical functionality. For displaying
the results, though, IDL can't be beat.
paulv
--
Paul van Delst Ph: (301) 763-8000 x7274
CIMSS @ NOAA/NCEP Fax: (301) 763-8545
Rm.202, 5200 Auth Rd. Email: pvandelst@ncep.noaa.gov
Camp Springs MD 20746
|
|
|
Re: Overwriting printings [message #20449 is a reply to message #20438] |
Thu, 22 June 2000 00:00  |
promashkin
Messages: 169 Registered: December 1999
|
Senior Member |
|
|
Paul van Delst wrote:
snip-snip
> I absolutely agree with the original posters comment about code
> slow-down vs. psychological benefits. It's like getting stuck in the
> subway with no info about why..... yoicks.
A lot more productive would be to put in an audible end-of-loop alert,
switch to your web browser and, while IDL is crunching, to check for the
best and latest on http://www.dfanning.com :-)
Cheers,
Pavel
|
|
|
Re: Overwriting printings [message #20451 is a reply to message #20449] |
Thu, 22 June 2000 00:00  |
John-David T. Smith
Messages: 384 Registered: January 2000
|
Senior Member |
|
|
Simon de Vet wrote:
>
> I've been playing around with a montecarlo simulation. Since it is very
> boring to watch the program to do nothing while calculating 1000000
> iterations, I have it outputing the current result, which I can watch
> stream by. While the program is probably slowed down by this output, the
> psychological effect more than compensates for it.
>
> However, with 1000000 iterations come 1000000 lines of screen output,
> which is a little ackward.
>
> Is there a way to get IDL to overwrite the previous print output, rather
> than starting a new line? I'm running IDL in Linux..
>
> Simon
There's always David's even fancier progress meter at
http://www.dfanning.com/programs/showprogress__define.pro, or the similar one I
posted a year ago. Both are pretty easy to use. I think an update every 10s
or so should appease most psyche's.
JD
|
|
|
Re: Overwriting printings [message #20456 is a reply to message #20449] |
Thu, 22 June 2000 00:00  |
Paul van Delst
Messages: 364 Registered: March 1997
|
Senior Member |
|
|
dominik@astro.uva.nl wrote:
>
> In article <395214A5.BA0D21B1@mathstat.dal.ca>,
> simon@mathstat.dal.ca wrote:
>
>> Is there a way to get IDL to overwrite the previous print output,
>> ratherthan starting a new line? I'm running IDL in Linux..
>
> the `$' format character disables the automatic newline,
> the character control-k kill the current output line.
> Use something like this:
>
> for i=1,1000 do begin
> print,format='(A,A,$)',string(13b),string(i)
> endfor
> print,'' ; terminate the current line
>
I do this sort of thing by printing out the backspace character (8B)
however many times I need to overwrite the last output. This way, my
line title doesn't get smushed. In the following snippet, the XXXX, XXX
of XXX... gets overwritten with the current numbers, but the line title
"Transforming....blah blah" does not:
bksp = MAKE_ARRAY( 20, VALUE = 8B )
PRINT, FORMAT = '( /5x, "Transforming IFG for AIRS channel:", /, "XXXX,
XXX of XXX....", $ )'
begin_channel = 0
end_channel = n_channels - 1
FOR i = begin_channel, end_channel DO BEGIN
PRINT, FORMAT = '( a, i4, ", ", i3, " of ", i3, "....", $ )', $
STRING( bksp ), analysis[ i ].channel, i + 1,
n_channels
(I'm sure your news reader will truncate the lines at 80 cols, dammit)
I absolutely agree with the original posters comment about code
slow-down vs. psychological benefits. It's like getting stuck in the
subway with no info about why..... yoicks.
paulv
--
Paul van Delst Ph: (301) 763-8000 x7274
CIMSS @ NOAA/NCEP Fax: (301) 763-8545
Rm.202, 5200 Auth Rd. Email: pvandelst@ncep.noaa.gov
Camp Springs MD 20746
|
|
|
Re: Overwriting printings [message #20458 is a reply to message #20449] |
Thu, 22 June 2000 00:00  |
Simon de Vet
Messages: 36 Registered: May 2000
|
Member |
|
|
Craig Markwardt wrote:
>
> Since you are on Unix, you can try STATUSLINE, available from my web
> page. It does exactly this sort of thing.
>
> http://cow.physics.wisc.edu/~craigm/idl/idl.html (under Misc)
>
> If the output truly dominates the processing speed then of course you
> could only output every 10th or 100th iteration. You're still not
> missing much if there are 10^6 iterations.
Output certainly does dominate the speed.
At 10000 iterations, printing every line takes 2m49s, overwriting each line
takes 1m05s, and printing nothing takes 0m20s.
I think your script will be worth looking at :)
Simon
|
|
|
Re: Overwriting printings [message #20460 is a reply to message #20449] |
Thu, 22 June 2000 00:00  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
Simon de Vet <simon@mathstat.dal.ca> writes:
> I've been playing around with a montecarlo simulation. Since it is very
> boring to watch the program to do nothing while calculating 1000000
> iterations, I have it outputing the current result, which I can watch
> stream by. While the program is probably slowed down by this output, the
> psychological effect more than compensates for it.
>
> However, with 1000000 iterations come 1000000 lines of screen output,
> which is a little ackward.
>
> Is there a way to get IDL to overwrite the previous print output, rather
> than starting a new line? I'm running IDL in Linux..
Since you are on Unix, you can try STATUSLINE, available from my web
page. It does exactly this sort of thing.
http://cow.physics.wisc.edu/~craigm/idl/idl.html (under Misc)
If the output truly dominates the processing speed then of course you
could only output every 10th or 100th iteration. You're still not
missing much if there are 10^6 iterations.
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
Re: Overwriting printings [message #20461 is a reply to message #20449] |
Thu, 22 June 2000 00:00  |
dominik
Messages: 47 Registered: June 2000
|
Member |
|
|
In article <395214A5.BA0D21B1@mathstat.dal.ca>,
simon@mathstat.dal.ca wrote:
> Is there a way to get IDL to overwrite the previous print output,
> ratherthan starting a new line? I'm running IDL in Linux..
the `$' format character disables the automatic newline,
the character control-k kill the current output line.
Use something like this:
for i=1,1000 do begin
print,format='(A,A,$)',string(13b),string(i)
endfor
print,'' ; terminate the current line
-Carsten
Sent via Deja.com http://www.deja.com/
Before you buy.
|
|
|