Cfitsio Toolkit - fitsread
- :
data
=fitsread(filename)
- :
data
=fitsread(filename, 'raw')
- :
data
=fitsread(filename, extname)
- :
data
=fitsread(filename, extname, index)
- :
data
=fitsread(filename, ____, propertyname, propertyvalue)
Read the primary data, or specified extension data. It scales the data and applied Nan to any undefined values.
Inputs
filename - filename to open.
exttype - can be ’primary’, ’asciitable’, ’binarytable’, ’image’, ’unknown’.
index - can be used to specify which table when more than one of a given type exists.
’raw’- If the ’raw’ keyword is used, the raw data from the file will be used without replacing undefined values with Nan
Known property names are:
- Info
input info from fitsinfo call.
- PixelRegion
pixel region to extract data for in an image. It expects a cell array of same size as the number of axis in the image. Each cell should be in vector format of: start, [start stop] or [start, increment, stop].
- TableColumns
A list of columns to extract from a ascii or binary table.
- TableRows
A list of rows to extract from an ascii or binary table.
Outputs
data - The read data from the table or image.
Examples
filename = file_in_loadpath("demos/tst0012.fits"); # read the primary image data imagedata = fitsread(filename); # read the 1st non primary image imagedata = fitsread(filename, "image"); # read the first binary table, selected columns tbldata = fitsread(filename, "binarytable", "TableColumns", [1 2 11]); # read the first ascii table atbldata = fitsread(filename, "asciitable");