Tag Archive


amateur astronomy awk bash be b[e] supergiant cartoon conference convert evolved star exoplanet fedora figaro fits fun galaxy history iraf jupiter latex linux lmc machine learning massive star matplotlib meteor mypaper paper peblo photometry planet pro-am pyraf python scisoft skinakas observatory small magellanic cloud smc spectroscopy starlink talk theli ubuntu university of crete video x-ray

Retrieve header key with gethead

A quick note on gethead of WCSTools – as I have needed many times (but obviously not that many to remember it!).

Rather straightforward use: gethead HEADER_KEY image.fits
(as simple as possibly!)
If HEADER_KEY contains empty spaces then use double quotes, e.g. “HIERARCH TEL AIRM END”.

Reminder: you have to have installed already the WCSTools! (See the “Installing WCSTools” for this.)

[Ref: WCSTools – gethead: http://tdc-www.harvard.edu/software/wcstools/gethead/gethead.html ]

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: ftp://cfa-ftp.harvard.edu/pub/gsc/WCSTools/.

From the directory that tarball was downloaded, go to a tcsh (or any c-shell), if you are not, and untar:
tcsh
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"

Install:
make

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, http://www.howtoinstall.co/en/debian/wheezy/main/wcstools/