View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

complex array in imh file

rclark wrote on Nov 11, 2008

I have several imh/pix files, each containing an array of type complex.
How do I convert them to fits files?

wfits seems to only extract the real part.

I've tried some other non-iraf fits utilities that recognize iraf
files but they choke on the complex data type.

Is there some utility that will split the real and imaginary
parts into separate files?

Or is there a way to convert it 'in place' by
doctoring the headers to redefine the m x n
complex array as a real array of 2 x m x n?

Richard

Francisco Valdes wrote on Nov 11, 2008

Wow, I had long forgotten IRAF allowed complex images! The sad answer is that the IRAF FITS kernel doesn't allow complex values and there are not many tasks that correctly handle complex values. There may be something useful but the only thing I can think of is to use listpixel or wtextimage to dump the values out as text and the use an editor, filter (like sed), or a script to extract the information to another text file. You can then convert it back to an image with something like rtextimage. You can go directly to FITS by specifying something like


rtextimage abc.txt abc.fits


I hope this helps. Maybe someone will have another idea. It is possible the ttools package might be useful for this problem.

Yours,
Frank Valdes

Last post on Nov 11, 2008