Read a binary table from a FITS file directly into an R data frame.
existing FITS file name.
position of Header and Data Unit (HDU) in FITS file: 1 for the first HDU, 2 for the second HDU, etc.
readFrameFromFITS reads a single binary table Header and Data Unit
(HDU) pair from a file and returns the values as a data table.
Binary table bit, complex, and array descriptor data types are not implemented in this release due to a lack of examples for testing.
An R data frame with the contents of the requested binary table.
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.
Eric H.\ Neilsen, Jr.
Hanisch et al., Astron.\ Astrophys. 376, 359-380 (2001)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
require(FITSio) ## Either download example file from ## <http://fits.gsfc.nasa.gov/fits_samples.html> ## and use ## Not run: filename <- "IUElwp25637mxlo.fits" ## or, for local example use filename <- system.file("fitsExamples", "IUElwp25637mxlo.fits", package = "FITSio") ## Get data and display F <- readFrameFromFITS(filename) names(F) plot(F$NET, ylab = "Value", main = names(F), type = "l") ### Simple flat file example filename <- system.file("fitsExamples", "2008_03_11_203150.fits", package = "FITSio") F <- readFrameFromFITS(filename) names(F) attach(F) plot(DMJD, TiltX, xlab = "Time [DMJD]", ylab = "X Tilt [degr]", type = "l") detach(F)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.