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

Home » Public Forums » archive » Re: howto make a fits cube in IDL?
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: howto make a fits cube in IDL? [message #56661 is a reply to message #56659] Wed, 07 November 2007 11:54 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
On Nov 7, 10:45 am, Tigran Khanzadyan <khanzad...@gmail.com> wrote:
> Dear All,
>
> I wish to create a FITS-CUBE from a model outcome in order to directly
> compare with the radio observations. So the task is to actually write
> on disk a Fits file which would have x,y and a spectra on each x,y
> position. A spectra itself has two dimensions - temperature and
> velocity.
>
> I was wondering if someone could point me to the right direction. I
> know that there is a "writefits" in NASA IDL ASTRO LIBRARY, but I cant
> quite find a task or routine to write FITS-CUBE.

This looks like a case for using the "Binary table" FITS format.
The routines MWRFITS and MRDFITS give a nice mapping between IDL
structures and FITS binary tables. So say you have 200 X,Y points and
that at each X,Y you have a temperature and velocity spectrum with 60
points.

IDL> str = {x:0, y:0, temperature:fltarr(60), velocity:fltarr(60) }
IDL> str = replicate(str, 200)

(If the number of points are not all the same in each spectra then you
could use pointers rather than fixed arrays.)

Then you fill the structure with the actual values, and finally write
the structure to a FITS file

IDL> mwrfits,str,'myfile.fits'

--Wayne
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: time_test replacement?
Next Topic: !p.multi

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

Current Time: Sat Oct 11 04:55:38 PDT 2025

Total time taken to generate the page: 0.88367 seconds