View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

Multiple image fits files part 2

douglas brenner wrote on May 22, 2006

I made a fits file that contains multiple images

imcopy(input = "moviedir$tmp.fits", output = "moviedir$"//object//".fits["//str(i)//",append]")

If I use display I can display one of the images

display hip12345.fits[1], frame = 1.

What I can't do is bring up all the images as once so that I can blink them in ds9.

Thanks

Emilliano Gregori wrote on May 22, 2006

Hello, try this:


disp img1.fits 1
disp img2.fits 2
!xpaset -p ds9 blink


the first two "disp" lines load the images in the ds9 frames.
the last line calls the "external" program xpaset and tells ds9 to start blinking.
You can download the XPA clients xpaset and xpaget from the ds9 website, and you can find more info in the DS9 manual, section "XPA Access Points".

Emiliano

Mike Fitzpatrick wrote on May 22, 2006

Since you're creating a data cube it is also possible to have DS9 load this directly: Use the 'File->Open Other->Open Multi Ext as Data Cube' menu to open the MEF where each extension is a different frame in the sequence, then use the 'Frame->Data Cube' menu to bring up the control box for it. There may be XPA access points for these, check the docs or perhaps Emiliano can confirm this?

Displaying from within IRAF is limited to 16 frames due to the IIS protocol. You can automate the loading in a script, e.g.

for (i=1; i<=16; i=i+1) 
    display ("hip12345.fits[" // i // "]", frame=i)


but before you ask, tasks in the system like 'BLINK' which may seem appealing are obsolete and specifically meant for an IIS device (the ancient hardware, not the protocol). Tasks like 'xpaset' can be declared as foreign for easier use in scripts if that's where you're headed with this. Hope this helps.

Cheers,
-Mike

douglas brenner wrote on May 22, 2006

I could open the MEF in ds9 as you instructed and that's great. However, I have fits data cubes from other sources that open with the open command.
What could be the difference?

Thanks.

Mike Fitzpatrick wrote on May 22, 2006

MEF file in one case and 3-D simple FITS in the other? You can display bands of a 3-D image using image sections (e.g. foo[*,*,1], foo[*,*,2], etc) but are again limited to 16 frames. Check the DS9 doc for using these directly, I think it should be possible.

-Mike

douglas brenner wrote on May 22, 2006

MEF made in iraf vesus what ever IDL puts out when I write a 3d array to a fits file.

Also, how do I find out how many images are in the MEF file?

thanks

Mike Fitzpatrick wrote on May 22, 2006

I try to avoid IDL so I can't answer the first part.

If you have the FITSUTIL package installed you can use the FXHEADER task to list the contents of a MEF. Since extensions might also be tables then to get the number of images try something like

cl> fxheader foo.fits | match IMAGE | count

There is an NEXTEND keyword sometimes produced, but nothing says it is either correct, required to be there, or counts only the number of images and so is unreliable...

-Mike

Emilliano Gregori wrote on May 22, 2006

fitz

Since you're creating a data cube it is also possible to have DS9 load this directly: Use the 'File->Open Other->Open Multi Ext as Data Cube' menu to open the MEF where each extension is a different frame in the sequence, then use the 'Frame->Data Cube' menu to bring up the control box for it. There may be XPA access points for these, check the docs or perhaps Emiliano can confirm this?


Hello Mike,
there should be an xpa access point to load a MEF:

!xpaset -p ds9 file medatacube mycube.fits


but I'm not sure because I did not try it (I have no datacubes at hand right now)... Once you opened the MEF maybe you can start blinking with the previous xpa access point?

douglas brenner wrote on May 22, 2006

thanks eom

Last post on May 22, 2006