<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=windows-1252"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
This balked at the fig= line<br>
<blockquote>ntuser/fun-pyfits.py", line 6, in <module><br>
    fig = figure()<br>
TypeError: 'module' object is not callable<br>
</blockquote>
I'm using image = pyfits.getdata('mpl51.fits'), and that's OK. <br>
<br>
Thomas Robitaille wrote:
<blockquote cite="mid:E548A0CC-112F-4DA1-AE90-22F7684D9535@gmail.com"
 type="cite">Have you tried matplotlib? For example:
  <br>
  <br>
from matplotlib import figure
  <br>
import pyfits
  <br>
  <br>
image = pyfits.getdata('lena.fits')
  <br>
  <br>
fig = figure()
  <br>
ax = fix.add_subplot(111)
  <br>
ax.imshow(image)
  <br>
fig.canvas.draw()
  <br>
  <br>
You can use matplotlib to do interactive stuff. If you really want to
use Tkinter to display FITS images, I can send you an example.
  <br>
  <br>
Best,
  <br>
  <br>
Thomas
  <br>
  <br>
On 6 Apr 2009, at 08:32, Wayne Watson wrote:
  <br>
  <br>
  <blockquote type="cite">Hi, it must be than that the version of the
pyfits user manual I found
    <br>
is out of date, since it talks about numarray.
    <br>
I just wanted to confirm that I understood the role of ds9, which is as
    <br>
you essentially wrote, is a program and not a python module.
    <br>
I just found the numpy manual, Dec. 7, 2006, by Oliphant. Is that the
    <br>
current one? It mentions fits once, and image about 5 times (mostly as
    <br>
what seems to be a module). Here are a few lines from the manual:
    <br>
    <br>
   • nd image –> scipy.ndimage
    <br>
   • convolve –> scipy.stsci.convolve
    <br>
   • image –> scipy.stsci.image
    <br>
   If you don’t want to install all of scipy, you can grab just these
    <br>
   packages from SVN
    <br>
   using
    <br>
    <br>
    <br>
imshow is not found in it. The manual is close to 350 pages. I
certainly
    <br>
don't want to print it if it doesn't meet my needs. To put it in terms
    <br>
of Python, consider:
    <br>
    <br>
import Image
    <br>
im = Image.open("lena.ppm")
    <br>
print im.format, im.size, im.mode
    <br>
im.show()
    <br>
    <br>
I'm looking for a capability somewhat like that above for fits, and not
    <br>
ppm. show is pretty primitive, but the the idea is that I want this
    <br>
little program to display lena.fits.
    <br>
    <br>
    <br>
Cohen-Tanugi Johann wrote:
    <br>
    <blockquote type="cite">hi Wayne, I am not sure I understand your
request, but :
      <br>
1) numarray is obsolete, use numpy.
      <br>
2) ds9 is meant to display fits image, it has nothing to do with
      <br>
internet AFAIK. You also have FV from HEASARC.
      <br>
3) if you need to just visualize a fits image as an array, you have
      <br>
several possibilities in numpy : imshow, pcolor, etc.... check the
      <br>
user(s guide.
      <br>
      <br>
HTH,
      <br>
Johann
      <br>
      <br>
Wayne Watson wrote:
      <br>
      <blockquote type="cite">I tried downloading the numarray from the
web and Acrobat burped. It
        <br>
came up with an error. Where is the official site for it?
        <br>
        <br>
It appears to display a fits image one must either use numdisplay or
        <br>
some combo of numarray and Python's PIL and a GUI like Tkinter. I
        <br>
really want to use Python in such a manner if it is possible. From
        <br>
what little I know about DS9, it is an internet viewer.
        <br>
-- <br>
Wayne Watson (Watson Adventures, Prop., Nevada City, CA)
        <br>
        <br>
(121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time)****
        <br>
        <br>
"Less than all cannot satisfy Man." -- William Blake
        <br>
------------------------------------------------------------------------
        <br>
        <br>
_______________________________________________
        <br>
AstroPy mailing list
        <br>
<a class="moz-txt-link-abbreviated" href="mailto:AstroPy@scipy.org">AstroPy@scipy.org</a>
        <br>
<a class="moz-txt-link-freetext" href="http://mail.scipy.org/mailman/listinfo/astropy">http://mail.scipy.org/mailman/listinfo/astropy</a>
        <br>
      </blockquote>
      <br>
    </blockquote>
    <br>
-- <br>
    <br>
          Wayne Watson (Watson Adventures, Prop., Nevada City, CA)
    <br>
    <br>
            (121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time)****
    <br>
    <br>
         "Less than all cannot satisfy Man." -- William Blake
    <br>
    <br>
    <br>
_______________________________________________
    <br>
AstroPy mailing list
    <br>
<a class="moz-txt-link-abbreviated" href="mailto:AstroPy@scipy.org">AstroPy@scipy.org</a>
    <br>
<a class="moz-txt-link-freetext" href="http://mail.scipy.org/mailman/listinfo/astropy">http://mail.scipy.org/mailman/listinfo/astropy</a>
    <br>
  </blockquote>
  <br>
  <br>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<meta content="text/html;" http-equiv="Content-Type">
<title>Signature.html</title>
<pre class="moz-signature" cols="76">           Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

             (121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time)<span
 style="font-weight: bold;"></span><b><b
 style="color: rgb(204, 51, 204);" class="b"><span
 style="color: rgb(255, 153, 255);"></span><span
 style="font-family: monospace;"></span></b></b><span
 style="color: rgb(102, 0, 204);">

          "Less than all cannot satisfy Man." -- William Blake
          
</span><font class="sqq"><span class="sqq"
 style="color: rgb(102, 0, 204);"></span></font></pre>
</div>
</body>
</html>