def METHOD_NAME(data, X, Y):
    """calculates the \sigma_x - \sigma_y term used for z position estimation"""
    A = data.max(1).max(0) - data.min() #amplitude
    #threshold at half maximum and subtract threshold
    dr = numpy.maximum(data - data.min() - 0.2*A[None,None, :], 0).squeeze()
    #dr = (data - data.mean()).squeeze()
    dr = dr/dr.sum(1).sum(0)[None,None,:]
    #print dr.sum(1).sum(0)[None,None,:] 
    x0 = (X[:,None, None]*dr).sum(1).sum(0)
    y0 = (Y[None, :, None]*dr).sum(1).sum(0)
    #print x0
    xn = X[:,None, None] - x0[None,None, :]
    yn = Y[None, :, None] - y0[None,None, :]
    #r = numpy.sqrt(xn*xn + yn*yn)
    #sig = numpy.sqrt((xn*xn*dr + yn*yn*dr).sum(1).sum(0)) #+ (xn*xn*dr).sum(1).sum(0)
    rn2 = xn*xn + yn*yn
    d1 = (rn2 < (2*70.)**2).astype('f')*data
    #print d1.shape
    sig = d1.sum(1).sum(0)/data.sum(1).sum(0)
    #print A.mean(), x0[0], y0[0], sig[1] - sig[0]
    return data.sum(), x0[0], y0[0], sig[0], sig[1]