PRO plotqlif,year,month,day !ORDER=1 ; Set up OS-specific items @isitdos date=STRING(year MOD 100,month,day,FORMAT='(3I2.2)') OPENR,aflun,qlroot+dd+date+qlif_suffix,/GET_LUN ; reopen it for reading qlif=ASSOC(aflun,BYTARR(128,129)) qlifstat=FSTAT(aflun) nbytes=qlifstat.SIZE nframes=nbytes/16512 psname=qlroot+dd+date+qlif_ps_suffix psopen,psname,/landscape ; open the quick-look images PostScript file pix2dev=2540./300 ; scale factor: PS pixels/image pixel xedge=21*128*pix2dev ; right edge of image plot on page xlim=!D.X_SIZE ; right edge of plottable area on page tbase=xlim-2*!D.Y_CH_SIZE ; base of plot title ; print image plot title and date/time of plot file creation down right ; side of plot title='CNSR Polar Camera '+ymd2date(year,month,day,FORMAT='d$ n$ y$') XYOUTS,tbase,!D.Y_SIZE/2,title $ ,CHARSIZE=2.,ORIENTATION=270.,/DEVICE,ALIGNMENT=0.5 XYOUTS,xedge+(tbase-xedge-!D.Y_CH_SIZE)/2.,!D.Y_SIZE/2,SYSTIME() $ ,ORIENTATION=270.,/DEVICE,ALIGNMENT=0.5 cs=0.75 ct=2. camlabels=[0,0] firsttimes=-1 FOR j=0,nframes-1 DO BEGIN qli=qlif(j) IF MAX(qli(0:127)) NE 0 THEN BEGIN ; at least 1 non-null char in header ; => image exists! qlih=STRING(BYTE(qli,0,128)) ; get header qli=REFORM(BYTE(qli,128,16384),128,128) ; and image div112=j/112 ; major column number xpos=((div112*7 + j MOD 7)*128) ; minor col. # * pix/image ypos=((15-(j-112*div112)/7)*128); rows count down, PS counts up mtv,ROTATE(qli,5),xpos,ypos,/dev,res=300. ; plot image ; let mtv handle scaling from image pixels to PS pixels xpos=xpos*pix2dev ypos=ypos*pix2dev ; label first Cam 0 and Cam 1 dark frames plotted with camera number IF ((j MOD 14 LE 1) AND (NOT camlabels(0)) OR $ (j MOD 14 LE 8) AND (NOT camlabels(1))) THEN BEGIN ul=STRMID(qlih,0,1) XYOUTS,xpos,ypos+128*pix2dev-cs*!D.Y_CH_SIZE,ul $ ,CHARSIZE=cs,ALIGNMENT=0.0,/DEVICE,CHARTHICK=ct camlabels(FIX(ul))=1 ENDIF ; label first Cam 0 image from each hour with UT hour IF (j MOD 14 LE 1) THEN BEGIN ll=STRMID(qlih,6,2)+'UT' XYOUTS,xpos,ypos,ll $ ,CHARSIZE=cs,ALIGNMENT=0.0,/DEVICE,CHARTHICK=ct ENDIF ; label all dark frames from first hour plotted with exposure times atdf=WHERE((j MOD 14) EQ [0,1,7,8]) IF atdf(0) NE -1 THEN BEGIN IF firsttimes EQ -1 THEN firsttimes=j/14 IF j/14 EQ firsttimes THEN BEGIN ur=STRTRIM(STRMID(qlih,18,3),2)+'s' XYOUTS,xpos+128*pix2dev,ypos+128*pix2dev-cs*!D.Y_CH_SIZE,ur $ ,CHARSIZE=cs,ALIGNMENT=1.0,/DEVICE,CHARTHICK=ct ENDIF ENDIF ENDIF ENDFOR CLOSE,aflun & FREE_LUN,aflun psclose SPAWN,rmcmd+qlroot+dd+date+qlif_suffix IF NOT dos THEN BEGIN CD,'/jasper/cnsr3_data1/ql' SPAWN,'/jasper/cnsr3_data1/scripts/rmps3 '+date+qlif_ps_suffix+' n' CD,'/jasper/cnsr3_data1' SPAWN,'lpr -l -Pps -s '+psname ENDIF RETURN END