Hello!
I am trying to display a FITS image, if your not familiar with the extension its fine (gtk.Image.new_from_file() isn't either). I can get my image data to a numpy array (2D (256x256 to be exact)) I am having the most difficult time getting this into a grayscale image. I've tried gtk.Image() Ive tried pixbufs and pixmaps everything on the web. I'm having trouble making the color scales/maps. Something about visuals? My computer didn't have any that would work (debian linux). I've been slamming my head against the wall for days over this one and It seems like it should be so simple. Thanks for your help/suggestions!!!
Here is the eventual implementation:
#!/usr/bin/python
#filename: imgTest.py
import gtk
import pyfits as pf
import numpy as np
class PyApp(gtk.Window):
def __init__(self):
super(PyApp, self).__init__()
self.set_title("image test")
self.set_position(gtk.WIN_POS_CENTER)
self.connect("destroy", gtk.main_quit)
#--------------------------------------------------------------------------------
data = abs(np.matrix(pf.getdata('img.fits')))
data = data*(255.0/data.max())
[w,h] = np.shape(data)
#I need to take the array 'data' and display it as an image
#--------------------------------------------------------------------------------
self.show_all()
PyApp()
gtk.main()