; ; min_max_mode.pro create the plot of the averaged data ; pro min_max_mode, 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' ncdf_file='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') cbase_id=ncdf_varid(cdf_id, 'CloudBaseBestEstimate') possp_id=ncdf_varid(cdf_id, 'CloudBase') 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') ; ; 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 bhl1_id ne -1 then ncdf_varget,cdf_id,bhl1_id,bhl1 if bhl2_id ne -1 then ncdf_varget,cdf_id,bhl2_id,bhl2 if bhl3_id ne -1 then ncdf_varget,cdf_id,bhl3_id,bhl3 if bhl4_id ne -1 then ncdf_varget,cdf_id,bhl4_id,bhl4 if bhl5_id ne -1 then ncdf_varget,cdf_id,bhl5_id,bhl5 if btl1_id ne -1 then ncdf_varget,cdf_id,btl1_id,btl1 if btl2_id ne -1 then ncdf_varget,cdf_id,btl2_id,btl2 if btl3_id ne -1 then ncdf_varget,cdf_id,btl3_id,btl3 if btl4_id ne -1 then ncdf_varget,cdf_id,btl4_id,btl4 if btl5_id ne -1 then ncdf_varget,cdf_id,btl5_id,btl5 if thl1_id ne -1 then ncdf_varget,cdf_id,thl1_id,thl1 if thl2_id ne -1 then ncdf_varget,cdf_id,thl2_id,thl2 if thl3_id ne -1 then ncdf_varget,cdf_id,thl3_id,thl3 if thl4_id ne -1 then ncdf_varget,cdf_id,thl4_id,thl4 if thl5_id ne -1 then ncdf_varget,cdf_id,thl5_id,thl5 if ttl1_id ne -1 then ncdf_varget,cdf_id,ttl1_id,ttl1 if ttl2_id ne -1 then ncdf_varget,cdf_id,ttl2_id,ttl2 if ttl3_id ne -1 then ncdf_varget,cdf_id,ttl3_id,ttl3 if ttl4_id ne -1 then ncdf_varget,cdf_id,ttl4_id,ttl4 if ttl5_id ne -1 then ncdf_varget,cdf_id,ttl5_id,ttl5 ; ; Close the netcdf file ; ncdf_close,cdf_id ; ; Start the plot ; ;!x.margin=[10,3] ;!y.margin=[3,2] ;!p.multi=[0,1,1] ;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;,/pixmap 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,bhl1/1000,psym=4,color=0,thick=3 oplot,hrfrac,thl1/1000,psym=6,color=0,thick=3 oplot,hrfrac,bhl2/1000,psym=4,color=70,thick=3 oplot,hrfrac,thl2/1000,psym=6,color=70,thick=3 oplot,hrfrac,bhl3/1000,psym=4,color=120,thick=3 oplot,hrfrac,thl3/1000,psym=6,color=120,thick=3 oplot,hrfrac,bhl4/1000,psym=4,color=120,thick=3 oplot,hrfrac,thl4/1000,psym=6,color=120,thick=3 oplot,hrfrac,bhl5/1000,psym=4,color=20,thick=3 oplot,hrfrac,thl5/1000,psym=6,color=20,thick=3 stop ;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,'ReflectivityBestEstimate',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 giffile=strmid(ncdf_file,0, 33) + 'gif' print, giffile write_gif, giffile, tvrd( ) ;;stop end