This is a part of the UK Mirror of the HEASARC HEAsoft pages, maintained by LEDAS.
All HEAsoft-related links on this page are to HTML files or data stored at Leicester, unless indicated by a (US).
Please refer any problems with these pages to Duncan Law-Green (ledas-help@star.le.ac.uk).

FITS Tools: Example CFITSIO programs


These are working programs written in ANSI C which illustrate how easy it is to read, write, and modify FITS files using the CFITSIO library. Most of these programs are very short, containing only a few 10s of lines of executable code or less, yet they perform quite useful operations on FITS files. Copy the programs to your local machine, then compile, and link them with the CFITSIO library. A short description of how to use each program can be displayed by executing the program without any command line arguments.

You may freely modify, reuse, and redistribute these programs as you wish. It is often easier to use one of these programs as a template when writing a new program, rather than coding the new program completely from scratch.

Available FITS Utility Programs

Download the source code for all the example programs here ( .tar file or .zip file)

fitscopy - copy a file with optional filtering


listhead - list header keywords


liststruc - list file structure


modhead - write or modify a header keyword


imcopy - copy a FITS image with optional data compression


imarith - arithmetically combine 2 images


imlist - list pixel values


imstat - compute statistics of an image


tablist - list table contents


tabcalc - general table calculator


tabmerge - merge rows from 2 tables


cookbook - more example routines


Download the source code for all the example programs here ( .tar file)


This is the LEDAS (UK) mirror of the HEASARC LHEASoft archive.
HEASARC web pages maintained by Bryan K. Irby. Helplines for FTOOLS and XANADU @ HEASARC.
UK mirror maintained by: Dr. Duncan Law-Green, LEDAS Support Scientist (ledas-help@star.le.ac.uk), (0116)252-2589.
Back to main page>