FUNCTION iter_eph,date,t0,t1 ; PoCaRun returns 0 at t0, 1 at t1 iter=0 dt0=DOUBLE(t0) dt1=DOUBLE(t1) REPEAT BEGIN t=0.5*(dt0+dt1) run=PoCaRun(sec2hms(t),date) IF run THEN dt1=t ELSE dt0=t iter=iter+1 ENDREP UNTIL (iter EQ 8) RETURN,FLOAT(t) END PRO PoCa_ops,date,debug=dbg dates=STRTRIM(date,2) obs=BYTARR(24) FOR j=0,23 DO obs(j)=BYTE(PoCaRun(sec2hms(3600.*j),dates)) c=obs-SHIFT(obs,1) ; change of operational status if c <> 0 IF N_ELEMENTS(WHERE(c NE 0)) GT 2 THEN STOP,obs IF KEYWORD_SET(dbg) THEN PRINT,c,FORMAT='(12I4)' IF MAX(c) GT 0 THEN BEGIN e=WHERE(c EQ 255) ; end of operations b=WHERE(c EQ 1) ; beginning of ops ; first find end of operations t0=e*3600. t1=(e-1)*3600. tend=iter_eph(dates,t0,t1) PRINT,"Operations ended at " $ +STRTRIM(sec2hms(tend,/round),2) $ +" UT, "+dates ; then find subsequent start of operations t0=(b-1)*3600. t1=b*3600. tstart=iter_eph(dates,t0,t1) PRINT,"Operations restarted at " $ +STRTRIM(sec2hms(tstart,/round),2) $ +" UT, "+dates ENDIF ELSE PRINT,'Polar Camera non-operational less than 1 hour." RETURN END