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 #56654] Wed, 07 November 2007 22:24 Go to previous message
Tigran Khanzadyan is currently offline  Tigran Khanzadyan
Messages: 5
Registered: September 2006
Junior Member
On Nov 7, 7:54 pm, wlandsman <wlands...@gmail.com> wrote:
> 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

Wow! that was quick.

They say if you don't know you better ask:)
Thanks Wayne, I think this will do the job.

Tigran
[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: Thu Oct 09 22:00:12 PDT 2025

Total time taken to generate the page: 0.28459 seconds