[AstroPy] A simple python module, wrapping pytfits+matplotlib: fits I/O + graphic/display environment

James Turner jturner at gemini.edu
Thu May 4 18:56:17 EDT 2006


Hi Eric,

> Image1.fits = Image2.fits / (Image3.fits + 3.4)
> 
> Table.fits.col1 = Table.fits.col2 * Table.fits.col4 / 2.
> 
> , or easily create a new Fits image, or table, display them by doing
> something like:
> 
> load("Image1.fits", scale=3, cuts=(0.,100.), center=(-1.,6.))

Apologies if I have overlooked something basic, being fairly new to
Python myself - but could you do what you want by loading the original
data with PyFITS and then working in memory with numarray + numdisplay
/matplotlib instead of FITS files on disk? Have you looked at the STScI
tutorial at http://stsdas.stsci.edu/perry/pydatatut.pdf ? Also, I think
ipython and Pyraf are somewhat interchangable (see tutorial), so maybe
you can use the IRAF tasks (imarith?) to do what you want without
losing your nice Python environment?

If you would rather work with FITS files, I'm guessing it's for one of
three (good) reasons: 1) you want to save all your intermediate results
to disk, 2) you need to propagate headers, variance extensions etc.,
3) you need to do some intermediate processing with MIDAS/IRAF or 4) it
is just more convenient not to have to load and save the files
explicitly. FOUR reasons! (sorry if you don't get the silly Monty Python
joke, but it seemed appropriate)

If you are concerned about #2, this is something I have been thinking
about too, also in the context of IFU data. I'll send a separate email
with some ideas on this, since it's perhaps a bit off topic.

Cheers,

James.

-- 
James E.H. Turner
Gemini Observatory Southern Operations Centre,
Casilla 603,		Tel. (+56) 51 205609
La Serena, Chile.	Fax. (+56) 51 205650



More information about the AstroPy mailing list