;+ ; NAME: ; FITSHDR ; ; PURPOSE: ; Extract, display and write out the header of XTE FITS file(s). ; ; CATEGORY: ; XTE. ; ; CALLING SEQUENCE: ; ; Result = FITSHDR( [File] ) ; ; OPTIONAL INPUTS: ; File: Name of the first XTE FITS file. ; ; OUTPUTS: ; This function returns the header of the last XTE FITS file opened. ; ; OPTIONAL OUTPUTS: ; For each FITS file opened, a corresponding 'header' file may be created ; containing the header information. ; ; MODIFICATION HISTORY: ; Written by: Han Wen, August 1996. ;- function FITSHDR, File header = -1 NP = N_PARAMS() if (NP eq 1) then goto, OPENFIT path = '/usr/local/ek/xray_data/xte/' SELECT: File = PICKFILE(PATH=path, TITLE='Select Fits File:') if (File eq '') then goto, QUIT OPENFIT: fxbopen, lu, File, 1, header & n = N_ELEMENTS(header) fxbclose,lu pos = RSTRPOS(File,'/') path = STRMID(File,0,pos+1) name = STRMID(File,pos+1,10000) xmsg, header, TITLE='Fits file: '+name Fout = PICKFILE(FILE=path+name+'.hdr', PATH=path, $ TITLE='Select OUTPUT FITS header file:') if (Fout ne '') then begin openw, lu, Fout, /GET_LUN for i=0,n-1 do printf,lu,header(i) free_lun, lu endif goto, SELECT QUIT: return, header end