;------------------------------------------------------------------------ ;------------------------------------------------------------------------ ;Title: loadice2.pro ;Purpose: To read netCDF files created by ice2out.pro. ; These are ice cloud retrievals from the MMCR package. ; ;I/O format: .r loadice2 ; ;Author: Matthew Shupe ;Date: 1/7/00 ;Modified: 5/9/00 ;------------------------------------------------------------------------ ;------------------------------------------------------------------------ for jj=0,N_elements(file)-1 do begin filename=file[jj] print,'Loading ',filename fid=ncdf_open(filename) ncdf_varget,fid,0,time ;time [decimal hour] ncdf_varget,fid,1,height ;height [km] ncdf_varget,fid,2,dm ;mean diameter [microns] "full" ncdf_varget,fid,3,iwc ;IWC [g/m3] "full" ncdf_varget,fid,4,iwp ;IWP [g/m2] "full" ncdf_varget,fid,5,ni ;concentration [1/cm3] ncdf_varget,fid,6,tau ;optical depth ncdf_varget,fid,7,a_coeff ;a coefficient for ice retrieval ncdf_close,fid ;Make the plots ;----------- window,0,xsize=600,ysize=800 cbtitle='!17IWC (g/m!E3!N)' title='!17A coefficient and Ice Water Content, '+strmid(filename,0,9) xtitle='!17Time (hours)' ytitle='!17Height (km)' loadct,43,file='/export/home/mshupe/IDLcode/colorscopy.tbl' ;Make a plot !p.color=1 !p.background=0 plot,time,a_coeff,/xstyle,/ystyle,yrange=[0,.8],xtickname=[' ',' ',' ',' ',' ',' ',' ',' ',' '],ytitle='A coeff',title=title,$ position=[.1,.65,.95,.95],/norm ;Determine max height index ;-------------------------- maxheight=max(height) m_ht=where(height le maxheight) ;Set up the time vector properly (if image spans two days) ;--------------------------------------------------------- for i=1,n_elements(time)-1 do $ if time[i] lt time[i-1] then time[i]=time[i]+24. ;Create axes and set up plot ;--------------------------- contour,iwc[*,m_ht],time,height[m_ht],/nodata,$ position=[.1,.15,.95,.65],font=-1,yrange=[0,maxheight],$ xtitle=xtitle,ytitle=ytitle,xstyle=1,background=0,/noerase ;Create contour plot ;------------------- !p.color=1 !p.background=0 levels=( exp(indgen(21)/(21./3))-exp(0))/(21.*15) + 0.00001 ;Too change the scale range simply change the 15 above nlev=n_elements(levels) numc=!d.n_colors numc=numc<256 colors=indgen(nlev)*fix((numc-3)/(nlev-1))+2 ncblev=nlev contour,iwc[*,m_ht],time,height[m_ht],$ levels=levels,/fill,c_colors=colors,$ xstyle=1,font=-1, position=[.1,.15,.95,.65],/norm,$ yrange=[0,maxheight],/noerase ;Create the colorbar and label ;------------------------------ cbst=.15 cben=.9 cbxwid=(cben-cbst)/(ncblev-1) cb_x=[cbst,cbst,cbst+cbxwid,cbst+cbxwid] cb_y=[.075,.105,.105,.075] cbstr=string(levels,format='(f5.3)') cbl_y=cb_y[0]-0.03 for i=(nlev-ncblev),nlev-2 do begin polyfill,cb_x,cb_y,color=colors[i],/norm if (i mod 4) eq 0 then begin xyouts,cb_x[0],cbl_y,cbstr[i],alignment=0.5,font=-1,/norm endif cb_x=cb_x+cbxwid if i eq (nlev-2) then $ xyouts,cb_x[0],cbl_y,cbstr[i+1],alignment=0.5,font=-1,/norm endfor xyouts,.525,.01,cbtitle,alignment=0.5,font=-1,/normal write_gif,strmid(filename,0,21)+'.ai.gif',tvrd() endfor end ;prog