Re: How to convert text file to fits file [message #70578] |
Thu, 22 April 2010 16:32  |
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 #70589 is a reply to message #70587] |
Thu, 22 April 2010 13:11   |
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  |
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
|
|
|