; ; clutter.pro plots and image of the reflectivity clutter flag ; pro clutter, curdate ; ; Get the file using the date as an input ; curdate=string(curdate) curdate=strcompress(curdate,/remove_all) ncdf_file='Output/sgp.average.5min.'+curdate+'.000000.cdf' ; ; Open the netcdf file ; cdf_id=ncdf_open(ncdf_file) ; ; Get the dimension id's ; time_did=ncdf_dimid(cdf_id, 'time') height_did=ncdf_dimid(cdf_id, 'height') ; ; Get the dimensions ; ncdf_diminq, cdf_id, time_did, char_string, num_times ncdf_diminq, cdf_id, height_did, char_string, num_heights ; ; Get the variable id's ; baset_id=ncdf_varid(cdf_id, 'base_time') timeo_id=ncdf_varid(cdf_id, 'time_offset') height_id=ncdf_varid(cdf_id, 'height') reflect_id=ncdf_varid(cdf_id, 'ReflectivityBestEstimate') cbase_id=ncdf_varid(cdf_id, 'CloudBaseBestEstimate') ctop_id=ncdf_varid(cdf_id, 'RadarFirstTop') velocit_id=ncdf_varid(cdf_id, 'MeanDopplerVelocity') spectr_id=ncdf_varid(cdf_id, 'SpectralWidth') psp2_id=ncdf_varid(cdf_id, 'psp2') fluxcl_id=ncdf_varid(cdf_id, 'twsflux_clearskyfit') solarra_id=ncdf_varid(cdf_id, 'SolarRatio') lwp_id=ncdf_varid(cdf_id, 'liq') cloud1_id=ncdf_varid(cdf_id,'cloud1') clutter_id=ncdf_varid(cdf_id,'qc_ReflectivityClutterFlagMode') ; ; Get the variables ; if baset_id ne -1 then ncdf_varget, cdf_id, baset_id, base_time if timeo_id ne -1 then ncdf_varget, cdf_id, timeo_id, time_offset ; ; Calculate Julian Date (jday) and Fractional Hour (hrfrac) ; ijday_ihrfrac_fm_numsec,base_time, time_offset, hrfrac, jday, yy,mm,dd,hh,mi,ss if height_id ne -1 then begin ncdf_varget, cdf_id, height_id, height height=height/1000 ;convert from meters to km endif if reflect_id ne -1 then ncdf_varget, cdf_id, reflect_id, reflectivity if cbase_id ne -1 then begin ncdf_varget, cdf_id, cbase_id, cbase result=where(cbase ne -9999, count) if count ne 0 then begin ;cbase[result]=cbase[result]-318 cbase[result]=cbase[result]/1000. ;convert from meters to km endif endif if ctop_id ne -1 then begin ncdf_varget, cdf_id, ctop_id, ctop result=where(ctop ne -9999, count) if count ne 0 then begin ;ctop[result]=ctop[result]+318 ctop[result]=ctop[result]/1000. ;convert from meters to km endif endif if velocit_id ne -1 then begin ncdf_varget, cdf_id, velocit_id, velocity result=where(velocity ne -9999,count) if count ne 0 then begin velocity[result]=velocity[result]/1000. endif endif if spectr_id ne -1 then begin ncdf_varget, cdf_id, spectr_id, spectrum result=where(spectrum ne -9999,count) if count ne 0 then begin spectrum[result]=spectrum[result]/1000. endif endif if psp2_id ne -1 then ncdf_varget, cdf_id, psp2_id, psp2 if fluxcl_id ne -1 then ncdf_varget, cdf_id, fluxcl_id, fluxclear if solarra_id ne -1 then ncdf_varget, cdf_id, solarra_id, solarratio if lwp_id ne -1 then begin ncdf_varget, cdf_id, lwp_id, lwp result=where(lwp ne -9999,count) if count ne 0 then begin lwp[result]=lwp[result]*10000 endif endif if cloud1_id ne -1 then begin ncdf_varget, cdf_id, cloud1_id, cloud1 result=where(cloud1 ne -9999, count) if count ne 0 then begin cloud1[result]=cloud1[result]/1000. ;convert from meters to km endif endif if clutter_id ne -1 then ncdf_varget, cdf_id, clutter_id, clutter ; ; Close the netcdf file ; ncdf_close,cdf_id stop ; ; Start the plot ; !x.margin=[10,3] !y.margin=[3,2] !p.multi=[0,2,3] ;sixplot !p.charsize=2 ;make letters bigger loadct, 5 ;colortable !p.background=!d.n_colors-1 ;change background color to white blanks=[' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '] window,0, xsize=900,ysize=700 stime=hrfrac[0] etime=hrfrac[num_times-1] sheight=height[0] eheight=height[num_heights-1] print,' heights',sheight,eheight print, 'times',stime,etime ; Plot 1 reflectivity=transpose(reflectivity) contour, reflectivity, hrfrac, height, /nodata, $ title='Radar Reflectivity (DbZe)',$ xstyle=1,ystyle=1,$ xmargin=[5,8],$ xrange=[stime,etime],yrange=[sheight,eheight],color=0 px=!x.window*!d.x_vsize py=!y.window*!d.y_vsize sx=px[1]-px[0]+1 sy=py[1]-py[0]+1 image_scale, 'ReflectivityBestEstimate', reflectivity, image,$ stime,etime,hrfrac,sheight,eheight,height,dmax,dmin tv,congrid(image,sx,sy),px[0],py[0] axis,stime,sheight,xaxis=0,color=0,xrange=[stime,etime],xstyle=1 axis,stime,eheight,xaxis=1,color=0,xrange=[stime,etime],xstyle=1,xtickname=blanks axis,stime,sheight,yaxis=0,color=0,yrange=[sheight,eheight],ystyle=1 axis,etime,sheight,yaxis=1,color=0,yrange=[sheight,eheight],ystyle=1,ytickname=blanks oplot,hrfrac,cbase,color=0,thick=2 oplot,hrfrac,ctop,color=0,thick=2, linestyle=2 plots,[(etime-stime)*0.85,(etime-stime)*0.95],[(eheight-sheight)*0.85,(eheight-sheight)*0.85],$ /data,linestyle=2,color=0,thick=2 xyouts,(etime-stime)*0.70,(eheight-sheight)*0.85,$ /data,'Cloud Top',color=0,charsize=1 plots,[(etime-stime)*0.85,(etime-stime)*0.933],[(eheight-sheight)*0.75,(eheight-sheight)*0.75],$ /data,linestyle=0,color=0,thick=2 xyouts,(etime-stime)*0.70,(eheight-sheight)*0.75,$ /data,'Cloud Base',color=0,charsize=1 colorbar,image,dmax,dmin,cb_title,px,py,sx,sy ;oplot,xtime,xcbase,psym=6,color=0,thick=2 ;oplot,xtime,xctop,psym=6, color=0,thick=2 ;xtime=xtime+1 ; Plot 2 if fluxcl_id ne -1 then begin pmax=max(psp2) result=where(psp2 eq -9999,count) if count ne 0 then psp2[result]=1e6 pmin=min(psp2) fmax=max(fluxclear) result=where(fluxclear eq -9999,count) if count ne 0 then fluxclear[result]=1e6 fmin=min(fluxclear) dmax=pmax if fmax gt dmax then dmax=fmax dmin=pmin if fmin lt dmin then dmin=fmin plot, hrfrac, psp2,$ yrange=[dmin,dmax],xrange=[stime,etime],$ xstyle=1,ystyle=1,$ psym=1,$ ytitle='w/m!E2',$ title='BSRN Flux',color=0 oplot, hrfrac, fluxclear,psym=6,color=125 plots,[(etime-stime)*0.32,(etime-stime)*0.32],[(dmax-dmin)*0.86,(dmax-dmin)*0.86],$ /data,psym=1,color=0 xyouts,(etime-stime)*0.05,(dmax-dmin)*0.85,$ /data,'Solar Down - BSRN',color=0,charsize=1 plots,[(etime-stime)*0.32,(etime-stime)*0.32],[(dmax-dmin)*0.76,(dmax-dmin)*0.76],$ /data,psym=6,color=125 xyouts,(etime-stime)*0.05,(dmax-dmin)*0.75,$ /data,'Flux Clear - Long',color=125,charsize=1 ;oplot,xtime,xflux,color=150,psym=5 endif else begin plot, hrfrac, psp2,$ ;yrange=[dmin,dmax],$ xrange=[stime,etime],$ xstyle=1,ystyle=1,$ psym=1,$ ytitle='w/m!E2',$ title='BSRN Flux',color=0 endelse ; Plot 3 velocity=transpose(velocity) contour, velocity, hrfrac, height, /nodata,$ title='Velocity (m/s)',$ xstyle=1,ystyle=1,$ xmargin=[5,8],$ xrange=[stime,etime],yrange=[sheight,eheight],color=0 px=!x.window*!d.x_vsize py=!y.window*!d.y_vsize sx=px[1]-px[0]+1 sy=py[1]-py[0]+1 image_scale, 'MeanDopplerVelocity', velocity, image,$ stime,etime,hrfrac,sheight,eheight,height,dmax,dmin tv,congrid(image,sx,sy),px[0],py[0] axis,stime,sheight,xaxis=0,color=0,xrange=[stime,etime],xstyle=1 axis,stime,eheight,xaxis=1,color=0,xrange=[stime,etime],xstyle=1,xtickname=blanks axis,stime,sheight,yaxis=0,color=0,yrange=[sheight,eheight],ystyle=1 axis,etime,sheight,yaxis=1,color=0,yrange=[sheight,eheight],ystyle=1,ytickname=blanks ;oplot,hrfrac,cbase,color=0,thick=2 ;oplot,hrfrac,ctop,color=0,thick=2, linestyle=2 oplot,hrfrac,cloud1,color=40,thick=3,linestyle=0 plots,[(etime-stime)*0.85,(etime-stime)*0.95],[(eheight-sheight)*0.85,(eheight-sheight)*0.85],$ /data,linestyle=0,color=40,thick=2 xyouts,(etime-stime)*0.63,(eheight-sheight)*0.85,$ /data,'Laser Ceilometer',color=40,charsize=1 colorbar,image,dmax,dmin,cb_title,px,py,sx,sy ; Plot 4 if solarra_id ne -1 then begin plot, hrfrac, solarratio, yrange=[0,1],xrange=[stime,etime],psym=6,$ title='Solar Transmisivity Ratio = BSRN/Long',$ xstyle=1,ystyle=1,color=0 endif else begin plot, hrfrac,psp2,/nodata,xstyle=4,ystyle=4 ;just a place holder endelse ; Plot 5 spectrum=transpose(spectrum) contour, spectrum, hrfrac, height, /nodata,$ title='Spectrum Width (m/s)',$ xtitle='Time (UTC)',$ xstyle=1,ystyle=1,$ xmargin=[5,8],$ xrange=[stime,etime],yrange=[sheight,eheight],color=0 px=!x.window*!d.x_vsize py=!y.window*!d.y_vsize sx=px[1]-px[0]+1 sy=py[1]-py[0]+1 image_scale, 'SpectralWidth', spectrum, image, $ stime,etime,hrfrac,sheight,eheight,height,dmax,dmin tv,congrid(image,sx,sy),px[0],py[0] axis,stime,sheight,xaxis=0,color=0,xrange=[stime,etime],xstyle=1 axis,stime,eheight,xaxis=1,color=0,xrange=[stime,etime],xstyle=1,xtickname=blanks axis,stime,sheight,yaxis=0,color=0,yrange=[sheight,eheight],ystyle=1 axis,etime,sheight,yaxis=1,color=0,yrange=[sheight,eheight],ystyle=1,ytickname=blanks colorbar,image,dmax,dmin,cb_title,px,py,sx,sy ; Plot 6 if lwp_id ne -1 then begin dmax=max(lwp) result=where(lwp eq -9999,count) if count ne 0 then lwp[result]=1e6 dmin=min(lwp) print, dmin,dmax,'lwp' plot, hrfrac, lwp,title='LWP - Microwave Radiometer',ytitle='g/m!E2', xtitle='Time (UTC)',$ xstyle=1,ystyle=1,psym=4,$ yrange=[dmin,dmax],xrange=[stime,etime],color=0 ;oplot, xtime,xlwp,psym=5,color=150 endif giffile=strmid(ncdf_file,0, 33) + 'gif' print, giffile write_gif, giffile, tvrd( ) ;;stop end