PRO plottlog,year,month,day,camera,ps=ps,keep=keep ; ; Look for specified temperature log file ; If found, open it and read the contents ; Prompt the user for the temperature data to plot ; Set up the plot window ; Plot the data IF N_PARAMS() EQ 3 THEN BEGIN ; Set up OS-specific items @isitdos ; Go to appropriate subdirectory of ~cnsr3/log yd=STRING(year MOD 100,FORMAT='(I2)') IF month LT 10 THEN mchar=STRTRIM(month,2) $ ELSE mchar=STRING(BYTE(month-10)+BYTE('a')) suffix=STRING(mchar,day,FORMAT='(A1,I2.2)') path=tlogroot+dd+yd+dd+suffix CD,path ; Locate the correct file path=path+dd+'asctemp1.'+suffix f=FINDFILE(path+'*',COUNT=nf) IF nf GE 1 THEN f=f(0) ELSE BEGIN MESSAGE,'Cannot find '+path,/INFORMATIONAL RETURN ENDELSE ; If the temperature log file has been gzipped, gunzip it IF STRPOS(f,'z') NE -1 THEN SPAWN,gzipcmd+'-d -v '+f ; Does the temperature log file actually exist? tlog=FINDFILE(path,COUNT=ntlog) IF ntlog EQ 1 THEN BEGIN OPENR,logunit,path,/GET_LUN loginfo=FSTAT(logunit) FREE_LUN,logunit goodfile=(loginfo.SIZE GT 1000) ENDIF ELSE goodfile=0B ; Use 'awk' to extract individual parameter records IF goodfile THEN BEGIN SPAWN,rmcmd+'t*' ; remove any remnants of previous runs SPAWN,rmcmd+'h*' breakout_command=awk_cmd+' -f '+awk_src+' '+path SPAWN,breakout_command ; run 'awk' to create files for ; individual parameters ; Plot individual parameters !P.MULTI=[0,0,2,0,0] IF KEYWORD_SET(ps) THEN BEGIN psfile='tlog'+dc+suffix+'.ps' psopen,psfile DEVICE,YSIZE=9.0,YOFFSET=1.0,/INCHES ENDIF ELSE BEGIN WINDOW,0,XSIZE=640,YSIZE=900 loadct,0,/silent ENDELSE ct0,year,month,day,/oneday ct1,year,month,day,/oneday IF KEYWORD_SET(ps) THEN BEGIN psclose IF NOT dos THEN SPAWN,'~steele/scripts/rmps3 '+psfile+' b' ENDIF ; Delete individual parameter records and gzip temperature log to save space IF NOT KEYWORD_SET(keep) THEN BEGIN SPAWN,rmcmd+'h*' SPAWN,rmcmd+'t*' ENDIF SPAWN,gzipcmd+'-v '+path ENDIF ELSE MESSAGE,'No temperature log found!',/INFORMATIONAL ENDIF ELSE PRINT,'Wrong number of arguments - should be 3!' RETURN END