Generally it is not straightforward to make an MPEG movie inside Python or IDL from a sequence of plots.
To overcome this problem we can save all the images we need in the movie in a separate folder and then run the following command:
All the images *.png will be added in the MPEG movie.mpg
This is an IDL example to write jpeg images in a loop:
for t=0,Tot do begin
tvframe, matrix(*,*,t), /bar, brange=[-200,200], /asp,btitle='v [m/s]', yr=[0.,200*0.17]
image=tvrd(TRUE=3)
WRITE_JPEG, '~/temp/'+'im'+strtrim(t)+'.jpg', image , true=3
endfor
This is an IDL example to write jpeg images in a loop:
for t=0,Tot do begin
tvframe, matrix(*,*,t), /bar, brange=[-200,200], /asp,btitle='v [m/s]', yr=[0.,200*0.17]
image=tvrd(TRUE=3)
WRITE_JPEG, '~/temp/'+'im'+strtrim(t)+'.jpg', image , true=3
endfor
Thanks Marco, this tutorial is very helpful!
RispondiElimina