Scilab Function
Last update : 23/8/2006

fitsinfo - Return information about a FITS file.

Calling Sequence

S = fitsinfo(filename)

Parameters

Description

The tlist 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 Strings matrix
FileModDate File modification date Matrix
Filename Name of the file String
FileSize Size of the file in bytes Double
PrimaryData Information about the primary data in the FITS file Lists

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 tlist
BinaryTable Binary Table extensions tlist
Image Image extensions tlist
Unknown Nonstandard extensions tlist

Fields of the PrimaryData tlist.

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 Strings matrix
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 tlist.

Field Name Description Return Type
DataSize Size of the ASCII Table in bytes Double
FieldFormat Formats in which each field is encoded, using FORTRAN-77 format codes String matrix
FieldPos Starting column for each field Double
FieldPrecision Precision in which the values in each field are stored Strings matrix
FieldWidth Number of characters in each field Double
Intercept Values, used with Slope, to calculate actual data values from the array data values Double
Keywords Keywords, values, and comments in the ASCII table header String matrix
MissingDataValue Representation of undefined data in each field String matrix
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 characters in each row Double
Slope Values, used with Intercept, to calculate actual data values from the array data values Double

Fields of the BinaryTable tlist.

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 Strings matrix
FieldPrecision Precision in which the values in each field are stored Strings matrix
FieldSize Number of values in each field Double
Intercept Values, used with Slope, to calculate actual data values from the array data values Double
Keywords Keywords, values, and comments in the Binary Table header String matrix
MissingDataValue Representation of undefined data in each field 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 characters in each row Double
Slope Values, used with Intercept, to calculate actual data values from the array data values Double

Fields of the Image tlist.

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

Fields of the Unknown tlist.

Field Name Description Return Type
DataSize Size of the data in the nonstandard extensions in bytes Double
DataType Precision of the data String
Intercept Values, used with Slope, to calculate actual data values from the array data values Double
Keywords Keywords, values, and comments in the the extension header String matrix
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
Slope Values, used with Intercept, to calculate actual data values from the array data values Double

Examples

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

	S = fitsinfo('test.fits')
	S  =
		Filename: "test.fits"
		FileModDate: [2001,3,14,12,48]
		FileSize: 109440
		Contents: "Primary  Binary Table  Unknown  Image  ASCII Table  "
		PrimaryData: [9 pri]
		AsciiTable: [14 asc]
		BinaryTable: [1 list]
		Image: [1 list]
		Unknown: [1 list]
	   
	// The PrimaryData substructure shows that the data resides in a 102-by-109 matrix 
	// of single-precision values. There are 44472 bytes of primary data starting at 
	// an offset of 2,880 bytes from the start of the file.

	S.PrimaryData.DataType
	ans  =
		single   
	S.PrimaryData.Size
	ans  =
		102.
		109.
	S.PrimaryData.DataSize
	ans  =
		44472.
 
 

Author

Chen jingyuan, Gan guangyong (IAPCM, Beijing,China.)

See Also

fits_structure ,   fitsread ,   fits_head ,   fits_image_info ,   get_fits_image ,   file_fits ,