function eatemp,mission_time,directory ;returns the ea temperature at a given mission time (in seconds) ;by interpolating the houskeeping data ;You can pass a directory or it uses the current Test Log directory. if n_elements(mission_time) eq 0 then print,string(7b),'** Mission time undefined at eatemp **' cd,'',current=cdir & cd,cdir ;establishes cdir as current directory if n_params() eq 1 then dir=cdir else dir=directory cd,dir+'/DB/HKeeping files=findfile(count=nfiles) if nfiles eq 0 then begin print,string(7b),'** no houskeeping files found in: ',dir goto,exit endif data=fltarr(nfiles,2) ;mission time and eatemp for i=0,nfiles-1 do begin d_read,files(i),h,p data(i,*)=[d_value(h,88),d_value(h,135)] ;mission time and eatemp endfor temp=interpol(data(*,1),data(*,0),mission_time) exit: cd,cdir return,temp(0) end