clear
lambda=[700 550 450];
for i=1:length(lambda)
    disp(i)
   [X,Y,I(:,:,i),x0,y0]=singlescattering(lambda(i));
end    
%MAX=max(max(max(I)));
%I=I/MAX;
V=rgb2gray(I);
figure
caxis([0 2.5])
h=plot(x0,y0,'oy')
set(h,'MarkerFaceColor','y') 

[n,m]=size(X);
II=I;
for i=1:n
    for j=1:m
        MAX=max(max(I(i,j,:)));
        if MAX>0
         II(i,j,:)=I(i,j,:)/MAX;
        end 
    end
end

V=rgb2gray(II);
for i=1:n
    for j=1:m
        dist=sqrt((X(i,j)-x0).^2+(Y(i,j)-y0).^2);
        if dist<3
            II(i,j,:)=[1 1 0];
        end
    end
end
[V,map]=rgb2ind(II,20000,'nodither');
V=double(V);
%h=polar([0 2*pi], [0 90],'b');
%delete(h);
%hold on;
H=findall(gca);
for i=1:length(H);
    try
        set(H(i),'FaceColor',[0 1 0])
    end
end  
%h=plot(x0,y0,'oy')
%set(h,'MarkerFaceColor','y') 
pcolor(X,Y,V); shading interp; 
colormap(map);
axis square
set(gca,'color',[0.8 0.8 0.8])
set(gca,'Visible','off')


%h=plot(x0,y0,'oy')
%set(h,'MarkerFaceColor','y') 
%caxis([0 3.5]);
  
