; $Id: readnist.pro,v 1.3 2002/02/25 14:46:39 jmspark Exp $
function readnist,filen

;this is not just a test

; OUPUTS:
;               a data structure consisting of:
;                 d.points - integer - # of points in scan
;                 d.heads - integer - # of header parameters
;                 d.pars - integer - # of scan parameters
;                 d.text - string array - 2 lines of descriptive text
;                 d.hdef - string array - definition of header parameters
;                 d.hnum - float array - header parameters
;                 d.prp - string array - definition of scan parameters
;                 d.data - 2D float array - scan data (parameter,point#)

;d={points:0,heads:0,pars:0,text:STRARR(2),hdef:STRARR(30),  $
;   hnum:FLTARR(30),prp:STRARR(30),data:FLTARR(30,5000)}

junk=''

openr,unit,filen,/get_lun

;read in the data from the first line and the second line

readf,unit,junk
free_lun, unit		;close the file
junk		=	strtrim(junk,2)
jj		=	strmid(junk,36,1)

if (jj eq 'Q') or (jj eq 'T') then 				$
d=readnistq(filen)						$
else if jj eq 'I' then						$
d=readnisti(filen)						$
else if jj eq 'B' then						$
d=readnistb(filen)

return,d


end