MATLAB Function Reference Previous page   Next Page
fitsinfo

Return information about FITS file

Syntax

Description

S = fitsinfo(filename) returns a structure whose fields contain information about the contents of a Flexible Image Transport System (FITS) file. filename is a string that specifies the name of the FITS file.

The structure S contains the following fields.

Information Returned from a Basic FITS File
Field Name
Description
Return Type
Contents
List of extensions in the file in the order that they occur
Cell array of strings
FileModDate
File modification date
String
Filename
Name of the file
String
FileSize
Size of the file in bytes
Double
PrimaryData
Information about the primary data in the FITS file
Structure array

A FITS file can also include any number of optional components, called extensions, in FITS terminology. To provide information about these extensions, the structure S can also include one or more of the following structure arrays.

Additional Information Returned from FITS Extensions
Field Name
Description
Return Type
AsciiTable
ASCII Table extensions
Structure array
BinaryTable
Binary Table extensions
Structure array
Image
Image extensions
Structure array
Unknown
Nonstandard extensions
Structure array

The tables that follow show the fields of each of the structure arrays that can be returned by fitsinfo.



Fields of the PrimaryData Structure Array
Field Name
Description
Return Type
DataSize
Size of the primary data in bytes
Double
DataType
Precision of the data
String
Intercept
Value, used with Slope, to calculate actual pixel values from the array pixel values
Double
Keywords
Keywords, values, and comments of the header in each column
Cell array of strings
MissingDataValue
Value used to represent undefined data
Double
Offset
Number of bytes from beginning of the file to the first data value
Double
Size
Sizes of each dimension
Double array
Slope
Value, used with Intercept, to calculate actual pixel values from the array pixel values
Double


Fields of the AsciiTable Structure Array
Field Name
Description
Return Type
DataSize
Size of the data in the ASCII Table in bytes
Double
FieldFormat
Formats in which each field is encoded, using FORTRAN-77 format codes
Cell array of strings
FieldPos
Starting column for each field
Double array
FieldPrecision
Precision in which the values in each field are stored
Cell array of strings
FieldWidth
Number of characters in each field
Double array
Intercept
Values, used with Slope, to calculate actual data values from the array data values
Double array
Keywords
Keywords, values, and comments in the ASCII table header
Cell array of strings
MissingDataValue
Representation of undefined data in each field
Cell array of strings
NFields
Number of fields in each row
Double array
Offset
Number of bytes from beginning of the file to the first data value
Double
Rows
Number of rows in the table
Double
RowSize
Number of characters in each row
Double
Slope
Values, used with Intercept, to calculate actual data values from the array data values
Double array


Fields of the BinaryTable Structure Array
Field Name
Description
Return Type
DataSize
Size of the data in the Binary Table, in bytes. Includes any data past the main part of the Binary Table.
Double
ExtensionOffset
Number of bytes from the beginning of the file to any data past the main part of the Binary Table
Double
ExtensionSize
Size of any data past the main part of the Binary Table, in bytes
Double
FieldFormat
Data type for each field, using FITS binary table format codes
Cell array of strings
FieldPrecision
Precisions in which the values in each field are stored
Cell array of strings
FieldSize
Number of values in each field
Double array
Intercept
Values, used with Slope, to calculate actual data values from the array data values
Double array
Keywords
Keywords, values, and comments in the Binary Table header
Cell array of strings
MissingDataValue
Representation of undefined data in each field
Cell array of double
NFields
Number of fields in each row
Double
Offset
Number of bytes from beginning of the file to the first data value
Double
Rows
Number of rows in the table
Double
RowSize
Number of bytes in each row
Double
Slope
Values, used with Intercept, to calculate actual data values from the array data values
Double array


Fields of the Image Structure Array
Field Name
Description
Return Type
DataSize
Size of the data in the Image extension in bytes
Double
DataType
Precision of the data
String
Intercept
Value, used with Slope, to calculate actual pixel values from the array pixel values
Double
Keywords
Keywords, values, and comments in the Image header
Cell array of strings
MissingDataValue
Representation of undefined data
Double
Offset
Number of bytes from the beginning of the file to the first data value
Double
Size
Sizes of each dimension
Double array
Slope
Value, used with Intercept, to calculate actual pixel values from the array pixel values
Double


Fields of the Unknown Structure Array
Field Name
Description
Return Type
DataSize
Size of the data in nonstandard extensions, in bytes
Double
DataType
Precision of the data
String
Intercept
Value, used with Slope, to calculate actual data values from the array data values
Double
Keywords
Keywords, values, and comments in the extension header
Cell array of strings
MissingDataValue
Representation of undefined data
Double
Offset
Number of bytes from beginning of the file to the first data value
Double
Size
Sizes of each dimension
Double array
Slope
Value, used with Intercept, to calculate actual data values from the array data values
Double

Example

Use fitsinfo to obtain information about FITS file tst0012.fits. In addition to its primary data, the file also contains three extensions: Binary Table, Image, and ASCII Table.

The PrimaryData substructure shows that the data resides in a 102-by-109 matrix of single-precision values. There are 44,472 bytes of primary data starting at an offset of 2,880 bytes from the start of the file.

Examining the ASCII Table substructure, you can see that this table has 53 rows, 59 columns, and contains 8 fields per row. The last field in each row, for example, begins in the 55th column and contains a 4-digit integer.

The ASCII Table includes 65 keyword entries arranged in a 65-by-3 cell array.

One of the entries in this cell array is shown here. Each row of the array contains a keyword, its value, and comment.

See Also

fitsread


Previous page  finish fitsread Next page

© 1994-2005 The MathWorks, Inc.