pro read_hid_file path_prefix='/Volumes/' ;path_prefix='/uufs/chpc.utah.edu/common/home/' ;; Old file ;hdir='mace-group5/gpm/hid/Ranked_HID_output_2020/20180209_14/' ;hfile='RVI_C-band_20180209_141112.lat_lon.nc' ;parts=strsplit(hfile,'_',/extract) ;hdate=parts[2] ;hhour=strmid(parts[3],0,2) ;hmin=strmid(parts[3],2,2) ;hsec=strmid(parts[3],4,2) ;hid_tag='old' ; New file - fine grid hid_tag='fine' ;hdir='mace-group5/gpm/hid/update_20210330/HID_20180209/12-18z/' ;hfile='OPOL_rnkHID_F_20180209_141112.lat_lon.nc' hdir='mace-group5/gpm/hid/update_20210728/HID_SS_20180209_12-00z/' hfile='OPOL-SS_rnkHID_F_20180209_141112.lat_lon.nc' hfile='OPOL-SS_rnkHID_F_20180209_140448.lat_lon.nc' ; New file - coarse grid ;hid_tag='coarse' ;hdir='mace-group5/gpm/hid/update_20210330/HID_20180209/coarse_grid/' ;hfile='OPOL_rnkHID_C_20180209_141112.lat_lon.nc ;hdir='mace-group5/gpm/hid/update_20210728/HID_SS_20180209_coarse/' ;hfile='OPOL-SS_rnkHID_C_20180209_141112.lat_lon.nc ; Get the date and time from the filename parts=strsplit(hfile,'_',/extract) hdate=parts[3] hhour=strmid(parts[4],0,2) hmin=strmid(parts[4],2,2) hsec=strmid(parts[4],4,2) ; Read the hdf file fid=ncdf_open(path_prefix+hdir+hfile) xid=ncdf_varid(fid,'time') & ncdf_varget,fid,xid,time_offset xid=ncdf_varid(fid,'x') & ncdf_varget,fid,xid,x_m xid=ncdf_varid(fid,'y') & ncdf_varget,fid,xid,y_m xid=ncdf_varid(fid,'z') & ncdf_varget,fid,xid,z_m xid=ncdf_varid(fid,'origin_latitude') & ncdf_varget,fid,xid,olat xid=ncdf_varid(fid,'origin_longitude') & ncdf_varget,fid,xid,olon xid=ncdf_varid(fid,'origin_altitude') & ncdf_varget,fid,xid,oalt xid=ncdf_varid(fid,'point_latitude') & if xid ne -1 then ncdf_varget,fid,xid,lat_hid_3d xid=ncdf_varid(fid,'point_longitude') & if xid ne -1 then ncdf_varget,fid,xid,lon_hid_3d xid=ncdf_varid(fid,'point_altitude') & if xid ne -1 then ncdf_varget,fid,xid,alt_hid_3d xid=ncdf_varid(fid,'linear_reflectivity') & ncdf_varget,fid,xid,ze xid=ncdf_varid(fid,'linear_zdr') & ncdf_varget,fid,xid,zdr xid=ncdf_varid(fid,'corrected_specific_differential_phase') & ncdf_varget,fid,xid,kdp xid=ncdf_varid(fid,'cross_correlation_ratio') & ncdf_varget,fid,xid,rhohv xid=ncdf_varid(fid,'log_reflectivity') & ncdf_varget,fid,xid,dbz xid=ncdf_varid(fid,'log_zdr') & ncdf_varget,fid,xid,dbz_zdr xid=ncdf_varid(fid,'HID_class_01') if xid eq -1 then xid=ncdf_varid(fid,'HID') ncdf_varget,fid,xid,hid xid=ncdf_varid(fid,'hid_score_DZ') & ncdf_varget,fid,xid,hid_dz ;drizzle xid=ncdf_varid(fid,'hid_score_RN') & ncdf_varget,fid,xid,hid_rn ;rain xid=ncdf_varid(fid,'hid_score_CR') & ncdf_varget,fid,xid,hid_cr ;ice crystals xid=ncdf_varid(fid,'hid_score_AG') & ncdf_varget,fid,xid,hid_ag ;aggregates xid=ncdf_varid(fid,'hid_score_WS') & ncdf_varget,fid,xid,hid_ws ;wet snow xid=ncdf_varid(fid,'hid_score_VI') & ncdf_varget,fid,xid,hid_vi ;vertical ice xid=ncdf_varid(fid,'hid_score_GL') & ncdf_varget,fid,xid,hid_gl ;graupel xid=ncdf_varid(fid,'hid_score_GH') & ncdf_varget,fid,xid,hid_gh ;graupel HD xid=ncdf_varid(fid,'hid_score_HA') & ncdf_varget,fid,xid,hid_ha ;hail xid=ncdf_varid(fid,'hid_score_HA') & ncdf_varget,fid,xid,hid_ha ;hail xid=ncdf_varid(fid,'hid_score_BD') & ncdf_varget,fid,xid,hid_bd ;big drops/melting hail xid=ncdf_varid(fid,'temperature') if xid ne -1 then ncdf_varget,fid,xid,temp_hid ;xid=ncdf_varid(fid,'rain') & ncdf_varget,fid,xid,rain_rate ncdf_close,fid ; Convert distances to km x_km=x_m/1000.0 y_km=y_m/1000.0 z_km=z_m/1000.0 numx=n_elements(x_m) numy=n_elements(y_m) numz=n_elements(z_m) x=indgen(numx) y=indgen(numy) z=indgen(numz) r=where(x_km lt 0,c) lat_hid_3d=lat_hid_3d[r,*,*] lon_hid_3d=lon_hid_3d[r,*,*] kdp=kdp[r,*,*] hid=hid[r,*,*] rhohv=rhohv[r,*,*] dbz=dbz[r,*,*] dbz_zdr=dbz_zdr[r,*,*] x_km=x_km[r] stop ; Find the lat,lon range of the plot area ulat_hid=max(lat_hid_3d) llat_hid=min(lat_hid_3d) llon_hid=min(lon_hid_3d) rlon_hid=max(lon_hid_3d) if llon_hid lt 0 then lcolon_hid=360.0+llon_hid else lcolon_hid=llon_hid if rlon_hid lt 0 then rcolon_hid=360.0+rlon_hid else rcolon_hid=rlon_hid ;************************* ; Temp image ;************************* ; Set up plot size pxdim=900 & pydim=900 ; Position the plots xl=0.1 & xr=0.90 yb=0.05 & yt=0.85 sx=0.1 sy=0.1 numplots_x=2 numplots_y=2 position_plots,xl,xr,yb,yt,sx,sy,numplots_x,numplots_y,pos ; Colorbar position cbpos=pos cbpos[*,0]=pos[*,2]+0.02 ;vertical cbpos[*,2]=cbpos[*,0]+0.01 ;cbpos[*,1]=pos[*,3]+0.05 ;horizontal ;cbpos[*,3]=cbpos[*,1]+0.01 dx=0.01 & dy=0.01 ;Clear plot space pnum=0 p0=plot([0,1],[0,1],position=pos[pnum,*],/buffer,dimensions=[pxdim,pydim],axis_style=4,/nodata) d=p0.convertcoord([pos[pnum,0],pos[pnum,2]],[pos[pnum,1],pos[pnum,3]],/normal,/to_device) isx=(d[0,1,0]-d[0,0,0]) isy=(d[1,1,0]-d[1,0,0]) ; drizzle rain ice crystals aggregates wet snow hidct=['white smoke','sky blue','medium blue','orange', 'pink', 'aqua',$ ;vertical ice LD Graupel HD Graupel Hail Big Drops/Melting Hail 'dark gray', 'lime green', 'yellow', 'red','magenta'] ; Choose the 2km height level r=where(z_km le 2.0,c) sidx=r[-1] ;*** PLOT HID do_hid='no' if do_hid eq 'yes' then begin pnum=0 data_var=reform(hid[*,*,sidx]) data_lat=lat_hid_3d[*,*,sidx] data_lon=lon_hid_3d[*,*,sidx] height_var=z_km[sidx] data_image=byte(data_var) r=where(data_var eq -9999,c) if c gt 0 then data_image[r]=0 p0=image(data_image,/buffer,$ dimensions=[pxdim,pydim],position=pos[pnum,*],$ rgb_table=hidct,font_size=fsm) c0=contour(data_var,x_km,y_km,/current,position=pos[pnum,*],/nodata,$ /xstyle,/ystyle,xtickdir=1,ytickdir=1) t1=text(pos[pnum,0]+0*dx,pos[pnum,3]+1*dy,$ 'HID '+string(height_var,format='(F5.2)')+'km',font_size=fs1) endif ;*** PLOT KDP pnum=1 data_var=reform(kdp[*,*,sidx]) data_lat=lat_hid_3d[*,*,sidx] data_lon=lon_hid_3d[*,*,sidx] height_var=z_km[sidx] kmax=max(data_var) r=where(data_var ne -9999,c) kmin=min(data_var[r]) data_image=bytscl(data_var,max=kmax,min=kmin,top=254) r=where(data_var eq -9999,c) if c gt 0 then data_image[r]=255 p0=image(data_image,/current,$ dimensions=[pxdim,pydim],position=pos[pnum,*],$ font_size=fsm,rgb_table=39) c0=contour(data_var,x_km,y_km,/current,position=pos[pnum,*],/nodata,$ /xstyle,/ystyle,xtickdir=1,ytickdir=1) c0=colorbar(rgb_table=39,range=[kmin,kmax],orientation=1,$ position=reform(cbpos[pnum,*]),font_size=10,tickdir=1,border_on=1,title='deg/km') t1=text(pos[pnum,0]+0*dx,pos[pnum,3]+1*dy,$ 'KDP '+string(height_var,format='(F5.2)')+'km',font_size=fs1) ;*** PLOT DBZ pnum=2 data_var=reform(dbz[*,*,sidx]) data_lat=lat_hid_3d[*,*,sidx] data_lon=lon_hid_3d[*,*,sidx] height_var=z_km[sidx] kmax=max(data_var) r=where(data_var ne -9999,c) kmin=min(data_var[r]) data_image=bytscl(data_var,max=kmax,min=kmin,top=254) r=where(data_var eq -9999,c) if c gt 0 then data_image[r]=255 p0=image(data_image,x_km,y_km,/current,$ dimensions=[pxdim,pydim],position=pos[pnum,*],$ font_size=fsm,rgb_table=39) c0=contour(data_var,x_km,y_km,/current,position=pos[pnum,*],/nodata,$ /xstyle,/ystyle,xtickdir=1,ytickdir=1) c0=colorbar(rgb_table=39,range=[kmin,kmax],orientation=1,$ position=reform(cbpos[pnum,*]),font_size=10,tickdir=1,border_on=1,title='dBZ') t1=text(pos[pnum,0]+0*dx,pos[pnum,3]+1*dy,$ 'Reflectivity '+string(height_var,format='(F5.2)')+'km',font_size=fs1) ;*** PLOT ZDR pnum=0 data_var=reform(dbz_zdr[*,*,sidx]) data_lat=lat_hid_3d[*,*,sidx] data_lon=lon_hid_3d[*,*,sidx] height_var=z_km[sidx] kmax=max(data_var) r=where(data_var ne -9999,c) kmin=min(data_var[r]) data_image=bytscl(data_var,max=kmax,min=kmin,top=254) r=where(data_var eq -9999,c) if c gt 0 then data_image[r]=255 p0=image(data_image,x_km,y_km,/current,$ dimensions=[pxdim,pydim],position=pos[pnum,*],$ font_size=fsm,rgb_table=39) c0=contour(data_var,x_km,y_km,/current,position=pos[pnum,*],/nodata,$ /xstyle,/ystyle,xtickdir=1,ytickdir=1) c0=colorbar(rgb_table=39,range=[kmin,kmax],orientation=1,$ position=reform(cbpos[pnum,*]),font_size=10,tickdir=1,border_on=1,title='dBZ') t1=text(pos[pnum,0]+0*dx,pos[pnum,3]+1*dy,$ 'ZDR '+string(height_var,format='(F5.2)')+'km',font_size=fs1) ;*** PLOT rhohv pnum=3 data_var=reform(rhohv[*,*,sidx]) data_lat=lat_hid_3d[*,*,sidx] data_lon=lon_hid_3d[*,*,sidx] height_var=z_km[sidx] kmax=max(data_var) r=where(data_var ne -9999,c) kmin=min(data_var[r]) data_image=bytscl(data_var,max=kmax,min=kmin,top=254) r=where(data_var eq -9999,c) if c gt 0 then data_image[r]=255 p0=image(data_image,/current,$ dimensions=[pxdim,pydim],position=pos[pnum,*],$ font_size=fsm,rgb_table=39) c0=contour(data_var,x_km,y_km,/current,position=pos[pnum,*],/nodata,$ /xstyle,/ystyle,xtickdir=1,ytickdir=1) c0=colorbar(rgb_table=39,range=[kmin,kmax],orientation=1,$ position=reform(cbpos[pnum,*]),font_size=10,tickdir=1,border_on=1,title='ratio') t1=text(pos[pnum,0]+0*dx,pos[pnum,3]+1*dy,$ 'RHOHV '+string(height_var,format='(F5.2)')+'km',font_size=fs1) ;*** TITLES t1=text(0.1,0.98,'CBAND '+hdate+' '+$ hhour+':'+hmin+':'+hsec,font_size=fs1) ;t1=text(pos[pnum,0]+0*dx,pos[pnum,3]+6*dy,$ ; 'HID '+string(height_var,format='(F5.2)')+'km',font_size=fs1) ;t1=text(pos[pnum,0]+0*dx,pos[pnum,3]+4*dy,$ ; hid_tag+' grid',font_size=fs1) if do_hid eq 'yes' then begin xh=0.3 & yh=0.91 ;t1=text(pos[pnum,0],pos[pnum,3]+2*dy,'HID',font_size=fs2) t1=text(xh+15*dx,yh+6.0*dy,'Drizzle',font_size=fs2,color=hidct[1]) t1=text(xh+15*dx,yh+4.0*dy,'Rain',font_size=fs2,color=hidct[2]) t1=text(xh+15*dx,yh+2.0*dy,'Ice Crystals',font_size=fs2,color=hidct[3]) t1=text(xh+29*dx,yh+6.0*dy,'Aggregates',font_size=fs2,color=hidct[4]) t1=text(xh+29*dx,yh+4.0*dy,'Wet Snow',font_size=fs2,color=hidct[5]) t1=text(xh+29*dx,yh+2.0*dy,'Vertical Ice',font_size=fs2,color=hidct[6]) t1=text(xh+42*dx,yh+6.0*dy,'LD Graupel',font_size=fs2,color=hidct[7]) t1=text(xh+42*dx,yh+4.0*dy,'HD Graupel',font_size=fs2,color=hidct[8]) t1=text(xh+42*dx,yh+2.0*dy,'Hail',font_size=fs2,color=hidct[9]) t1=text(xh+55*dx,yh+6.0*dy,'Big Drops',font_size=fs2,color=hidct[10]) t1=text(xh+55*dx,yh+4.0*dy,'Melting Hail',font_size=fs2,color=hidct[10]) endif hstr=string(height_var,format='(F4.2)')+'km' p0.save,'hid.'+hdate+'.'+hhour+hmin+hsec+'.'+hstr+'.'+hid_tag+'.v4.png',height=pydim stop end