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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: How to convert text file to fits file [message #70578] Thu, 22 April 2010 16:32 Go to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Apr 22, 4:19 pm, David Fanning <n...@dfanning.com> wrote:
> Craig Markwardt writes:
>> 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.
>
> Craig, it is wonderful to see you back on the IDL newsgroup
> so frequently, answering all manner of questions. Is this
> part of a work-release program or what? ;-)

Haha, thanks. They let me out on weekends :-)

More seriously, I have a slightly better way of reading Usenet (using
Google Reader), so I'm more likely to read and then answer.

Good to see you're still here fighting the good fight!

Craig
Re: How to convert text file to fits file [message #70587 is a reply to message #70578] Thu, 22 April 2010 13:19 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Craig Markwardt writes:

> 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.

Craig, it is wonderful to see you back on the IDL newsgroup
so frequently, answering all manner of questions. Is this
part of a work-release program or what? ;-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
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 next 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
Re: How to convert text file to fits file [message #70639 is a reply to message #70578] Mon, 26 April 2010 22:18 Go to previous message
sid is currently offline  sid
Messages: 50
Registered: January 1995
Member
On Apr 23, 4:32 am, Craig Markwardt <craig.markwa...@gmail.com> wrote:
> On Apr 22, 4:19 pm, David Fanning <n...@dfanning.com> wrote:
>
>> Craig Markwardt writes:
>>> 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.
>
>> Craig, it is wonderful to see you back on the IDL newsgroup
>> so frequently, answering all manner of questions. Is this
>> part of a work-release program or what? ;-)
>
> Haha, thanks.  They let me out on weekends :-)
>
> More seriously, I have a slightly better way of reading Usenet (using
> Google Reader), so I'm more likely to read and then answer.
>
> Good to see you're still here fighting the good fight!
>
> Craig

Thank you craig, it works
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Wed Oct 08 15:55:37 PDT 2025

Total time taken to generate the page: 0.00714 seconds