; ; This program plots a daily summary of the arm 2d variables. ; pro plot_average_daily_2d_arm_sub,site,base_time,time_offset,$ ReflectivityBestEstimate,temp,MeanDopplerVelocity,$ pressure,SpectralWidth,ReflectivityPossiblePoints,$ ReflectivityCloudyPoints,height,rh,reflectivity ;************************************** ; Transpose 2d arrays ;************************************** ReflectivityBestEstimate=transpose(ReflectivityBestEstimate) temp=transpose(temp) MeanDopplerVelocity=transpose(MeanDopplerVelocity) pressure=transpose(pressure) SpectralWidth=transpose(SpectralWidth) ReflectivityPossiblePoints=transpose(ReflectivityPossiblePoints) ReflectivityCloudyPoints=transpose(ReflectivityCloudyPoints) rh=transpose(rh) reflectivity=transpose(reflectivity) s=size(reflectivity) dz=make_array(/float,s[1],s[2],value=-9999) result=where(ReflectivityBestEstimate gt -8888,count) if count gt 0 then begin dz[result]=reflectivity[result]-ReflectivityBestEstimate[result] endif ;************************************** ; Commons ;************************************** ; Color common common colors,r_orig,g_orig,b_orig,r_curr,g_curr,b_curr ;***************************************** ; Constants ;***************************************** ; Missing data value missing=-8888 ; Nocloud value nocloud=-9999 ; Mplflag value mplflag=-9000 ; Seconds in a day sec_per_day=double(24L*60L*60L) ; Get IDL julian day of day 1 day1=julday(1,1,1970,0,0,0) ; Get the size of the arrays numtimes=n_elements(time_offset) numheights=n_elements(height) ; Convert height from meters to km height=height/1000.0 ;*********************************** ; Convert time to julian day for plotting ;*********************************** ; Calculate julian_day julian_day=double(day1+(base_time+time_offset)/sec_per_day) ; Array of standard dates caldat,julian_day,mm,dd,yyyy,hour,minute,second ; Starting date and time syear=yyyy[0] smonth=mm[0] sday=dd[0] shour=hour[0] smin=minute[0] ssec=second[0] ; Ending date and time eyear=yyyy[numtimes-1] emonth=mm[numtimes-1] eday=dd[numtimes-1] ehour=hour[numtimes-1] emin=minute[numtimes-1] esec=second[numtimes-1] ;******************************** ; Set up the plot device ;******************************** ; Set up the device set_plot,'z' ; xsize of the plot window xwin=800 ; ysize of the plot window ywin=800 ; Size the window device,set_resolution=[xwin,ywin] ;******************************** ; Set up the colors ; 0-253 rainbow ; 254 gray ; 255 white ;******************************** ; Load the color table loadct,39 ; Top is the last color to scale top_color=252 ; make hot pink for mplflag data in color 253 r_curr[253]=255 g_curr[253]=20 b_curr[253]=147 ; Make gray for missing data in color 253 r_curr[254]=200 g_curr[254]=200 b_curr[254]=200 ; Make the background white !p.background=!d.n_colors-1 ;******************************** ; Set up the plot ;******************************** ; Date label format dummy=label_date(date_format=['%H:%I']) ; Xticks point out from plot !x.ticklen=-0.02 ; Charsizes tsz=1.2 cbsz=0.8 !y.charsize=0.8 ;******************************** ; Position vectors ;******************************** xl=0.05 & xr=0.94 yb=0.05 & yt=0.94 sx=0.08 ;x buffer space sy=0.00 ;0.05 ;y buffer space numplots_x=2 ;number of plots in x direction numplots_y=5 ;number of plots in y direction position_plots,xl,xr,yb,yt,sx,sy,numplots_x,numplots_y,pos ; String positioning dr=0.09 ;string offset from the right xcoor dl=0.025 ;string offset from the left xcoor dt=0.025 ;string offset from the top ycoor ;********************************** ; Plot 0 - reflectivity ;********************************** ; Plot location pnum=0 ; Find the valid data result=where(ReflectivityBestEstimate gt missing,count) if count gt 0 then begin ReflectivityBestEstimate[result]=ReflectivityBestEstimate[result]/100.0 endif ; Find the max and min data values dmax=20.0 dmin=-60.0 ; Bytscl the data image=bytscl(ReflectivityBestEstimate,top=top_color,max=dmax,min=dmin) ; Put all no cloud values to white result=where(ReflectivityBestEstimate eq nocloud,count) if count gt 0 then image[result]=255 ; Put all missing data to gray result=where(ReflectivityBestEstimate eq missing,count) if count gt 0 then image[result]=254 ; Put all mplflag data to hot pink result=where(ReflectivityBestEstimate eq mplflag,count) if count gt 0 then image[result]=253 ; Set up the plot space contour,ReflectivityBestEstimate,julian_day,height,/nodata,$ xstyle=4,ystyle=4,position=pos[pnum,*] ; Grab the plot location px=!x.window*!d.x_vsize py=!y.window*!d.y_vsize sx=px[1]-px[0]+1 sy=py[1]-py[0]+1 ; Put up the image tv,congrid(image,sx,sy),px[0],py[0] ; Put up the axes contour,ReflectivityBestEstimate,julian_day,height,xstyle=1,ystyle=1,$ color=0,xtickunits='time',xtickformat='label_date',/nodata,$ ytitle='Height (km)',position=pos[pnum,*],/noerase xyouts,pos[pnum,0]+dl,pos[pnum,3]-dt,'reflectivity DbZ',$ color=0,/normal,charsize=tsz xyouts,pos[pnum,0]+0.2,pos[pnum,3]-dt,'mplmask',$ color=253,/normal,charsize=tsz ; Color bar cbpos=[(pos[pnum,2]+0.050),(pos[pnum,1]+0.02),$ (pos[pnum,2]+0.055),(pos[pnum,3]-0.02)] colorbar_fanning,maxrange=dmax,minrange=dmin,$ ncolors=254,format='(F6.2)',divisions=4,$ vertical=1,color=0,position=cbpos,charsize=cbsz ;********************************** ; Plot 2 - reflectivity with added dbze for attenuation ;********************************** ; Plot location pnum=2 ; Find the valid data result=where(reflectivity gt missing,count) if count gt 0 then begin reflectivity[result]=reflectivity[result]/100.0 endif ; Find the max and min data values dmax=20.0 dmin=-60.0 ; Bytscl the data image=bytscl(reflectivity,top=top_color,max=dmax,min=dmin) ; Put all no cloud values to white result=where(reflectivity eq nocloud,count) if count gt 0 then image[result]=255 ; Put all missing data to gray result=where(reflectivity eq missing,count) if count gt 0 then image[result]=254 ; Put all mplflag data to hot pink result=where(reflectivity eq mplflag,count) if count gt 0 then image[result]=253 ; Set up the plot space contour,reflectivity,julian_day,height,/nodata,$ xstyle=4,ystyle=4,position=pos[pnum,*],/noerase ; Grab the plot location px=!x.window*!d.x_vsize py=!y.window*!d.y_vsize sx=px[1]-px[0]+1 sy=py[1]-py[0]+1 ; Put up the image tv,congrid(image,sx,sy),px[0],py[0] ; Put up the axes contour,reflectivity,julian_day,height,xstyle=1,ystyle=1,$ color=0,xtickunits='time',xtickformat='(A1)',/nodata,$ ytitle='Height (km)',position=pos[pnum,*],/noerase xyouts,pos[pnum,0]+dl,pos[pnum,3]-dt,'reflectivity DbZ',$ color=0,/normal,charsize=tsz xyouts,pos[pnum,0]+0.2,pos[pnum,3]-dt,'mplmask',$ color=253,/normal,charsize=tsz ; Color bar cbpos=[(pos[pnum,2]+0.050),(pos[pnum,1]+0.02),$ (pos[pnum,2]+0.055),(pos[pnum,3]-0.02)] colorbar_fanning,maxrange=dmax,minrange=dmin,$ ncolors=254,format='(F6.2)',divisions=4,$ vertical=1,color=0,position=cbpos,charsize=cbsz ;********************************** ; Plot - attenuation ;********************************** ; Plot location pnum=4 ; Find the valid data result=where(dz gt missing,count) if count gt 0 then begin dz[result]=dz[result]/100.0 endif ; Find the max and min data values result=where(dz gt missing,count) if count eq 0 then begin dmax=1.0 dmin=0.0 endif else begin dmax=max(dz[result]) dmin=min(dz[result]) if dmin eq dmax then begin dmax=dmin+1.0 endif endelse ; Bytscl the data image=bytscl(dz,top=top_color,max=dmax,min=dmin) ; Put all no cloud values to white result=where(dz eq nocloud,count) if count gt 0 then image[result]=255 ; Put all missing data to gray result=where(dz eq missing,count) if count gt 0 then image[result]=254 ; Put all mplflag data to hot pink result=where(dz eq mplflag,count) if count gt 0 then image[result]=253 ; Set up the plot space contour,dz,julian_day,height,/nodata,$ xstyle=4,ystyle=4,position=pos[pnum,*],/noerase ; Grab the plot location px=!x.window*!d.x_vsize py=!y.window*!d.y_vsize sx=px[1]-px[0]+1 sy=py[1]-py[0]+1 ; Put up the image tv,congrid(image,sx,sy),px[0],py[0] ; Put up the axes contour,dz,julian_day,height,xstyle=1,ystyle=1,$ color=0,xtickunits='time',xtickformat='(A1)',/nodata,$ ytitle='Height (km)',position=pos[pnum,*],/noerase xyouts,pos[pnum,0]+dl,pos[pnum,3]-dt,'attenuation DbZ',$ color=0,/normal,charsize=tsz ; Color bar cbpos=[(pos[pnum,2]+0.050),(pos[pnum,1]+0.02),$ (pos[pnum,2]+0.055),(pos[pnum,3]-0.02)] colorbar_fanning,maxrange=dmax,minrange=dmin,$ ncolors=254,format='(F6.2)',divisions=4,$ vertical=1,color=0,position=cbpos,charsize=cbsz ;********************************** ; Plot 1 - temperature ;********************************** ; Plot location pnum=1 ; Find the valid data result=where(temp gt missing,count) ; Find the max and min data values dmax=300.0 dmin=200.0 ; Bytscl the data image=bytscl(temp,top=top_color,max=dmax,min=dmin) ; Put all no cloud values to white result=where(temp eq nocloud,count) if count gt 0 then image[result]=255 ; Put all missing data to gray result=where(temp eq missing,count) if count gt 0 then image[result]=254 ; Set up the plot space contour,temp,julian_day,height,/nodata,/noerase,$ xstyle=4,ystyle=4,position=pos[pnum,*] ; Grab the plot location px=!x.window*!d.x_vsize py=!y.window*!d.y_vsize sx=px[1]-px[0]+1 sy=py[1]-py[0]+1 ; Put up the image tv,congrid(image,sx,sy),px[0],py[0] ; Put up the axes contour,temp,julian_day,height,xstyle=1,ystyle=1,$ color=0,xtickunits='time',xtickformat='label_date',$ position=pos[pnum,*],/noerase,/nodata ; Put up the axes contour,temp,julian_day,height,xstyle=4,ystyle=4,$ color=255,xtickunits='time',xtickformat='label_date',$ position=pos[pnum,*],/noerase,$ levels=[200,210,220,240,260,280,300,320,340,360,380],$ c_labels=[1,1,1,1,1,1,1,1,1,1,1],c_charsize=1.0 xyouts,pos[pnum,0]+dl,pos[pnum,3]-dt,'temp Kelvin',$ color=255,/normal,charsize=tsz ; Color bar cbpos=[(pos[pnum,2]+0.050),(pos[pnum,1]+0.02),$ (pos[pnum,2]+0.055),(pos[pnum,3]-0.02)] colorbar_fanning,maxrange=dmax,minrange=dmin,$ ncolors=254,format='(F6.2)',divisions=4,$ vertical=1,color=0,position=cbpos,charsize=cbsz ;********************************** ; Plot 2 - Velocity ;********************************** ; Plot location pnum=6 ; Find the valid data result=where(MeanDopplerVelocity gt missing,count) if count gt 0 then begin MeanDopplerVelocity[result]=MeanDopplerVelocity[result]/10.0 endif ; Find the max and min data values result=where(MeanDopplerVelocity gt missing,count) if count eq 0 then begin dmax=1.0 dmin=0.0 endif else begin dmax=max(MeanDopplerVelocity[result]) dmin=min(MeanDopplerVelocity[result]) if dmin eq dmax then begin dmax=dmin+1.0 endif endelse ; Bytscl the data image=bytscl(MeanDopplerVelocity,top=top_color,max=dmax,min=dmin) ; Put all no cloud values to white result=where(MeanDopplerVelocity eq nocloud,count) if count gt 0 then image[result]=255 ; Put all missing data to gray result=where(MeanDopplerVelocity eq missing,count) if count gt 0 then image[result]=254 ; Set up the plot space contour,MeanDopplerVelocity,julian_day,height,/nodata,$ xstyle=4,ystyle=4,position=pos[pnum,*],/noerase ; Grab the plot location px=!x.window*!d.x_vsize py=!y.window*!d.y_vsize sx=px[1]-px[0]+1 sy=py[1]-py[0]+1 ; Put up the image tv,congrid(image,sx,sy),px[0],py[0] ; Put up the axes contour,MeanDopplerVelocity,julian_day,height,xstyle=1,ystyle=1,$ color=0,xtickunits='time',xtickformat='(A1)',/nodata,$ ytitle='Height (km)',position=pos[pnum,*],/noerase xyouts,pos[pnum,0]+dl,pos[pnum,3]-dt,'doppler velocity mm/s',$ color=0,/normal,charsize=tsz ; Color bar cbpos=[(pos[pnum,2]+0.050),(pos[pnum,1]+0.02),$ (pos[pnum,2]+0.055),(pos[pnum,3]-0.02)] colorbar_fanning,maxrange=dmax,minrange=dmin,$ ncolors=254,format='(F8.2)',$ vertical=1,color=0,position=cbpos,charsize=cbsz ;********************************** ; Plot 3 - pressure ;********************************** ; Plot location pnum=3 ; Find the valid data result=where(pressure gt -8888,count) ; Convert from pascals to millibars if count gt 0 then begin pressure[result]=pressure[result]*0.01 endif ; Find the max and min data values dmax=1000.0 dmin=100.0 ; Bytscl the data image=bytscl(pressure,top=253,max=dmax,min=dmin) ; Put all no cloud values to white result=where(pressure eq nocloud,count) if count gt 0 then image[result]=255 ; Put all missing data to gray result=where(pressure eq missing,count) if count gt 0 then image[result]=254 ; Set up the plot space contour,pressure,julian_day,height,/nodata,/noerase,$ xstyle=4,ystyle=4,position=pos[pnum,*] ; Grab the plot location px=!x.window*!d.x_vsize py=!y.window*!d.y_vsize sx=px[1]-px[0]+1 sy=py[1]-py[0]+1 ; Put up the image tv,congrid(image,sx,sy),px[0],py[0] ; Put up the axes contour,pressure,julian_day,height,xstyle=1,ystyle=1,$ color=0,xtickunits='time',xtickformat='(A1)',$ position=pos[pnum,*],/noerase,/nodata;,$ ;levels=[100,200,300,400,500,600,700,800,900,1000],$ ;c_labels=[1,1,1,1,1,1,1,1,1,1],c_charsize=1.0 contour,pressure,julian_day,height,xstyle=4,ystyle=4,$ color=255,xtickunits='time',xtickformat='(A1)',$ position=pos[pnum,*],/noerase,$ levels=[100,115,150,200,300,400,500,700,900,1000],$ c_labels=[1,1,1,1,1,1,1,1,1,1],c_charsize=1.0 xyouts,pos[pnum,0]+dl,pos[pnum,3]-dt,'pressure mb',$ color=255,/normal,charsize=tsz ; Color bar cbpos=[(pos[pnum,2]+0.050),(pos[pnum,1]+0.02),$ (pos[pnum,2]+0.055),(pos[pnum,3]-0.02)] colorbar_fanning,maxrange=dmax,minrange=dmin,$ ncolors=254,format='(F7.2)',divisions=4,$ vertical=1,color=0,position=cbpos,charsize=cbsz ;********************************************* ; Plot 4 - spectrum ;********************************************* ; Plot location pnum=8 ; Find the valid data result=where(SpectralWidth gt missing,count) if count gt 0 then begin SpectralWidth[result]=SpectralWidth[result]/10.0 endif ; Find the max and min data values result=where(SpectralWidth gt missing,count) if count eq 0 then begin dmax=1.0 dmin=0.0 endif else begin dmax=max(SpectralWidth[result]) dmin=min(SpectralWidth[result]) if dmin eq dmax then begin dmax=dmin+1.0 endif endelse ; Bytscl the data image=bytscl(SpectralWidth,top=253,max=dmax,min=dmin) ; Put all no cloud values to white result=where(SpectralWidth eq nocloud,count) if count gt 0 then image[result]=255 ; Put all missing data to gray result=where(SpectralWidth eq missing,count) if count gt 0 then image[result]=254 ; Set up the plot space contour,SpectralWidth,julian_day,height,/nodata,$ xstyle=4,ystyle=4,position=pos[pnum,*],/noerase ; Grab the plot location px=!x.window*!d.x_vsize py=!y.window*!d.y_vsize sx=px[1]-px[0]+1 sy=py[1]-py[0]+1 ; Put up the image tv,congrid(image,sx,sy),px[0],py[0] ; Put up the axes contour,SpectralWidth,julian_day,height,xstyle=1,ystyle=1,$ color=0,xtickunits='time',xtickformat='(A1)',/nodata,$ ytitle='Height (km)',position=pos[pnum,*],/noerase xyouts,pos[pnum,0]+dl,pos[pnum,3]-dt,'spectrum width mm/s',$ color=0,/normal,charsize=tsz ; Color bar cbpos=[(pos[pnum,2]+0.050),(pos[pnum,1]+0.02),$ (pos[pnum,2]+0.055),(pos[pnum,3]-0.02)] colorbar_fanning,maxrange=dmax,minrange=dmin,$ ncolors=254,format='(F6.2)',$ vertical=1,color=0,position=cbpos,charsize=cbsz ;********************************************* ; Plot reflectp ;********************************************* do_this='no' if do_this eq 'yes' then begin ; Plot location pnum=8 ;if site eq 'sgp' then ReflectivityPossiblePoints=$ ; qc_ReflectivityClutterFlagAllPoints ; Find the valid data result=where(ReflectivityPossiblePoints gt -8888,count) ; Find the max and min data values if count eq 0 then begin dmax=1.0 dmin=0.0 endif else begin dmax=max(ReflectivityPossiblePoints[result]) dmin=min(ReflectivityPossiblePoints[result]) if dmin eq dmax then begin dmax=dmin+1.0 endif endelse ; Bytscl the data image=bytscl(ReflectivityPossiblePoints,top=top_color,max=dmax,min=dmin) ; Put all no cloud values to white result=where(ReflectivityPossiblePoints eq nocloud,count) if count gt 0 then image[result]=255 ; Put all missing data to gray result=where(ReflectivityPossiblePoints eq missing,count) if count gt 0 then image[result]=254 ; Set up the plot space contour,ReflectivityPossiblePoints,julian_day,height,/nodata,/noerase,$ xstyle=4,ystyle=4,position=pos[pnum,*] ; Grab the plot location px=!x.window*!d.x_vsize py=!y.window*!d.y_vsize sx=px[1]-px[0]+1 sy=py[1]-py[0]+1 ; Put up the image tv,congrid(image,sx,sy),px[0],py[0] ; Put up the axes contour,ReflectivityPossiblePoints,julian_day,height,xstyle=1,ystyle=1,$ color=0,xtickunits='time',xtickformat='(A1)',$ position=pos[pnum,*],/noerase,/nodata xyouts,pos[pnum,0]+dl,pos[pnum,3]-dt,'# possible points',$ color=255,/normal,charsize=tsz ; Color bar cbpos=[(pos[pnum,2]+0.050),(pos[pnum,1]+0.02),$ (pos[pnum,2]+0.055),(pos[pnum,3]-0.02)] colorbar_fanning,maxrange=dmax,minrange=dmin,$ ncolors=254,format='(F7.2)',divisions=4,$ vertical=1,color=0,position=cbpos,charsize=cbsz endif ;********************************************** ; Plot 6 - rh ;********************************************** ; Plot location pnum=5 ; Find the valid data result=where(rh gt -8888,count) ; Find the max and min data values if count eq 0 then begin dmax=1.0 dmin=0.0 endif else begin dmax=max(rh[result]) dmin=min(rh[result]) if dmax eq dmin then dmax=dmin+1.0 endelse ; Bytscl the data image=bytscl(rh,top=top_color,max=dmax,min=dmin) ; Put all no cloud values to white result=where(rh eq nocloud,count) if count gt 0 then image[result]=255 ; Put all missing data to gray result=where(rh eq missing,count) if count gt 0 then image[result]=254 ; Set up the plot space contour,rh,julian_day,height,/nodata,$ xstyle=4,ystyle=4,position=pos[pnum,*],/noerase ; Grab the plot location px=!x.window*!d.x_vsize py=!y.window*!d.y_vsize sx=px[1]-px[0]+1 sy=py[1]-py[0]+1 ; Put up the image tv,congrid(image,sx,sy),px[0],py[0] ; Put up the axes contour,rh,julian_day,height,xstyle=1,ystyle=1,$ color=0,xtickunits='time',xtickformat='(A1)',/nodata,$ position=pos[pnum,*],/noerase ; Title xyouts,pos[pnum,0]+dl,pos[pnum,3]-dt,'rh',$ color=255,/normal,charsize=tsz ; Color bar cbpos=[(pos[pnum,2]+0.050),(pos[pnum,1]+0.02),$ (pos[pnum,2]+0.055),(pos[pnum,3]-0.02)] colorbar_fanning,maxrange=dmax,minrange=dmin,$ ncolors=254,format='(F6.2)',$ vertical=1,color=0,position=cbpos,charsize=cbsz ;********************************************* ; Plot 7 - reflectc ;********************************************* ; Plot location pnum=7 ;if site eq 'sgp' then ReflectivityCloudyPoints=$ ; qc_ReflectivityClutterFlagCloudyPoints ; Find the valid data result=where(ReflectivityCloudyPoints gt missing,count) ; Find the max and min data values if count eq 0 then begin dmax=1.0 dmin=0.0 endif else begin dmax=max(ReflectivityCloudyPoints[result]) dmin=min(ReflectivityCloudyPoints[result]) if dmin eq dmax then begin dmax=dmin+1.0 endif endelse ; Bytscl the data image=bytscl(ReflectivityCloudyPoints,top=top_color,max=dmax,min=dmin) ; Put all no cloud values to white result=where(ReflectivityCloudyPoints eq nocloud,count) if count gt 0 then image[result]=255 ; Put all missing data to gray result=where(ReflectivityCloudyPoints eq missing,count) if count gt 0 then image[result]=254 ; Set up the plot space contour,ReflectivityCloudyPoints,julian_day,height,/nodata,/noerase,$ xstyle=4,ystyle=4,position=pos[pnum,*] ; Grab the plot location px=!x.window*!d.x_vsize py=!y.window*!d.y_vsize sx=px[1]-px[0]+1 sy=py[1]-py[0]+1 ; Put up the image tv,congrid(image,sx,sy),px[0],py[0] ; Put up the axes contour,ReflectivityCloudyPoints,julian_day,height,xstyle=1,ystyle=1,$ color=0,xtickunits='time',xtickformat='(A1)',$ position=pos[pnum,*],/noerase,/nodata xyouts,pos[pnum,0]+dl,pos[pnum,3]-dt,'# cloudy points',$ color=255,/normal,charsize=tsz ; Color bar cbpos=[(pos[pnum,2]+0.050),(pos[pnum,1]+0.02),$ (pos[pnum,2]+0.055),(pos[pnum,3]-0.02)] colorbar_fanning,maxrange=dmax,minrange=dmin,$ ncolors=254,format='(F7.2)',divisions=4,$ vertical=1,color=0,position=cbpos,charsize=cbsz ;********************************************** ; Plot 8 - column cloud fraction ;********************************************** ; Plot location pnum=8 do_this='no' if do_this eq 'yes' then begin ; Plot the data plot,julian_day,column_cfrac,/noerase,$ xstyle=1,ystyle=1,position=pos[pnum,*],color=0,psym=-4,$ yrange=[0,120],xtickunits='time',xtickformat='(A1)',$ ytitle='%' oplot,julian_day,column_cfrac_mpl,color=250 xyouts,pos[pnum,0]+dl,pos[pnum,3]-dt,$ 'column cloud fraction mmr',$ color=0,/normal,charsize=tsz xyouts,pos[pnum,0]+0.33,pos[pnum,3]-dt,$ 'mpl',$ color=250,/normal,charsize=tsz endif ;********************************************** ; Plot 9 - cloud fraction ;********************************************** ; Plot location pnum=9 ; ; Calculate cloud fraction ; ; First if statement for cloud fraction w/o clutter ;if site eq 'twpc1' or site eq 'twpc2' then begin ; Percentage of points that are cloudy data=float(ReflectivityCloudyPoints)/float(ReflectivityPossiblePoints)*100. ; Where possible points is 0, there is missing data. ; Where possible points is -8888, there is missing data ; Give these points the missing data value,-8888,gray result=where(ReflectivityPossiblePoints le 0.0 or ReflectivityPossiblePoints eq missing,count) print,'ReflectivityPossiblePoints is 0 for ',count,' points' if count ne 0 then data[result]=missing ; Second if statement for cloud fraction with clutter ;endif else if site eq 'sgp' or site eq 'crystal' or $ ; site eq 'twpc3' or site eq 'nsa' then begin ; Percentage of points that are cloudy ; data=float(qc_ReflectivityClutterFlagCloudyPoints)/float;(qc_ReflectivityClutterFlagAllPoints)*100. ; Where possible points is 0, there is missing data. ; Where possible points is -8888, there is missing data. ; Give these points the missing data value,-8888,gray ; result=where(qc_ReflectivityClutterFlagAllPoints eq 0.0 or $ ; qc_ReflectivityClutterFlagAllPoints eq missing,count) ; print,'allclutter is 0 for ',count,' points' ; if count ne 0 then data[result]=missing ; ;endif ; ; End of cloud fraction calculation ; ; Find the valid data result=where(data gt -8888,count) ; Find the max and min data values if count eq 0 then begin dmax=1.0 dmin=0.0 endif else begin dmax=max(data[result]) dmin=min(data[result]) if dmin eq dmax then begin dmax=dmin+1.0 endif endelse ; Bytscl the data image=bytscl(data,top=top_color,max=dmax,min=dmin) ; Put all no cloud values to white result=where(data eq -9999,count) if count gt 0 then image[result]=255 ; Put all missing data to gray result=where(data eq -8888,count) if count gt 0 then image[result]=254 ; Set up the plot space contour,data,julian_day,height,/nodata,/noerase,$ xstyle=4,ystyle=4,position=pos[pnum,*] ; Grab the plot location px=!x.window*!d.x_vsize py=!y.window*!d.y_vsize sx=px[1]-px[0]+1 sy=py[1]-py[0]+1 ; Put up the image tv,congrid(image,sx,sy),px[0],py[0] ; Put up the axes contour,data,julian_day,height,xstyle=1,ystyle=1,$ color=0,xtickunits='time',xtickformat='(A1)',$ position=pos[pnum,*],/noerase,/nodata xyouts,pos[pnum,0]+dl,pos[pnum,3]-dt,'cloud fraction %',$ color=255,/normal,charsize=tsz ; Color bar cbpos=[(pos[pnum,2]+0.050),(pos[pnum,1]+0.02),$ (pos[pnum,2]+0.055),(pos[pnum,3]-0.02)] colorbar_fanning,maxrange=dmax,minrange=dmin,$ ncolors=top_color,format='(F7.2)',divisions=4,$ vertical=1,color=0,position=cbpos,charsize=cbsz ;************************************ ; Plot title and keys ;************************************ ; Add a title if smonth eq 1 then smon='Jan' if smonth eq 2 then smon='Feb' if smonth eq 3 then smon='Mar' if smonth eq 4 then smon='Apr' if smonth eq 5 then smon='May' if smonth eq 6 then smon='Jun' if smonth eq 7 then smon='Jul' if smonth eq 8 then smon='Aug' if smonth eq 9 then smon='Sep' if smonth eq 10 then smon='Oct' if smonth eq 11 then smon='Nov' if smonth eq 12 then smon='Dec' if site eq 'sgp' then begin capsite='SGP' endif else if site eq 'nsa' then begin capsite='NSA' endif else if site eq 'twpc1' then begin capsite='TWP Manus' endif else if site eq 'twpc2' then begin capsite='TWP Nauru' endif else if site eq 'twpc3' then begin capsite='TWP Darwin' endif str_year=string(syear,format='(I4)') str_month=string(smonth,format='(I02)') str_day=string(sday,format='(I02)') title_str=capsite+$ '!C'+str_day+' '+smon+' '+str_year xyouts,0.5,0.97,align=0.5,charsize=1.7,/normal,color=0,$ title_str write_gif,'test_data.gif',tvrd( ) end