PRO plot_ql,year,month,day,ps=ps ; This short procedure simply plots out two graphs, each one showing ; the quick-look intensities or differential intensities from one of ; the Polar Camera units, for one UT day. ; ; The output defaults to the X Windows display, unless the ps ; keyword is set. @isitdos CD,!DIR !P.MULTI=[0,0,2,0,0] datafound=0B date=STRING(year MOD 100,month,day,FORMAT='(3I2.2)') IF KEYWORD_SET(ps) THEN BEGIN CD,qlroot psname=date+'ql.ps' psopen,psname DEVICE,YSIZE=9.0,YOFFSET=1.0,/INCHES ENDIF ELSE BEGIN WINDOW,0,XSIZE=640,YSIZE=900 loadct,0,/silent ENDELSE c0ql=rFINDFILE(qlroot+dd+date+'0*.ql',COUNT=nc0) c1ql=rFINDFILE(qlroot+dd+date+'1*.ql',COUNT=nc1) IF (nc0 EQ 0) AND (nc1 EQ 0) THEN BEGIN MESSAGE,'No quick-look files found',/INFORMATIONAL RETURN ENDIF ELSE BEGIN c0ql=c0ql(SORT(c0ql)) c1ql=c1ql(SORT(c1ql)) ENDELSE PLOT,[0,24],[0,1000],/NODATA,XRANGE=[0,24],/XSTYLE $ ,XTICKS=4,XTICKV=[0,6,12,18,24],XMINOR=6 $ ,XTITLE='Universal Time (hours)' $ ,YTITLE='Zenith Brightness (R or R/nm)' $ ,TITLE='Quick Look Plot for Camera 0, ' $ +ymd2date(year,month,day,format='d$ n$ y$') IF nc0 GT 0 THEN BEGIN FOR f=0,nc0-1 DO BEGIN rdcols,c0ql(f),n,t,m,sd IF n GT 0 THEN BEGIN ; Don't plot across gaps longer than 1.5 hours datafound=1B dt=(t-SHIFT(t,1))>0 gap=WHERE(dt GT 5400.) ngap=TOTAL(gap GT 0) IF ngap EQ 0 THEN OPLOT,t/3600.,m,LINESTYLE=f ELSE BEGIN seg=INDGEN(gap(0)) OPLOT,t(seg)/3600.,m(seg),LINESTYLE=f IF ngap GE 2 THEN FOR j=1,ngap-1 DO BEGIN seg=INDGEN(gap(j)-gap(j-1))+gap(j-1) OPLOT,t(seg)/3600.,m(seg),LINESTYLE=f ENDFOR seg=INDGEN(n-gap(ngap-1)+1)+gap(ngap-1) OPLOT,t(seg)/3600.,m(seg),LINESTYLE=f ENDELSE IF NOT KEYWORD_SET(filt0) THEN filt0=[f] ELSE filt0=[filt0,f] ENDIF ENDFOR IF datafound THEN BEGIN ; Plot the lunar elevation to help in interpreting data y=REPLICATE(year,25) mo=REPLICATE(month,25) d=REPLICATE(day,25) h=FINDGEN(25) mi=FLTARR(25) s=mi moonazel,y,mo,d,h,mi,s,maz,mel moonup=(MAX(mel) GT 0.) IF moonup THEN OPLOT,h,mel*10.,PSYM=-6 xdvpos=!P.CLIP(0) ydvpos=!P.CLIP(3) npos=CONVERT_COORD([xdvpos,ydvpos],/DEVICE,/TO_NORMAL) npos=npos(0:1) ; labels='Filter '+STRTRIM(filt0,2) nmpos=STRPOS(filters(filt0),'nm')+2 labels=STRMID(filters(filt0),0,MAX(nmpos)) FOR il=0,N_ELEMENTS(filt0)-1 DO $ labels(il)=STRMID(labels(il),0,nmpos(il)) lines=filt0 syms=REPLICATE(0,N_ELEMENTS(lines)) IF moonup THEN BEGIN labels=[labels,'Moon el.*10'] lines=[lines,0] syms=[syms,-6] ENDIF legend,labels,linestyle=lines,psym=syms,position=npos timestmp ENDIF ENDIF datafound=0B PLOT,[0,24],[0,1000],/NODATA,XRANGE=[0,24],/XSTYLE $ ,XTICKS=4,XTICKV=[0,6,12,18,24],XMINOR=6 $ ,XTITLE='Universal Time (hours)' $ ,YTITLE='Zenith Brightness (R or R/nm)' $ ,TITLE='Quick Look Plot for Camera 1, ' $ +ymd2date(year,month,day,format='d$ n$ y$') IF nc1 GT 0 THEN BEGIN FOR f=0,nc1-1 DO BEGIN rdcols,c1ql(f),n,t,m,sd IF n GT 0 THEN BEGIN ; Don't plot across gaps longer than 1.5 hours datafound=1B dt=(t-SHIFT(t,1))>0 gap=WHERE(dt GT 5400.) ngap=TOTAL(gap GT 0) IF ngap EQ 0 THEN OPLOT,t/3600.,m,LINESTYLE=f ELSE BEGIN seg=INDGEN(gap(0)) OPLOT,t(seg)/3600.,m(seg),LINESTYLE=f IF ngap GE 2 THEN FOR j=1,ngap-1 DO BEGIN seg=INDGEN(gap(j)-gap(j-1))+gap(j-1) OPLOT,t(seg)/3600.,m(seg),LINESTYLE=f ENDFOR seg=INDGEN(n-gap(ngap-1)+1)+gap(ngap-1) OPLOT,t(seg)/3600.,m(seg),LINESTYLE=f ENDELSE IF NOT KEYWORD_SET(filt1) THEN filt1=[f] ELSE filt1=[filt1,f] ENDIF ENDFOR IF datafound THEN BEGIN xdvpos=!P.CLIP(0) ydvpos=!P.CLIP(3) npos=CONVERT_COORD([xdvpos,ydvpos],/DEVICE,/TO_NORMAL) npos=npos(0:1) nmpos=STRPOS(filters(filt1+5),'nm')+2 labels=STRMID(filters(filt1+5),0,MAX(nmpos)) FOR il=0,N_ELEMENTS(filt1)-1 DO $ labels(il)=STRMID(labels(il),0,nmpos(il)) lines=filt1 syms=REPLICATE(0,N_ELEMENTS(lines)) ; legend,'Filter '+STRTRIM(filt1,2),linestyle=filt1,position=npos legend,labels,linestyle=lines,psym=syms,position=npos time_stamp ENDIF ENDIF IF KEYWORD_SET(ps) THEN BEGIN psclose IF NOT dos THEN SPAWN,'~steele/scripts/rmps3 '+psname+' b' ; CD,'/jasper/cnsr3_data1' ENDIF RETURN END