--------------------- API for RFITS LIBRARY --------------------- Version 0.2.2 (13 Dec 2007) Peter Freeman pfreeman@cmu.edu 1) Introduction The RFITS library consists of C functions, accessed via an R interface, that allow one to read in images and binary table columns from FITS format data files. For more information on FITS: http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html 2) R Functions rfits_read_image(file,hdu=1) Description Retrieves an FITS image array from the first applicable extension. Arguments 1 character file name 2 integer extension (block of data within FITS file containing the image) Return Value array double data array (cast to double from short, int, long, float, or double) Attribute of Return Value dim The length of each image axis Example # Retrieve and plot the image in FITS file tsz03_145.fits out = rfits_read_image("tsz03_145.fits") image(out,...) --------------------------------------------------------------------- rfits_read_col(file,col=1,width=1,hdu=2) Description Retrieves an array of data from a FITS binary table column Arguments 1 character file name 2 integer/ column number or name character 3 integer number of elements in column vector 4 integer extension (block of data within FITS file containing the column) Return Value array double data array (cast to double from short, int, long, float, or double) Attributes of Return Value none Example # Read the 5th column of the binary table in the 3rd extension # of foo.fits out = rfits_read_col("foo.fits",col=5,hdu=3) # Read the "Z" column from the default extension of bar.fits out = rfits_read_col("bar.fits",col="Z") --------------------------------------------------------------------- rfits_read_key(file,key,hdu=2) Description Retrieves a keyword value from a FITS header Arguments 1 character file name 2 character keyword 3 integer extension (block of data within FITS file containing the column) Return Value scalar character/ keyword value (cast to double if numeric) double Attributes of Return Value none Example # Read the keyword COEFF0 from the 1st extension of foo.fits wave_lo = rfits_read_key("foo.fits","COEFF0",hdu=1) --------------------------------------------------------------------- rfits_get_col_names(file,hdu=1) Description Retrieves a vector of column names from a FITS binary table extension. Argument 1 character file name 2 integer extension (block of data within FITS file containing the column) Return Value array string vector of column names Attributes of Return Value none --------------------------------------------------------------------- rfits_get_num_hdus(file) Description Retrieves the total number of HDUs in a FITS file. Argument 1 character file name Return Value scalar integer number of HDUs Attributes of Return Value none --------------------------------------------------------------------- rfits_get_hdu_type(file,hdu=1) Description Retrieves the HDU type for a given FITS fits extension Arguments 1 character file name 2 integer extension (PRIMARY <=> hdu=1) Return Value array string "image" for a FITS image extension "binary" for a FITS binary table "ascii" for a FITS ascii table "any" for unknown NULL if the given hdu does not exist Attributes of Return Value none