23.06.2015 Views

MATLAB Programming

MATLAB Programming

MATLAB Programming

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7 Working with Scientific Data Formats<br />

Flexible Image Transport System (FITS) Files<br />

<strong>MATLAB</strong> includes functions that let you import data using the Flexible Image<br />

Transport System (FITS) format. FITS is the standard data format used<br />

in astronomy, endorsed by both NASA and the International Astronomical<br />

Union (IAU). FITS is designed to store scientific data sets consisting of<br />

multidimensional arrays (1-D spectra, 2-D images, or 3-D data cubes) and<br />

two-dimensional tables containingrowsandcolumnsofdata.<br />

A data file in FITS format can contain multiple components, each marked<br />

by an ASCII text header followed by binary data. The first component in a<br />

FITS file is known as the primary, which can be followed by any number<br />

of other components, called extensions, in FITS terminology. For more<br />

information about the FITS standard, go to the official FITS Web site,<br />

http://fits.gsfc.nasa.gov/.<br />

The <strong>MATLAB</strong> FITS functions are described in the following sections:<br />

• “Getting Information About FITS Files” on page 7-8<br />

• “Importing Data from a FITS File” on page 7-9<br />

Getting Information About FITS Files<br />

To get information about the contents of a FITS file, use the fitsinfo<br />

function. The fitsinfo function returns a structure containing the<br />

information about the file and detailed information about the data in the file.<br />

This example returns information about a sample FITS file included with<br />

<strong>MATLAB</strong>. The structure returned contains fields for the primary component,<br />

PrimaryData, and all the extensions in the file, such as the BinaryTable,<br />

Image, andAsciiTable extensions.<br />

info = fitsinfo('tst0012.fits')<br />

info =<br />

Filename: 'tst0012.fits'<br />

FileModDate: '12-Mar-2001 18:37:46'<br />

FileSize: 109440<br />

Contents: {1x5 cell}<br />

7-8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!