| MATLAB Function Reference | ![]() |
info = fitsinfo(filename)
info = fitsinfo(filename) returns the structure, info, with fields that contain information about the contents of a Flexible Image Transport System (FITS) file. filename is a string enclosed in single quotes that specifies the name of the FITS file.
The info structure contains the following fields, listed in the order they appear in the structure. In addition, the info structure can also contain information about any number of optional file components, called extensions in FITS terminology. For more information, see FITS File Extensions.
Field Name | Description | Return Type |
|---|---|---|
Name of the file | String | |
File modification date | String | |
Size of the file in bytes | Double | |
List of extensions in the file in the order that they occur | Cell array of strings | |
Information about the primary data in the FITS file | Structure array |
The PrimaryData field is a structure that describes the primary data in the file. The following table lists the fields in the order they appear in the structure.
Field Name | Description | Return Type |
|---|---|---|
Precision of the data | String | |
Array containing the size of each dimension | Double array | |
Size of the primary data in bytes | Double | |
Value used to represent undefined data | Double | |
Value, used with Slope, to calculate actual pixel values from the array pixel values, using the equation: actual_value = Slope*array_value + Intercept | Double | |
Value, used with Intercept, to calculate actual pixel values from the array pixel values, using the equation: actual_value = Slope*array_value + Intercept | Double | |
Number of bytes from beginning of the file to the location of the first data value | Double | |
A number-of-keywords-by-3 cell array containing keywords, values, and comments of the header in each column | Cell array of strings |
A FITS file can also include optional extensions. If the file contains any of these extensions, the info structure can contain these additional fields.
AsciiTable — Numeric information in tabular format, stored as ASCII characters
BinaryTable — Numeric information in tabular format, stored in binary representation
Image — A multidimensional array of pixels
Unknown — Nonstandard extension
The AsciiTable structure contains the following fields, listed in the order they appear in the structure.
Field Name | Description | Return Type |
|---|---|---|
Number of rows in the table | Double | |
Number of characters in each row | Double | |
Number of fields in each row | Double array | |
A 1-by-NFields cell containing formats in which each field is encoded. The formats are FORTRAN-77 format codes. | Cell array of strings | |
A 1-by-NFields cell containing precision of the data in each field | Cell array of strings | |
A 1-by-NFields array containing the number of characters in each field | Double array | |
A 1-by-NFields array of numbers representing the starting column for each field | Double array | |
Size of the data in the table in bytes | Double | |
A 1-by-NFields array of numbers used to represent undefined data in each field | Cell array of strings | |
A 1-by-NFields array of numbers used along with Slope to calculate actual data values from the array data values using the equation: actual_value = Slope*array_value+Intercept | Double array | |
A 1-by-NFields array of numbers used with Intercept to calculate true data values from the array data values using the equation: actual_value = Slope*array_value+Intercept | Double array | |
Number of bytes from beginning of the file to the location of the first data value in the table | Double | |
A number-of-keywords-by-3 cell array containing all the Keywords, Values and Comments in the ASCII table header | Cell array of strings |
The BinaryTable structure contains the following fields, listed in the order they appear in the structure.
Field Name | Description | Return Type |
|---|---|---|
Number of rows in the table | Double | |
Number of bytes in each row | Double | |
Number of fields in each row | Double | |
A 1-by-NFields cell array containing the data type of the data in each field. The data type is represented by a FITS binary table format code. | Cell array of strings | |
A 1-by-NFields cell containing precision of the data in each field | Cell array of strings | |
A 1-by-NFields array, where each element contains the number of values in the Nth field | Double array | |
Size of the data in the Binary Table, in bytes. Includes any data past the main table. | Double | |
An 1-by-NFields array of numbers used to represent undefined data in each field | Cell array of double | |
A 1-by-NFields array of numbers used along with Slope to calculate actual data values from the array data values using the equation: actual_value = slope*array_value+Intercept | Double array | |
A 1-by-NFields array of numbers used with Intercept to calculate true data values from the array data values using the equation: actual_value = Slope*array_value+Intercept | Double array | |
Number of bytes from beginning of the file to the location of the first data value | Double | |
Size of any data past the main table, in bytes | Double | |
Number of bytes from the beginning of the file to any data past the main table | Double | |
A number-of-keywords-by-3 cell array containing all the Keywords, values, and comments in the Binary Table header | Cell array of strings |
The Image structure contains the following fields, listed in the order they appear in the structure.
Field Name | Description | Return Type |
|---|---|---|
Precision of the data | String | |
Array containing sizes of each dimension | Double array | |
Size of the data in the Image extension in bytes | Double | |
Number of bytes from the beginning of the file to the first data value | Double | |
Value used to represent undefined data | Double | |
Value, used with Slope, to calculate actual pixel values from the array pixel values, using the equation: actual_value = Slope*array_value+Intercept | Double | |
Value, used with Intercept, to calculate actual pixel values from the array pixel values, using the equation: actual_value = Slope*array_value + Intercept | Double | |
A number-of-keywords-by-3 cell array containing all the Keywords, values, and comments in the Binary Table header | Cell array of strings |
The Unknown structure contains the following fields, listed in the order they appear in the structure.
Field Name | Description | Return Type |
|---|---|---|
Precision of the data | String | |
Sizes of each dimension | Double array | |
Size of the data in nonstandard extensions, in bytes | Double | |
Number of bytes from beginning of the file to the first data value | Double | |
Representation of undefined data | Double | |
Value, used with Slope, to calculate actual data values from the array data values, using the equation: actual_value = Slope*array_value+Intercept | Double | |
Value, used with Intercept, to calculate actual data values from the array data values, using the equation: actual_value = Slope*array_value+Intercept | Double | |
A number-of-keywords-by-3 cell array containing all the Keywords, values, and comments in the Binary Table header | Cell array of strings |
Use fitsinfo to obtain information about the FITS file tst0012.fits. In addition to its primary data, the file also contains an example of the extensions BinaryTable, Unknown, Image, and AsciiTable.
S = fitsinfo('tst0012.fits');
S =
Filename: [1x71 char]
FileModDate: '12-Mar-2001 18:37:46'
FileSize: 109440
Contents: {'Primary' 'Binary Table' 'Unknown'
'Image' 'ASCII Table'}
PrimaryData: [1x1 struct]
BinaryTable: [1x1 struct]
Unknown: [1x1 struct]
Image: [1x1 struct]
AsciiTable: [1x1 struct]The PrimaryData field describes the data in the file. For example, the Size field indicates the data is a 102-by-109 matrix.
S.PrimaryData
DataType: 'single'
Size: [102 109]
DataSize: 44472
MissingDataValue: []
Intercept: 0
Slope: 1
Offset: 2880
Keywords: {25x3 cell}The AsciiTable field describes the AsciiTable extension. For example, using the FieldWidth and FieldPos fields you can determine the length and location of each field within a row.
S.AsciiTable
ans =
Rows: 53
RowSize: 59
NFields: 8
FieldFormat: {'A9' 'F6.2' 'I3' 'E10.4' 'D20.15' 'A5' 'A1' 'I4'}
FieldPrecision: {1x8 cell}
FieldWidth: [9 6.2000 3 10.4000 20.1500 5 1 4]
FieldPos: [1 11 18 22 33 54 54 55]
DataSize: 3127
MissingDataValue: {'*' '---.--' ' *' [] '*' '*' '*' ''}
Intercept: [0 0 -70.2000 0 0 0 0 0]
Slope: [1 1 2.1000 1 1 1 1 1]
Offset: 103680
Keywords: {65x3 cell}![]() | finish | fitsread | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |