PRO printfst,unit,string_array ; This little routine prints the elements of a string array one ; line at a time to the specified logical unit. FOR k=0,N_ELEMENTS(string_array)-1 DO PRINTF,unit,string_array(k) RETURN END PRO ucall,yr,mo,day,script=script,quiet=quiet,rm=rm IF N_PARAMS() LT 3 THEN BEGIN MESSAGE,'Usage: ucall,yr,mo,day[,/script,/quiet,/rm]',/INFORMATIONAL RETURN ENDIF IF yr LT 100 THEN $ IF yr LT 50 THEN yr=yr+2000 ELSE yr=yr+1900 ds=STRING(day,FORMAT='(I2.2)') ; Set up OS-dependent parameters @isitdos IF KEYWORD_SET(script) THEN BEGIN sname='uc'+ds+s_suffix OPENW,scrunit,sroot+dd+sname,/GET_LUN IF dos THEN PRINTF,scrunit,'@ECHO OFF' ELSE PRINTF,scrunit,'#! /bin/csh -f' ENDIF tncf=0 start=SYSTIME(1) ; First check out the airglow and calibration images it=[2,5] FOR hi=0,1 DO BEGIN tt=imagetype(it(hi)) fc=STRING(BYTE(firstchars(it(hi)))+13B) FOR ic=0,1 DO BEGIN FOR jf=0,4 DO BEGIN gp=iroot+dd+tt+dd ip=STRING(gp,cc,ic,dd,ff,jf,dd,fc,ds,ic,jf $ ,FORMAT='(2A,I1,A1,A,I1,2A1,A2,2I1,"???.???")') cf=finkfile(ip,COUNT=ncf) IF ncf GE 1 THEN $ FOR k=0,ncf-1 DO BEGIN kiexpand,cf(k),rm=rm,script=script IF KEYWORD_SET(script) THEN printfst,scrunit,script ENDFOR ; (k) tncf=tncf+ncf ENDFOR ; (jf) ENDFOR ; (ic) ENDFOR ; (hi) ; Then check out the auroral images tt=imagetype(0) fc=STRING(BYTE(firstchars(0))+13B) FOR ic=0,1 DO BEGIN jf=2 gp=iroot+dd+tt+dd ip=STRING(gp,cc,ic,dd,ff,jf,dd,fc,ds,ic,jf $ ,FORMAT='(2A,I1,A1,A,I1,2A1,A2,2I1,"???.???")') PRINT,ip cf=finkfile(ip,COUNT=ncf) PRINT,ncf IF ncf GE 1 THEN $ FOR k=0,ncf-1 DO BEGIN kiexpand,cf(k),rm=rm,script=script IF KEYWORD_SET(script) THEN printfst,scrunit,script ENDFOR ; (k) tncf=tncf+ncf ENDFOR ; (ic) ; Finally check out the dark frames tt=imagetype(3) fc=STRING(BYTE(firstchars(3))+13B) FOR ic=0,1 DO BEGIN gp=iroot+dd+tt+dd ip=STRING(gp,cc,ic,dd,fc,ds,ic $ ,FORMAT='(2A,I1,A1,A,A2,I1,"????.???")') cf=finkfile(ip,COUNT=ncf) IF ncf GE 1 THEN $ FOR k=0,ncf-1 DO BEGIN kiexpand,cf(k),rm=rm,script=script IF KEYWORD_SET(script) THEN printfst,scrunit,script ENDFOR ; (k) tncf=tncf+ncf ENDFOR ; (ic) ; Sample of how it used to be done ; cf=finkfile('/jasper/cnsr3_data1/air/c0/f1/t'+ds+'01060.???',COUNT=ncf) ; IF ncf GE 1 THEN $ ; FOR k=0,ncf-1 DO BEGIN ; kiexpand,cf(k),rm=rm,script=script ; IF KEYWORD_SET(script) THEN printfst,scrunit,script ; ENDFOR ; tncf=tncf+ncf IF KEYWORD_SET(script) THEN BEGIN CLOSE,scrunit FREE_LUN,scrunit IF dos THEN BEGIN SPAWN,sroot+dd+sname SPAWN,rmcmd+' '+sroot+dd+sname SPAWN,'del c:\idl\data\devnull' ENDIF ELSE BEGIN SPAWN,'chmod 744 /jasper/cnsr3_data1/scripts/uc'+ds SPAWN,'/usr/net/rsh aragorn /jasper/cnsr3_data1/scripts/uc'+ds SPAWN,rmcmd+sroot+dd+sname ENDELSE ENDIF finish=SYSTIME(1) wrilist,yr,mo,day,quiet=quiet weedout,yr,mo,day,quiet=quiet alldone=SYSTIME(1) IF NOT KEYWORD_SET(quiet) THEN BEGIN PRINT,finish-start,tncf $ ,FORMAT='(F6.1," s elapsed in expanding ",I0," files:")' IF tncf GT 0 THEN PRINT,(finish-start)/tncf $ ,FORMAT='(F5.2," s per file")' PRINT,alldone-finish $ ,FORMAT='(F6.1," s elapsed in writing image lists and weeding out bad files")' PRINT,STRING(7B),FORMAT='(A)' ENDIF RETURN END