Numdisplay provides the capability to visualize numpy array objects using astronomical image display tools such as DS9 or XIMTOOL directly from the Python command line. This task can display any numpy object, whether it was created interactively or read in from a FITS file using PyFITS on any platform which supports Python and numpy. This task has been developed by the Science Software Branch at the Space Telescope Science Institute.
Version 1.4 available, with numdisplay versions > 1.3 will only work with numpy.
It has been successfully tested as a standalone Python module on Mac OS X, Linux, Solaris, and Windows.
This task was designed to work strictly with numpy objects. Images stored as FITS files can be read in using PyFITS, while the readgeis module distributed with PyFITS can be used to read in IRAF GEIS formatted images as numpy objects. Alternatively, a numpy object could just as easily be created in memory directly and displayed using numdisplay.
Displaying a numpy array object that has been read into or created in memory involves:
- Opening the connection to a usable display tool (such as DS9).
- Setting the display parameters for the array, such as min and max array value to be used for min and max grey scale level, along with any offset, scale factor and/or transformation function to be applied to the array.
- Applying any transformation to the input array. This transformation could be a simple numpy ufunc or a user-defined function that returns a modified array.
- Building the byte-scaled version of the transformed array and sending it to the display tool. The image sent to the display device will be trimmed to fit the image buffer defined by the 'imtdev' device from the 'imtoolrc' or the 'stdimage' variable under IRAF. If the image is smaller than the buffer, it will be centered in the display device.
NOTE: All pixel positions reported back will be relative to the full image size.
- numpy - Numdisplay REQUIRES the use of numpy. Numpy should have been installed with stsci_python, but if not, can be downloaded from the numpy development site.
- Python 2.2(or later) - Numdisplay relies on features of Python 2.2 or later for its implementation.