readFITStable: Read a FITS ASCII table

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/readFITStable.R

Description

Read a FITS ASCII table from an open connection to a FITS file.

Usage

1
readFITStable(zz, hdr)

Arguments

zz

File handle; see Example.

hdr

Header card images, raw or parsed.

Details

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.

Value

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.

Note

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.

Author(s)

Andrew Harris

References

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

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

See Also

readFITS, readFITSheader, readFITSarray, file

Examples

 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

FITSio documentation built on May 29, 2017, 1:07 p.m.