ndwi_name = strcat(UID,"_ndwi")
%for NDWI
NN =(1/ max(max(NDWI_new)))*NDWI_new;
NN = imcomplement(NN);
imagesc(NN, [0 0.3]);

axis square tight
axis off
               
                saveas(1,ndwi_name,'png')
ndwi_name = strcat(ndwi_name,".png");

aa = imread(ndwi_name);
size_aa = size(aa)
sizeN = size(NDWI)
startaaheight=25;
endaaheight = 900-25;
startaawidth=181;
endaawidth=1200-188;
	aa_new = aa(startaaheight:endaaheight,startaawidth:endaawidth,:);
    aa_new = imresize(aa_new,[sizeN(1) sizeN(2)]);
   
imwrite(aa_new,i_name);

ndre_name =strcat(UID,"_ndre.png");
aa = imread(ndre_name);
size_aa = size(aa)
sizeN = size(NDRE)
startaaheight=25;
endaaheight = 900-25;
startaawidth=181;
endaawidth=1200-188;
	aa = aa(startaaheight:endaaheight,startaawidth:endaawidth,:);
    aa = imresize(aa,[sizeN(1) sizeN(2)]);
    size_aa = size(aa)
imwrite(aa,ndre_name);
result_status = strcat(UID,"successful")

