;+ ; NAME: ; DUCALL ; PURPOSE: ; Distributed 'uncompressing' of all compressed Polar Camera ; image files acquired on a given date. ; CATEGORY: ; ; CALLING SEQUENCE: ; DUCALL, YEAR, MONTH, DAY [, SCRIPT=script] [, QUIET=quiet] $ ; [, NORUN=norun] ; INPUTS: ; YEAR, ; MONTH, ; DAY: Numeric inputs specifying the date for which the ; image files are to be uncompressed. ; OPTIONAL INPUTS: ; None. ; KEYWORD PARAMETERS: ; /SCRIPT: Set this keyword if uncompressing is to be done ; by 'csh' scripts SPAWNed by IDL. The default is ; to SPAWN each individual 'uncompress' command ; individually, which wastes time in processing all ; the SPAWN requests. ; /QUIET: If set, the IDL procedures WRILIST and WEEDOUT are ; executed with minimal screen output. The default ; is to allow all output. ; /NORUN: Set this keyword if you want to generate the ; uncompression commands (and script) for inspection, ; but don't wish to run the script. Used mostly for ; debugging. ; OUTPUTS: ; None. ; OPTIONAL OUTPUTS: ; None. ; COMMON BLOCKS: ; None. ; SIDE EFFECTS: ; All available image files for the given day are uncompressed ; to their standard lengths. ; RESTRICTIONS: ; Since the image file names specify only the day, but not ; the month and year, all files sharing the given day number ; will be uncompresed together. The WRILIST and WEEDOUT ; procedures are specific to the single day specified, however, ; so any files from other days that are accidentally uncompressed ; will not appear in the image list. ; This procedure can only be run on a Unix host in the ISR ; network, as it specifically uses hosts 'jasper' and 'smith' ; to run the uncompressing scripts. ; PROCEDURE: ; Each directory that may contain compressed image files is ; searched for any files from the given date. A list of such ; files is created, and for each file, the Unix 'csh' command ; appropriate to uncompress the file is formed. If the ; /SCRIPT keyword is set, the command is stored into the ; appropriate script, otherwise the command is SPAWNed for ; immediate execution. After all images are uncompressed, ; the WRILIST procedure is executed to generate a merged ; image list of all image pairs acquired on the given date. ; Then the WEEDOUT procedure is executed to remove any corrupt ; files, and regenerate the merged image list. ; EXAMPLE: ; DUCALL, 1994, 10, 23, /SCRIPT, /QUIET ; SEE ALSO: ; WRILIST.PRO, WEEDOUT.PRO, FINKFILE.PRO ; MODIFICATION HISTORY: ; Written by: D P Steele, Winter 1994 ; Modified by: D P Steele, Fall 1994 ; Documented by: D P Steele, 941129 ;- PRO ducall,yr,mo,day,script=script,quiet=quiet,norun=norun IF N_PARAMS() LT 3 THEN BEGIN MESSAGE,'Usage: ducall,yr,mo,day',/INFORMATIONAL RETURN ENDIF ds=STRING(day,FORMAT='(I2.2)') IF KEYWORD_SET(script) THEN BEGIN OPENW,jscrunit,'/jasper/cnsr3_data1/scripts/uc'+ds+'j',/GET_LUN PRINTF,jscrunit,'#! /bin/csh -f' OPENW,sscrunit,'/jasper/cnsr3_data1/scripts/uc'+ds+'s',/GET_LUN PRINTF,sscrunit,'#! /bin/csh -f' ENDIF jtncf=0 stncf=0 start=SYSTIME(1) ; First uncompress the airglow-type images FOR jfilt=0,4 DO BEGIN ; Loop through the available Camera 0 filters fn=STRING(jfilt,FORMAT='(I1)') filename='/jasper/cnsr3_data1/air/c0/f'+fn+'/t'+ds+'0'+fn+'060.???' cf=finkfile(filename,COUNT=ncf) IF ncf GE 1 THEN $ FOR k=0,ncf-1 DO BEGIN uncompress,cf(k),/rm,script=script IF KEYWORD_SET(script) THEN PRINTF,sscrunit,script ENDFOR stncf=stncf+ncf ENDFOR FOR jfilt=0,4 DO BEGIN ; Loop through the available Camera 1 filters fn=STRING(jfilt,FORMAT='(I1)') filename='/jasper/cnsr3_data1/air/c1/f'+fn+'/t'+ds+'1'+fn+'060.???' cf=finkfile(filename,COUNT=ncf) IF ncf GE 1 THEN $ FOR k=0,ncf-1 DO BEGIN uncompress,cf(k),/rm,script=script IF KEYWORD_SET(script) THEN PRINTF,jscrunit,script ENDFOR jtncf=jtncf+ncf ENDFOR ; Then do the auroral-type images, if any cf=finkfile('/jasper/cnsr3_data1/aur/c0/f2/n'+ds+'020??.???',COUNT=ncf) IF ncf GE 1 THEN $ FOR k=0,ncf-1 DO BEGIN uncompress,cf(k),/rm,script=script IF KEYWORD_SET(script) THEN PRINTF,sscrunit,script ENDFOR stncf=stncf+ncf cf=finkfile('/jasper/cnsr3_data1/aur/c1/f2/n'+ds+'120??.???',COUNT=ncf) IF ncf GE 1 THEN $ FOR k=0,ncf-1 DO BEGIN uncompress,cf(k),/rm,script=script IF KEYWORD_SET(script) THEN PRINTF,jscrunit,script ENDFOR jtncf=jtncf+ncf ; Then do the dark frames cf=finkfile('/jasper/cnsr3_data1/dk/c0/q'+ds+'0????.???',COUNT=ncf) IF ncf GE 1 THEN $ FOR k=0,ncf-1 DO BEGIN uncompress,cf(k),/rm,script=script IF KEYWORD_SET(script) THEN PRINTF,sscrunit,script ENDFOR stncf=stncf+ncf cf=finkfile('/jasper/cnsr3_data1/dk/c1/q'+ds+'1????.???',COUNT=ncf) IF ncf GE 1 THEN $ FOR k=0,ncf-1 DO BEGIN uncompress,cf(k),/rm,script=script IF KEYWORD_SET(script) THEN PRINTF,jscrunit,script ENDFOR jtncf=jtncf+ncf ; Finally uncompress any calibration files acquired FOR jfilt=0,4 DO BEGIN ; Loop through the available Camera 0 filters fn=STRING(jfilt,FORMAT='(I1)') filename='/jasper/cnsr3_data1/cal/c0/f'+fn+'/t'+ds+'0'+fn+'???.???' cf=finkfile(filename,COUNT=ncf) IF ncf GE 1 THEN $ FOR k=0,ncf-1 DO BEGIN uncompress,cf(k),/rm,script=script IF KEYWORD_SET(script) THEN PRINTF,sscrunit,script ENDFOR stncf=stncf+ncf ENDFOR FOR jfilt=0,4 DO BEGIN ; Loop through the available Camera 1 filters fn=STRING(jfilt,FORMAT='(I1)') filename='/jasper/cnsr3_data1/cal/c1/f'+fn+'/t'+ds+'1'+fn+'???.???' cf=finkfile(filename,COUNT=ncf) IF ncf GE 1 THEN $ FOR k=0,ncf-1 DO BEGIN uncompress,cf(k),/rm,script=script IF KEYWORD_SET(script) THEN PRINTF,jscrunit,script ENDFOR jtncf=jtncf+ncf ENDFOR IF KEYWORD_SET(script) THEN BEGIN FREE_LUN,jscrunit FREE_LUN,sscrunit PRINT,stncf,'smith',jtncf,'jasper' $ ,FORMAT='(2(I4," files to be uncompressed by ",A/))' IF (NOT KEYWORD_SET(norun)) AND (stncf+jtncf GT 0) $ THEN SPAWN,'/jasper/cnsr3_data1/scripts/farmout '+ds ENDIF finish=SYSTIME(1) IF NOT KEYWORD_SET(norun) THEN wrilist,yr,mo,day,quiet=quiet IF NOT KEYWORD_SET(norun) THEN weedout,yr,mo,day,quiet=quiet alldone=SYSTIME(1) IF NOT KEYWORD_SET(quiet) THEN BEGIN tncf=stncf+jtncf 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")' IF NOT KEYWORD_SET(norun) THEN 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