ncid = netcdf.open('z:\BAO\Tower\Sodar\10214_sodarpc.nc','NC_NOWRITE');
[tname,tlen]=netcdf.inqDim(ncid,3);
tid = netcdf.inqVarID(ncid,'Time');
rid = netcdf.inqVarID(ncid,'ReflectivityData');
time = netcdf.getVar(ncid,tid,'double');
ref = netcdf.getVar(ncid,rid,'double');
dt=datenum(1970,1,1,0,0,time);
hts=.8:.8:409.6;
bt=datenum(2010,7,31,7,30,0);
et=datenum(2010,7,31,8,0,0);
dtindx=find(dt>=bt & dt<=et);
lr=log10(ref(1:500,dtindx));

imagesc(dt(dtindx),hts,lr,[2.0 4.318]);
imagesc(dt,hts,log10(ref));
imagesc(dt,hts,lr);
axis xy
datetick('x','HH:MM','keeplimits','keepticks');

colormap(gray)
cm=colormap();
cm1=cm;
cm(64:-1:1,:)=cm1(1:64,:);
colormap(cm)
cm=zeros(256,3);
for i=2:256
    cm(i,:)=i/256;
end

refmin=min(lr);
refmean=mean(lr);
refmean=mean(lr(350:450,:));

deltat=6;
bh=0;
eh=5;

for i=1:4
    bt=datenum(2010,8,2,bh,0,0);
    et=datenum(2010,8,2,eh,59,59);
    dtindx=find(dt>=bt & dt<=et);
    lra6=ref(:,dtindx);
    %subplot(4,1,i),imagesc(dt(dtindx),hts,lra6,[1.7845 dmax]);
    subplot(4,1,i),imagesc(dt(dtindx),hts,lra6);
    axis xy
    datetick('x','HH:MM','keeplimits','keepticks');
    %colormap(gray)
    %cm=colormap();
    %cm1=cm;
    %cm(64:-1:1,:)=cm1(1:64,:);
    colormap(cm)
    
    bh = bh + deltat;
    eh = eh + deltat;
end
