| Contents | Index |
data = fitsread(filename)
data = fitsread(filename,extname)
data = fitsread(filename,extname,index)
data = fitsread(filename,Name,Value)
data = fitsread(filename) reads the primary data of the Flexible Image Transport System (FITS) file specified by the text string filename. The function replaces undefined data values with NaN and scales numeric data by the slope and intercept values, always returning double precision values.
data = fitsread(filename,extname) reads data from the FITS file extension specified by extname.
data = fitsread(filename,extname,index) reads data from the FITS file extension specified by extname . If there is more than one of the specified extensions in the file, index specifies the one to read.
data = fitsread(filename,Name,Value) reads data from the FITS file with additional options specified by one or more Name,Value pair arguments.
Specify optional comma-separated pairs of Name,Value arguments, where Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.
'info' |
info structure returned by fitsinfo specifying the location of data to read. |
'PixelRegion' |
Cell array {rows,cols,...} specifying the boundaries of a subimage region to read from the file. Each dimension (rows, cols) is a vector of 1-based indices given either as START, [START STOP], or [START INCREMENT STOP]. This parameter is valid only for primary or image extensions. |
'raw' |
Specifies that fitsread should not scale the data read from the file or replace undefined values with NaN. Data read from the file is the same class as it is stored in the file. |
'TableColumns' |
Vector of 1-based indices specifying the columns to read from the ASCII or Binary table extension. This vector should contain unique and valid indices into the table data specified in increasing order. This parameter is valid only for ASCII or Binary extensions. |
'TableRows' |
Vector of 1-based indices specifying the rows to read from the ASCII or Binary table extension. This vector should contain unique and valid indices into the table data specified in increasing order. This parameter is valid only for ASCII or Binary extensions. |
data |
Data returned from the FITS file. |
A FITS file contains primary data and can optionally contain any number of optional components, called extensions in FITS terminology.
Read primary data from FITS file
data = fitsread('tst0012.fits');
Name Size Bytes Class Attributes
data 109x102 88944 doubleInspect available extensions, read 'image' extension using the extname option.
info = fitsinfo('tst0012.fits');
% List of contents, includes any extensions if present.
disp(info.Contents);
imageData = fitsread('tst0012.fits','image');Subsample the fifth plane of 'image' extension by 2.
info = fitsinfo('tst0012.fits');
rowend = info.Image.Size(1);
colend = info.Image.Size(2);
primaryData = fitsread('tst0012.fits','image',...
'Info', info,...
'PixelRegion',{[1 2 rowend], [1 2 colend], 5 });Read every other row from an ASCII table.
info = fitsinfo('tst0012.fits');
rowend = info.AsciiTable.Rows;
tableData = fitsread('tst0012.fits','asciitable',...
'Info',info,...
'TableRows',[1:2:rowend]);
Read all data for the first, second and fifth columns of the Binary table.
info = fitsinfo('tst0012.fits');
rowend = info.BinaryTable.Rows;
tableData = fitsread('tst0012.fits','binarytable',...
'Info',info,...
'TableColumns',[1 2 5]);

Explore how to use MATLAB to make advancements in engineering and science.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |