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

Home » Public Forums » archive » Re: How to convert text file to fits file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How to convert text file to fits file [message #70589 is a reply to message #70587] Thu, 22 April 2010 13:11 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Apr 22, 7:21 am, sid <gunvicsi...@gmail.com> wrote:
> Hi,
>     I am having text file with two columns one is wavelength and
> intensity, I need to convert this to fits file, please help me out in
> this regard
> regards

A general outline.

First, get the IDL Astronomy Library if you don't already have it.

Next, read your data into IDL variables. It's pretty easy to do
something like,
OPENR, 50, 'myfile.dat'
DD = replicate({wavelength: 0d, intensity: 0d}, 100) ;; example;
assumes 100 data points
READF, 50, dd ;; Read data into a structure
CLOSE, 50

Finally, write to a FITS binary table. The easiest routine to start
with is MWRFITS.
MWRFITS, dd, 'myfile.fits'

Of course there are endless variations on data and FITS files, but
this should get you started. I just did a practice file, and all
these steps worked.

Good luck,
Craig
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Spam Overflow...
Next Topic: How to convert text file to fits file

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

Current Time: Sat Oct 11 02:34:28 PDT 2025

Total time taken to generate the page: 0.31888 seconds