function [fval model]=BlobMLE(X,data,sigma)
%Calculates the Log Likelihood (minus offset) of Gaussian Model    

x=X(1);
y=X(2);
Photons=X(3);
bg=X(4);

bg=abs(bg);

sz=size(data,1);

model=gaussianblob(newim([sz sz]),[x y],sigma,Photons)+bg;

fval=sum(model-data.*log(model));

