; ; create the plot of the 5 min averaged data ; pro plot_daily_5min_ciret,site,curdate site=strcompress(site,/remove_all) ; ; Get the file using the date as an input ; curdate=strcompress(curdate,/remove_all) ncdf_file=strcompress('Output/'+site+'.average.5min.'+curdate+'.000000.cdf',/remove_all) ; ; 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') clutter_id=ncdf_varid(cdf_id, 'qc_ReflectivityClutterFlagMode') ciret_iwc_id=ncdf_varid(cdf_id,'IWC_mean') ciret_emiss_id=ncdf_varid(cdf_id,'emissivity_mean') ciret_numtot_id=ncdf_varid(cdf_id,'Number_total_mean') ciret_re_id=ncdf_varid(cdf_id,'radius_effective_mean') ciret_opt_id=ncdf_varid(cdf_id,'fl_vis_opt_depth_mean') ; ; 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 if height_id ne -1 then ncdf_varget, cdf_id, height_id, height if reflect_id ne -1 then ncdf_varget, cdf_id, reflect_id, reflectivity if clutter_id ne -1 then ncdf_varget, cdf_id, clutter_id,clutter if ciret_iwc_id ne -1 then ncdf_varget,cdf_id,ciret_iwc_id,ciret_iwc if ciret_emiss_id ne -1 then ncdf_varget,cdf_id,ciret_emiss_id,ciret_emiss if ciret_numtot_id ne -1 then ncdf_varget,cdf_id,ciret_numtot_id,ciret_numtot if ciret_re_id ne -1 then ncdf_varget,cdf_id,ciret_re_id,ciret_re if ciret_opt_id ne -1 then ncdf_varget,cdf_id,ciret_opt_id,ciret_opt ; ; Close the netcdf file ; ncdf_close,cdf_id ; ; Only continue if there are retrievals ; if ciret_iwc_id ne -1 and ciret_emiss_id ne -1 and $ ciret_numtot_id ne -1 and ciret_re_id ne -1 and $ ciret_opt_id ne -1 then begin ; ; Calculate Julian Date (jday) and Fractional Hour (hrfrac) ; ijday_ihrfrac_fm_numsec,base_time,time_offset,hrfrac,jday,yy,mm,dd,hh,mi,ss ; ; Change height to km ; height=height/1000.0 ; ; Get and filter clutter ; if clutter_id ne -1 then begin result=where(clutter eq 0,count) if count gt 0 then reflectivity[result]=-9999 endif ; ; Change the format of reflectivity ; if reflect_id ne -1 then begin reflectivity=transpose(reflectivity) ; reflectivity=float(reflectivity) ; result=where(reflectivity gt -9999,count) ; if count ne 0 then reflectivity[result]=reflectivity[result]/100. endif ;*********************** ; Set up the plot ;*********************** !p.multi=[0,1,1] !p.charsize=1.2 ;make letters bigger loadct, 5 ;colortable !p.background=!d.n_colors-1 ;change background color to white window,0, xsize=600,ysize=800,/pixmap ;stime=hrfrac[0] result=where(ciret_re gt -9999,count) stime=hrfrac[result[0]] ;etime=hrfrac[num_times-1] etime=hrfrac[result[n_elements(result)-1]] sheight=height[0] eheight=height[num_heights-1] print,' heights',sheight,eheight print, 'times',stime,etime ; ; Set up place holder plot ; holdx=[0,1] holdy=[0,1] ; ; Create the position vectors ; pos1=[0.15,0.75,0.85,0.9] pos2=[0.15,0.55,0.85,0.7] pos3=[0.15,0.35,0.85,0.5] pos4=[0.15,0.15,0.85,0.3] ;********* ; Plot 1 ;********* if reflect_id ne -1 then begin contour, reflectivity, hrfrac, height, /nodata, $ title='Radar Reflectivity (DbZe)',$ xstyle=1,ystyle=1,color=0,ytitle='Height (km)',$ xrange=[stime,etime],yrange=[sheight,eheight],$ position=pos1,/normal 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,$ xtickformat='(A1)' axis,stime,sheight,yaxis=0,color=0,yrange=[sheight,eheight],ystyle=1 axis,etime,sheight,yaxis=1,color=0,yrange=[sheight,eheight],ystyle=1,$ ytickformat='(A1)' colorbar,'ReflectivityBestEstimate',image,dmax,dmin,cb_title,px,py,sx,sy endif ;end of plot 1 ;********* ; Plot 2 ;********* if ciret_iwc_id ne -1 then begin dmax=max(ciret_iwc) result=where(ciret_iwc eq -9999,count) if count ne 0 then ciret_iwc[result]=1e6 dmin=min(ciret_iwc) dmax=100 dmin=0.1 print,'iwc',dmax,dmin plot,hrfrac,ciret_iwc*1000.0,/noerase,/ylog,$ yrange=[dmin,dmax],xrange=[stime,etime],$ xstyle=1,ystyle=1,psym=4,title='Ice Water Content',$ ytitle='IWC (mg/m!E3!N)',color=0,$ position=pos2 endif else begin plot,holdx,holdy,/nodata xyouts,0.5,0.5,'No Ciret IWC',/data,color=0,alignment=0.5 endelse ;****************************************************** ; Plot 3 - Effective Radius and Number Concentration ;****************************************************** if ciret_re_id ne -1 then begin ; convert ciret_re to microns result=where(ciret_re gt -9999,count) if count gt 0 then ciret_re[result]=ciret_re[result]*1000.0 ; determine the data min max range for ciret_re dmax=max(ciret_re) result=where(ciret_re eq -9999,count) if count ne 0 then ciret_re[result]=1e6 dmin=min(ciret_re) dmax=120 dmin=0 ; plot ciret_re plot,hrfrac,ciret_re,/noerase,$ yrange=[dmin,dmax],xrange=[stime,etime],$ xstyle=1,ystyle=8,psym=4,title='Size & Concentration',$ ytitle='R_eff (um)',color=0,$ position=pos3 ; convert ciret_numtot to number/liter result=where(ciret_numtot gt -9999,count) if count gt 0 then ciret_numtot[result]=ciret_numtot[result]/10000. ; determine the data min max range for ciret_re dmax=max(ciret_numtot) result=where(ciret_numtot eq -9999,count) if count gt 0 then ciret_numtot[result]=1e9 dmin=min(ciret_numtot) ; create the new axis for the plot axis,etime,sheight,yaxis=1,color=100,/save,$ yrange=[dmin,dmax],ystyle=1,ytitle='Concen(/liter)' ; plot ciret_numtot oplot,hrfrac,ciret_numtot,color=100,psym=1 endif else begin plot,holdx,holdy,/nodata xyouts,0.5,0.5,'No Ciret RE',/data,color=0,alignment=0.5 endelse ;****************************************************** ; Plot 4 - Emittance and Optical Depth ;****************************************************** if ciret_emiss_id ne -1 then begin ; convert ciret_emiss to microns ; result=where(ciret_re gt -9999,count) ; if count gt 0 then ciret_re[result]=ciret_re[result]*1000.0 ; determine the data min max range for ciret_re dmax=max(ciret_emiss) result=where(ciret_emiss eq -9999,count) if count ne 0 then ciret_emiss[result]=1e6 dmin=min(ciret_emiss) dmax=1 dmin=0 ; plot ciret_emiss plot,hrfrac,ciret_emiss,/noerase,$ yrange=[dmin,dmax],xrange=[stime,etime],$ xstyle=1,ystyle=8,psym=4,xtitle='Time (UTC)',$ title='Emittance and Vis. Optical Depth',$ ytitle='Layer Emittance',color=0,$ position=pos4 ; convert ciret_numtot to number/liter ; result=where(ciret_numtot gt -9999,count) ; if count gt 0 then ciret_numtot[result]=ciret_numtot[result]/10000. ; determine the data min max range for ciret_opt dmax=max(ciret_opt) result=where(ciret_opt eq -9999,count) if count gt 0 then ciret_opt[result]=1e9 dmin=min(ciret_opt) ; create the new axis for the plot axis,etime,sheight,yaxis=1,color=100,/save,$ yrange=[dmin,dmax],ystyle=1,ytitle='Vis. Optical Depth' ; plot ciret_numtot oplot,hrfrac,ciret_opt,color=100,psym=1 endif else begin plot,holdx,holdy,/nodata xyouts,0.5,0.5,'No Ciret OPT',/data,color=0,alignment=0.5 endelse ; ; Add title to page ; if site eq 'nsa' then sitetitle='NSA '+curdate if site eq 'sgp' then sitetitle='SGP '+curdate if site eq 'twpc2' then sitetitle='TWP C2 '+curdate if site eq 'twpc1' then sitetitle='TWP C1 '+curdate xyouts,0.5,0.95,'Cirrus Cloud Properties '+sitetitle,$ /normal,color=0,charthick=1,charsize=1.7,alignment=0.5 ; ; Create gif file ; dep=strpos(ncdf_file,'cdf') print, dep giffile=strmid(ncdf_file,0, dep) giffile=giffile+'ciret.' print, giffile write_gif, giffile+'gif', tvrd( ) ; ; Remove png file ; unix_command='rm '+giffile+'png' spawn,unix_command ; ; end of retrieval exists ; endif end