# NOT RUN {
require(FITSio)
## Either download example file from
## <https://fits.gsfc.nasa.gov/fits_samples.html>
## and use
# }
# NOT RUN {
filename <- "IUElwp25637mxlo.fits"
# }
# NOT RUN {
## or, for local example use
filename <- system.file("fitsExamples", "IUElwp25637mxlo.fits",
package = "FITSio")
## 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 <- readFITSbintable(zz, header)
close(zz)
## Look at contents
str(D)
str(header)
str(parseHdr(header))
D$hdr[which(D$hdr=="BITPIX")+1] # BITPIX value from header
D$colNames
plot(D$col[[5]], ylab = "Value", main = D$colNames[5], type = "l")
# }
Run the code above in your browser using DataLab