%CORRECTION DE LA PARTIE "TEST SUR UNE IMAGE"

%Ajout du path
addpath ('../toolbox');

%Chargement de l'image
data_image=load('../Images/base_image_251.dat');
ivalid=load('../Images/Valid_Pixels_251.dat');
iterre=load('../Images/Val_Pix_Terre_251.dat');
inuage=load('../Images/Val_Pix_Nuages_251.dat');

%Chargement de la premiere partie
load base_mix.mat;

%QUESTION 1
figure(1)
clf
plot_image(data_image(:,1),ivalid,inuage,iterre,[20 60]);
title('Thetas')

figure(2)
clf
plot_image(data_image(:,2),ivalid,inuage,iterre,[20 60]);
title('Thetav')

figure(3)
clf
plot_image(data_image(:,3),ivalid,inuage,iterre,[100 200]);
title('Dphi')

figure(4)
clf
plot_image(data_image(:,4),ivalid,inuage,iterre,[0 0.05]);
title('Rhocor(670)')

figure(5)
clf
plot_image(data_image(:,5),ivalid,inuage,iterre,[0 0.05]);
title('Rhocor(765)')

figure(6)
clf
plot_image(data_image(:,6),ivalid,inuage,iterre,[0 0.05]);
title('Rhocor(865)')

%QUESTION 2
mini=min(base_mix);
maxi=max(base_mix);
%Determination des pixels traites par NN :
iok=[1:size(data_image,1)];
for j=1:size(data_image,2)
iok=intersect(iok,find(data_image(:,j)>=mini(j) & data_image(:,j)<=maxi(j)));
end
