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

Home » Public Forums » archive » Re: FITS to ascii spectra
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: FITS to ascii spectra [message #67636] Thu, 20 August 2009 08:56
rupai is currently offline  rupai
Messages: 3
Registered: August 2009
Junior Member
On Aug 20, 1:04 am, pp <pp.pente...@gmail.com> wrote:
> On Aug 19, 4:42 pm, rupai <rupali...@gmail.com> wrote:
>
>> is there any IDL procedure that can convert a 1D FITS spectra to an
>> ascii text spectra (e.g. wspectext of IRAF ) ?
>
> Download the idlastro library at
>
> http://idlastro.gsfc.nasa.gov/
>
> Then you can read the file using something like
>
> fits_read,fits_file,data,header
>
> How to interpret the array data that is returned by fits_read depends
> on how the file was written. It may be necessary to read parameters
> from the header (like initial wavelength and wavelength interval per
> pixel).
>
> Assuming you have the spectrum in an array called data2, then you can
> make a text file with default formatting with just something like
>
> openw,unit,txt_file,/get_lun
> printf,unit,data2
> free_lun,unit

thanks for useful information...

--rupai
Re: FITS to ascii spectra [message #67646 is a reply to message #67636] Wed, 19 August 2009 13:04 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Aug 19, 4:42 pm, rupai <rupali...@gmail.com> wrote:
> is there any IDL procedure that can convert a 1D FITS spectra to an
> ascii text spectra (e.g. wspectext of IRAF ) ?

Download the idlastro library at

http://idlastro.gsfc.nasa.gov/

Then you can read the file using something like

fits_read,fits_file,data,header

How to interpret the array data that is returned by fits_read depends
on how the file was written. It may be necessary to read parameters
from the header (like initial wavelength and wavelength interval per
pixel).

Assuming you have the spectrum in an array called data2, then you can
make a text file with default formatting with just something like

openw,unit,txt_file,/get_lun
printf,unit,data2
free_lun,unit
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: [IDL 6.2 with ENVI 4.2] is-it possible to extract multiple profiles on multiple images from shape files
Next Topic: Re: [IDL 6.2 with ENVI 4.2] is-it possible to extract multiple profiles on multiple images from shape files

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

Current Time: Wed Oct 08 15:14:54 PDT 2025

Total time taken to generate the page: 0.00413 seconds