
function F = gauss2De(a0,DATA)

% Used by the curve fitter to calculate values for a 2d gaussian
% clear F

l = length(DATA);
% l = length(tmp)
r = (l+1)/2;
% X = 1:size(data,1);
% Y = 1:size(data,2);
% X = data(:,1);
% Y = data(1,size(data,2)/2+1:end);

for i = 1:l
    for j = 1:l
        X = i;
        Y = j;
        F(i,j) = (a0(2)*exp(-((X-(r+a0(3))).^2+(Y-(r+a0(4))).^2)/(2*a0(5)^2)) + a0(1));
    end
end
% DATA = ones(99,99)
% a0 = [0 1000 55.5 47.3 1.5]
% max(F,'all')(55,47)
% img(55,47)
% figure(79), hold on, imagesc(F), scatter(r + a0(4) ,r + a0(3))
% scatter(47,55)