Learn R Programming

FITSio (version 2.1-6)

readFITStable: Read a FITS ASCII table

Description

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

Usage

readFITStable(zz, hdr)

Arguments

zz

File handle; see Example.

hdr

Header card images, raw or parsed.

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.

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.

References

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

https://fits.gsfc.nasa.gov/

See Also

readFITS, readFITSheader, readFITSarray, file

Examples

Run this code
# NOT RUN {
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

# }

Run the code above in your browser using DataLab