How can make a simple movie from .txt files [message #77611] |
Fri, 16 September 2011 06:28  |
ece
Messages: 12 Registered: June 2011
|
Junior Member |
|
|
Hi,
I have 100 spectra in .txt files. Each file has wavelength and flux
values. I want to make a movie showing each spectra as a function of
time. Does anyone have a suggestion about how to start?
|
|
|
|
Re: How can make a simple movie from .txt files [message #77715 is a reply to message #77611] |
Wed, 21 September 2011 13:24  |
Russell[1]
Messages: 101 Registered: August 2011
|
Senior Member |
|
|
On Sep 16, 9:28 am, ece <ecekile...@gmail.com> wrote:
> Hi,
>
> I have 100 spectra in .txt files. Each file has wavelength and flux
> values. I want to make a movie showing each spectra as a function of
> time. Does anyone have a suggestion about how to start?
Hi Ece, I've done something like this for some galaxy spectra I had.
What I did was to use the MPEG tools (mpeg_open.pro, mpeg_put.pro,
mpeg_close.pro, and mpeg_save.pro) that come with IDL. So the
algorithm is pretty simple:
(1) read the first spectrum
(2) create a window with the pixmap option set
(3) plot the spectrum
(4) use tvrd() to get the data which you just plotted. this will be a
3xm x n array.
(5) use the mpeg_* utilities to put this into the file
(6) destroy the window
(7) goto (1) with a new spectrum
Now, you can add things along the way to deal with frame rate, colors,
etc. And there maybe a better way than the creating/destroying all
those windows, but this did work for me.
-Russell
|
|
|