function [ handles ] = equalizeIrr( handles )
% Forces any single pixel to have an maximum irradiance of 1.



[row col] = size(handles.filtVal{1});

tempFiltSum = zeros(row,col);

for k = 1:handles.numFiltersD
    tempFiltSum = tempFiltSum + handles.filtVal{k};
end

maxFilt = max(max(tempFiltSum));
indMax = find(tempFiltSum == maxFilt);

minFilt = min(min(tempFiltSum));
indMin = find(tempFiltSum == minFilt);

for k = 1:handles.numFiltersD
    maxFiltArray(k) = handles.filtVal{k}(indMax)./maxFilt;
    if maxFiltArray(k) ~= 0
        handles.filtVal{k} = handles.filtVal{k}./maxFiltArray(k);
    end
    minFiltArray(k) = handles.filtVal{k}(indMin)./minFilt;
end

end

