readFITSarray {FITSio} | R Documentation |
Read an image (multi-dimensional array) from an open connection to a FITS file.
readFITSarray(zz, hdr)
zz |
file handle; see Example. |
hdr |
vector of header information from readFITSheader . |
readFITSarray
reads the data from the image part of a FITS
Header and Data Unit containing image data. The header must be
read first by readFITSheader
to provide the variable hdr.
A list containing
imDat |
Data array. |
axDat |
Data frame with axis scaling and labels. |
hdr |
Vector with parsed header. |
Graphical FITS viewers such as fv (http://heasarc.gsfc.nasa.gov/ftools/fv/) and SAOImage DS9 (http://hea-www.harvard.edu/RD/ds9/) have excellent facilities for displaying FITS data, headers, and file structure. Having one or more graphical viewers available will prove extremely useful for working with FITS files, even when the data are read into R for further processing. fv and SAOImage DS9 are in active devlopement with support for unix, Windows, and Mac OS-X operating systems, and are available at no cost.
Andrew Harris
Hanisch et al., Astron. Astrophys. 376, 359-380 (2001)
readFITS
, readFITSheader
,
readFITSbintable
, file
require("FITSio") ## Make a test file. Z <- matrix(1:15, ncol = 3) writeFITSim(Z, "test.fits") ## Open file, read header and array, close file and delete. zz <- file(description = "test.fits", open = "rb") hdr <- readFITSheader(zz) # image data off primary header D <- readFITSarray(zz, hdr) close(zz) ## Look at data summary(D) image(D$imDat) ## Delete test file unlink("test.fits")