[AstroPy] Installing numdisplay--A Problem (Windows)

Christopher Hanley chanley at stsci.edu
Fri Apr 10 22:36:00 EDT 2009


Wayne Watson wrote:
> On the other hand, if I use a Python program (usint pyfits, numpy, etc. 
> and no numdisplay), then I can dispense with the need to run DS9, and 
> use PIL and canvas from Tkinter, correct? Of course, I need to strip out 
> the data portions of the FITS files to do that. I think that's right, 
> since PIL has no knowledge of fits.
> 

I am not the familiar with PIL and Tkinter.  I expect you could probably 
get something like that working at the loss of the WCS information the 
FITS image provides and the DS9 can interpret.

"Stripping" out the data of a pyfits object is trivial.  Just identify 
the extension you wish to use data from.  If you are using simple FITS 
files the data is probably in the primary extension.  So doing something 
like this:

import pyfits
hdulist = pyfits.open("somefile.fits")
data = hdulist[0].data

The data object is a numpy array.

I'll let people with more experience with Python GUIs and plotting take 
over helping you now.  You are out of my area of expertise.

Cheers,
Chris



-- 
Christopher Hanley
Senior Systems Software Engineer
Space Telescope Science Institute
3700 San Martin Drive
Baltimore MD, 21218
(410) 338-4338



More information about the AstroPy mailing list