PRO getsens,yr,mo,day,s0,s1,nointeractive=nointeractive ; Initialize OS-specific items @isitdos s0=FLTARR(5) s1=s0 date=STRING(yr MOD 100,mo,day,FORMAT='(3I2.2)') ; Get calibration values for each camera, first 0 then 1 FOR k=0,1 DO BEGIN ; Look for data from the right day first f=rFINDFILE(calsroot+dd+date+dc+STRTRIM(k,2)+cal_suffix,COUNT=nf) IF nf NE 0 THEN calstr=getfile(f(0)) ELSE BEGIN ; No calibration values from the present day, so check other days flist=rFINDFILE(calsroot+dd+'??????'+dc+STRTRIM(k,2)+cal_suffix,COUNT=nf) IF KEYWORD_SET(nointeractive) THEN BEGIN ; Select data from closest day automatically dstart=STRPOS(flist,cal_suffix)-8 jd=INTARR(nf) today=julday(mo,day,(yr MOD 100)+1900) FOR j=0,nf-1 DO BEGIN ymd=LONG(STRMID(flist(j),dstart(j),6)) d=ymd MOD 100 m=(ymd-d)/100 MOD 100 y=ymd/10000 jd(j)=julday(m,d,1900+y) ENDFOR mindiff=MIN(ABS(jd-today),n) ENDIF ELSE BEGIN ; Prompt user for choice of calibration values to use FOR j=0,nf-1 DO PRINT,j,flist(j),FORMAT='(I2,2X,A)' PRINT,'Enter a number for Camera '+STRTRIM(k,2) $ +' sensitivities' READ,n ENDELSE calstr=getfile(flist(n)) ENDELSE ; Read values into the appropriate array IF k EQ 0 THEN FOR j=0,4 DO s0(j)=FLOAT(getwrd(calstr(0),j)) $ ELSE FOR j=0,4 DO s1(j)=FLOAT(getwrd(calstr(0),j)) ENDFOR RETURN END