Re: continuous update of plot [message #9128 is a reply to message #9117] |
Mon, 02 June 1997 00:00   |
Tim Patterson
Messages: 65 Registered: October 1995
|
Member |
|
|
A quick test is to use the spawn command to list the file, =
save the returned data, and then next time around the loop, you can do
the same and see if the returned string has changed.
A nasty mix of IDL and pseudocde comments might make it clearer...
; do some processing
; write out your data file 'myfile.dat'
; get a check string for use later
spawn, 'ls -l myfile.dat', returned_data
while data_to_process do begin ; just start some sort of loop
; do some more processing
; now check file to see if it's changed
spawn, 'ls -l myfile.dat', =
if returned_data2(0) NE returned_data(0) THEN BEGIN ; file date changed!
returned_data =3D returned_data2
=
; display your new data
end if
endwhile
This depends on the fact that returned_data contains the normal
"ls -l" listing which will have a different date/time and maybe size
each time the file is changed. It's very unix dependent though, but
might be a quick solution, if not the cleanest.
Tim
=C3=E9=FE=F1=E3=EF=F2 =C2=E5=F4=EF=FD=EB=E7=F2 wrote:
> =
> Hello,
> =
> suppose I have a simulation that every so often writes out a 2d array.
> Is there a way for idl to detect that the file has changed, and
> replot or display the new data?
> This would be under unix (digital and/or sparc) with the data
> being produced by fortran.
> =
> I suppose that even a delay loop would serve, in the sense that
> it would redisplay the file every, say, 10 sec irrespectively of
> whether it changed or not. But this sounds wasteful.
> =
> Any ideas?
> =
> Thanks a lot!
> =
> =
> --
> Georgios Vetoulis, Institute for Plasma Research
> University of Maryland at College Park
|
|
|