comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » How can make a simple movie from .txt files
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
How can make a simple movie from .txt files [message #77611] Fri, 16 September 2011 06:28 Go to next message
ece is currently offline  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 #77686 is a reply to message #77611] Sun, 18 September 2011 15:37 Go to previous messageGo to next message
Matt Francis is currently offline  Matt Francis
Messages: 94
Registered: May 2010
Member
On Sep 16, 11:28 pm, 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?

The simplest way to display a spectrum would be to simply plot the
flux vs wavelength using PLOT.

The simplest way to make a 'movie' would be to use WRITE_GIF,/MULTIPLE
to make an animaited GIF by looping over each of your 100 spectra and
plotting them. This makes for a very inefficent movie in terms of file
size, but may be suitable for your purposes.
Re: How can make a simple movie from .txt files [message #77715 is a reply to message #77611] Wed, 21 September 2011 13:24 Go to previous message
Russell[1] is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL_IDLBridge hangs
Next Topic: Function 'folfing' in IDLDE 7.1?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:10:45 PDT 2025

Total time taken to generate the page: 0.00672 seconds