axVec {FITSio}R Documentation

Generate axis vector for image

Description

axVec generates a vector of axis values from variables contained in a FITS image file header.

Usage

axVec(nax = 1, axDat)

Arguments

nax index number of the axis.
axDat data table axis variables produced by readFITSarray (which is also contained in readFITS).

Details

Run once for each axis needed.

Value

A vector with length equal to the number of pixels along the axis. Vector values v are:

v = (1 - CRPIXn times CDELTn) + CRVALn

where CRPIXn, CDELTn, and CVALn are the reference pixel, pixel increment, and reference pixel value for each axis n, following the FITS standard.

Author(s)

Andrew Harris

References

Hanisch et al., Astron. Astrophys. 376, 359-380 (2001)

http://fits.gsfc.nasa.gov/

See Also

readFITS, readFITSarray

Examples

require("FITSio")
Z <- matrix(1:15, ncol = 3)
writeFITSim(Z, file = 'test.fits', c1 = 'Test FITS file',
            crpix = c(1,1), crvaln = c(10, 100), cdeltn = c(8, 2),
            ctypen = c('Distance', 'Time'),
            cunitn = c('Furlongs', 'Fortnights'))
X <-  readFITS('test.fits')
ax1 <- axVec(1, X$axDat)
ax2 <- axVec(2, X$axDat)
xlab <- X$axDat$ctype[1]
ylab <- paste(X$axDat$ctype[2], " [", X$axDat$cunit[2], "]", sep = "")
image(ax1, ax2, X$imDat, xlab = xlab, ylab = ylab)
unlink("test.fits")

[Package FITSio version 1.0-2 Index]