ESO stand-alone FITS routines

I recently came across a nice simple way to access FITS header keywords at the command line via the “Stand-alone FITS tools” provided by ESO. The combination of dfits and fitsort work like the IRAF hselect routine, but they are run at the command line and therefore have access to all of the shell tools like grep.

To install:

cd /tmp/   ### or anywhere else
gcc -o dfits dfits.c
gcc -o fitsort fitsort.c
sudo cp dfits fitsort /usr/local/bin    ### or somewhere else in your $PATH

Now you can run it with, e.g.,

dfits f140w.fits | fitsort NAXIS1 NAXIS2 EXPTIME
   FILE         	NAXIS1	NAXIS2	EXPTIME        	
   f140w.fits	   7017  	   8361  	4.058728020E+03

Note that dfits also works with wildcards, e.g. dfits ib*flt.fits | fitsort FILTER.

This entry was posted in Uncategorized. Bookmark the permalink.

2 Responses to ESO stand-alone FITS routines

  1. Gus says:

    wcstool’s gethead does all this in one command with lots of useful formatting options.

    • gbb says:

      Yes, gethead also seems to do a good job at this. One benefit of the ESO tools is that they recognize the ESO “HIERARCH” keywords:

      dfits HAWKI_IMG_OBS_AutoJitter291_0001.fits |fitsort DET.DIT
      RAW/JITTER/HAWKI_IMG_OBS_AutoJitter291_0001.fits 300.0000000


      gethead HAWKI_IMG_OBS_AutoJitter291_0001.fits DET.DIT
      [nothing found]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s