STScI Logo

fgread fitsutil



fgread -- MEF file dearchiver


fgread input list output


Multiextension FITS file (MEF).
List or range of extensions numbers to extract. To get a listing of the MEF file to find out the exact numbering, please use fgread extract=no; this output listing is the one to use. Other listing like fxheader should not be use since they will expand the MEF FILE, giving a larger running numbering.
List of filenames to extract
verbose = yes
Print information about each input file processed.
extract = yes
Extract the listed extension from the input MEF
replace = yes
Replace existing files
types = ""
Select input filenames by file type. The possible types are:
	t: text
	b: binary
	d: directory
	s: symbolic link
	f: single FITS file
	m: Multiple Extension FITS file (MEF)

The default value is to select all types.
exclude = ""
Exclude input filenames by file type. The file type are the same as above. Default action is to not exclude any type.
checksum = no
Computes CHECKSUM and DATASUM. The default value is no. If the value is yes the task looks for the keyword CHECKSUM and DATASUM and then calculates the checksum for the data portion and for the whole file and compares these values with the above mentioned keywords values. For the algoritm to calculate checksum, please see: ""


Fgread is the program to dearchive a MEF file created by fgwrite. Mainly FOREIGN extension are handled properly by filtering all the FG keyword and restoring the properties of the extracted file as close as possible to the original's. No count of the number of extensions is given, rather, the MEF group consist of all subsequent extensions until an EHU is encountered which starts a new file.


1) Restore extension 2 and 5 from the MEF file mef.fits. First look at listing for the exact extension numbers.

   cl> fgread mef.fits "" "" extract- 
   cl> fgread mef.fits 2,5 ""

   Notice the double quote symbols to indicate a null list of output
   files since we want to extract extension 2 and 5.

2) Extract log1.txt, log2.txt and obs23.fits extensions from the input MEF file.

cl> fgread mef.fits "" log1.txt,log2.txt,obs23.fits




Source Code · Search Form · STSDAS