Description Usage Arguments Details Value Note Author(s) References See Also Examples
Read a FITS ASCII table from an open connection to a FITS file.
1 | readFITStable(zz, hdr)
|
zz |
File handle; see Example. |
hdr |
Header card images, raw or parsed. |
readFITStable
reads the data from the ASCII table part of a FITS
Header and Data Unit (hdu) containing ASCII table data. The header must be
read first by readFITSheader
; either this header or the
parsed version from parseHdr
are valid for the hdr
variable. ASCII tables are multi-column files with one or more rows.
hdr |
Vector with parsed header. |
DF |
Data frame containing table data. |
colNames |
Vector of column names, TTYPEn FITS variable. |
colUnits |
Vector of column units, TUNITn FITS variable. |
TNULLn |
Vector of undefined value definitions, FITS variable. |
TSCALn |
Vector of multipliers for scaling, FITS variable. |
TZEROn |
Vector of zeros for scaling, FITS variable. |
Graphical FITS viewers such as fv (https://heasarc.gsfc.nasa.gov/ftools/fv/) and SAOImage DS9 (http://ds9.si.edu/) 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
,
readFITSarray
, file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | require(FITSio)
filename <- system.file("fitsExamples", "vizier.fits",
package = "FITSio")
## Simple read
D <- readFITS(filename)
## Explicit read: open file, read header and table, close file.
zz <- file(description = filename, open = "rb")
header0 <- readFITSheader(zz) # read primary header
header <- readFITSheader(zz) # read extension header
D <- readFITStable(zz, header)
close(zz)
## Either way, look at contents
str(D)
str(D$DF)
str(header)
str(parseHdr(header))
D$hdr[which(D$hdr=="BITPIX")+1] # BITPIX value from header
D$colNames
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.