MATLAB Function Reference Previous page   Next Page
fitsread

Extract data from FITS file

Syntax

Description

data = fitsread(filename) reads the primary data of the Flexible Image Transport System (FITS) file specified by filename. Undefined data values are replaced by NaN. Numeric data are scaled by the slope and intercept values and are always returned in double precision.

data = fitsread(filename, extname) reads data from a FITS file according to the data array or extension specified in extname. You can specify only one extname. The valid choices for extname are shown in the following table.

Data Arrays or Extensions
extname
Description
'primary'
Read data from the primary data array.
'table'
Read data from the ASCII Table extension.
'bintable'
Read data from the Binary Table extension.
'image'
Read data from the Image extension.
'unknown'
Read data from the Unknown extension.

data = fitsread(filename, extname, index) is the same as the above syntax, except that if there is more than one of the specified extension type extname in the file, then only the one at the specified index is read.

data = fitsread(filename, 'raw', ...) reads the primary or extension data of the FITS file, but, unlike the above syntaxes, does not replace undefined data values with NaN and does not scale the data. The data returned has the same class as the data stored in the file.

Example

Read FITS file tst0012.fits into a 109-by-102 matrix called data.

Here is the beginning of the data read from the file.

Read only the Binary Table extension from the file.

See Also

fitsinfo


Previous page  fitsinfo fix Next page

© 1994-2005 The MathWorks, Inc.