1. Print Usage Instructions
Print basic instructions for use of this program by typing only the program
name.
$ gethead
GETHEAD 3.5.0, 29 October 2003, Doug Mink (dmink@cfa.harvard.edu)
Print FITS or IRAF header keyword values
Usage: gethead [-abhoptv][-d dir][-f num][-m num][-n num] file1.fit ... filen.fits kw1 kw2 ... kwn
or : gethead [-abhoptv][-d dir][-f num][-m num][-n num] @filelist kw1 kw2 ... kwn
or : gethead [-abhoptv][-d dir][-f num][-m num][-n num] file1.fit ... filen.fits @keywordlist
or : gethead [-abhoptv][-d dir][-f num][-m num][-n num] @filelist @keywordlist
-a: List file even if keywords are not found or null
-b: Replace blanks in strings with underscores
-c: Read all files as plain ASCII
-d: Root directory for input files (default is cwd)
-e: Output keyword=value's on one line per file
-f: Never print filenames (default is print if >1)
-g: Output keyword=value's on one line per keyword
-h: Print column headings
-n: Number of decimal places in numeric output
-o: OR conditions instead of ANDing them
-p: Print full pathnames of files
-s: Do not pad tab-separated table with spaces
-t: Output in tab-separated table format
-u: Always print ___ if keyword not found or null value
-v: Verbose
-x [range]: Read header for these extensions (no arg=all)
$
2. Single File, Verbose Mode
Print the right ascension and declination of a
FITS image from
its RA and DEC header parameters in verbose mode.
$ gethead -v test.fts ra dec
GETHEAD 3.5.0, 29 October 2003, Doug Mink (dmink@cfa.harvard.edu)
Print Header Parameter Values from FITS image file test.fts
RA = 9:51:19.45
DEC = 69:15:26.42
3. Multiple parameters from multiple FITS and IRAF files
Get the values of the EPOCH and EQUINOX header parameters from all of
the FITS and IRAF files in a directory and print the parameter names used at
the top of each column:
$ gethead -h epoch equinox *imh *fits
FILENAME EPOCH EQUINOX
0093.21530p0622R.imh 1950.0 ___
ftest.imh 1950.0 ___
target.sumw.imh 2000.0 ___
wpix.imh 0.00 ___
1.695012J.fits 1.9825692138672E+03 2.0000000000000E+03
M9108MI.fits 1.9562056884766E+03 2.0000000000000E+03
dsstest.fits 1.9777768554688E+03 2.0000000000000E+03
eastupnorthleft.fits 1950.0 ___
galcen.iras12.fits 1.950000000E+03 ___
gc.fits ___ 1950.00
ipactest.fits 1.950000000E+03 ___
m31.fits 1.950000000E+03 ___
m31x.fits ___ 2000.00
n1275.fits 1950.0 ___
ngc1275.fits 1.9579677734375E+03 2.0000000000000E+03
ngc127507WS.fits 1.9579677734375E+03 2.0000000000000E+03
northupeastleft.fits 1950.0 ___
test0002.fits 1996.5 ___
test1.fits ___ 1950.00
wcstest.fits 1950.0 ___
wfpctest.fits ___ 2000.0
$
4. Multiple parameters from list of FITS and IRAF files
Get the image sizes from the NAXIS, NAXIS1, and NAXIS2 header keywords from
a list of FITS and IRAF files, printing the output in tab table format:
$ gethead -th @testlist naxis naxis1 naxis2
FILENAME NAXIS NAXIS1 NAXIS2
-------- ----- ------ ------
1.695012J.fits 2 0 0
M9108MI.fits 2 353 353
dsstest.fits 2 177 177
eastupnorthleft.fits 2 1022 1023
foo.fits 2 299 296
galcen.iras12.fits 3 80 80
gc.fits 2 300 300
ipactest.fits 3 80 80
m31.fits 3 80 80
m31x.fits 2 300 300
m51.fits 2 320 512
n1275.fits 2 1024 1024
ngc1275.fits 2 353 353
ngc127507WS.fits 2 352 352
northupeastleft.fits 2 1022 1022
test0002.fits 2 1776 10
test1.fits 2 300 300
u23t0202t.fits 2 800 800
w1mj0101t.fits 2 800 800
wcstest.fits 2 512 512
wfpctest.fits 2 800 800
$
5. Reading keywords from a compressed FITS image file
Extract the DATE and DATE-OBS keyword values from a gzipped FITS file
in verbose mode so that the keyword names are listed. This illustrates
the use of the stdin filename to accept input from standard input.
$ gzcat newdate.fits.gz | gethead -v stdin date date-obs
GETHEAD 3.5.0, 29 October 2003, Doug Mink (dmink@cfa.harvard.edu)
Print Header Parameter Values from FITS image file stdin
DATE = 1997-07-25
DATE-OBS = 1979-09-19
$
Last updated 29 October 2003 by
Doug Mink
[WCSTools]
[WCSTools programs]
[gethead]