Description Usage Arguments Details Value Author(s) References See Also Examples
axVec
generates a vector of axis values from variables
contained in a FITS image file header.
1 | axVec(nax = 1, axDat)
|
nax |
index number of the axis. |
axDat |
data table axis variables produced by
|
Run once for each axis needed.
A vector with length equal to the number of pixels along the axis. Vector values v[i] for i = 1:NAXISn (NAXISn = len, the vector length, in the axDat data frame) are:
v[i] = (i - CRPIXn) 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.
Andrew Harris
Hanisch et al., Astron.\ Astrophys. 376, 359-380 (2001)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | require(FITSio)
Z <- matrix(1:15, ncol = 3)
filename <- paste(tempdir(), "test.fits", sep="")
writeFITSim(Z, file = filename, 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(filename)
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)
## Clean up files to avoid clutter
unlink(filename)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.