[fitsbits] Sample FITS viewer application?

William Pence pence at tetra.gsfc.nasa.gov
Mon Mar 25 11:11:01 EST 2002


Peter Moreton wrote:
> 
> I am searching for some sample code to get me up the learning curve of
> CFITSIO. Ideally, I would like to find some sample 'C' / C++ that
> calls CFITSIO to load and display a FITS file in a Windows
> environment. Does anyone know of such a demo application? Thanks.

The following simple demonstration programs are provided to illustrate how
to read and write FITS images and tables using the CFITSIO library. 

     fitscopy - copy a file with optional filtering 
     listhead - list header keywords 
     liststruc - list the structure of a FITS file. 
     modhead - write or modify a header keyword 
     imcopy - copy an image with optional compression/decompression 
     imarith - add, subtract, multiply, or divide 2 images 
     imlist - list pixel values in an image 
     imstat - compute statistics of image pixels 
     tablist - display the contents of a FITS table 
     tabcalc - general table calculator 
     tabmerge - merge rows from one table with another table. 
     cookbook - additional example routines. 

The source code files for these working programs are available from

 http://heasarc.gsfc.nasa.gov/docs/software/fitsio/cexamples.html

These are all written in ANSI C and most of them contain only a few 10s of
lines of executable code.  Since these example programs were designed to run
on any platform, there are no examples of how to display an image in
Windows  Some of these should be helpful, however, in learning how to read
the FITS image into an array, which then could be passed to an image display
routine.

Bill Pence
-- 
____________________________________________________________________
Dr. William Pence                     pence at tetra.gsfc.nasa.gov.spam
NASA/GSFC Code 662         HEASARC         +1-301-286-4599 (voice)     
Greenbelt MD 20771                         +1-301-286-1684 (fax)



More information about the fitsbits mailing list