Installing WCSTools

WCSTools is a package of programs and a library of utility subroutines for setting and using the world coordinate systems (WCS) in the headers of the most common astronomical image formats, FITS and IRAF .imh, to relate image pixels to sky coordinates. This software is all written in very portable C, so it should compile and run on any computer with a C compiler. ”

Apart from the main purpose that WCSTools has, there are some useful utilities for FITS header (like edhead, gethead, imhead). That’s why I decided to install it after all…(installation process based on this ubuntu thread)

First download the latest verion (currently 3.8.1) from the anonymous FTP:

From the directory that tarball was downloaded, go to a tcsh (or any c-shell), if you are not, and untar:
tar -xvf wcstools-3.8.1.tar.gz

Go to the created directory and set the environment for the c compiler:
cd wcstools-3.8.1
setenv CC gcc
setenv CFLAGS "-O2 -pipe -fomit-frame-pointer"


Create and move the binaries created to the desired path
mkdir -p /desiredpath/wcstools/
mv bin /desiredpath/wcstools

Edit you .tcshrc (or .cshrc) file (back to the home directory, if different) and add the path of the binaries created:

# wcstools path
set path=($path /home/user/desiredpath/wcstools/bin)

Then source the .tcshrc file:
source .tcshrc
or restart the terminal to activate the new commands!

~ ~ ~

UPDATE (28/01/2015): For Debian the installation is even simpler [1] … just:
sudo apt-get install wcstools

[1]: “How to install wcstools package in Debian Wheezy”, accessed on 28/01/2015,


  1. Ping from X. K. Chen:

    when i install the wcstools with source document :
    i found that imcat function cannot be identi. Once i type ‘imcat -c tmc test_0.fits’, it shows ‘no such file or directory’.
    and if i am in the path of /…/wcstools/bin, and try to run imcat like ‘sh imcat’, it says that some error is in imcat.

  2. Ping from grigoris:

    Hey! I understand that this is a very late reply, but your comment totally slipped my attention…sorry for that!

    I have installed wcstools through the debian repository. So when I type any command (e.g. gethead) then I see the help message. But, indeed, when I tried imcat I got the same error.

    So I believe, that they should have removed this function (for whatever reason), but if you get something by typing any other command, then the installation should be fine.


Leave a Reply

Your email address will not be published. Required fields are marked *