def METHOD_NAME(data, X, Y):
    """calculates the \sigma_x - \sigma_y term used for z position estimation"""
    A = data.max() - data.min() #amplitude
    #threshold at half maximum and subtract threshold
    dr = numpy.maximum(data - data.min() - 0.5*A, 0).squeeze()
    dr = dr/dr.sum()
    x0 = (X[:,None]*dr).sum()
    y0 = (Y[None, :]*dr).sum()
    xn = (X - x0)[:,None]
    yn = (Y - y0)[None, :]
    #sig_xl = (numpy.maximum(0, x0 - X)[:,None]*dr).sum()/(drs)
    sig_xl = (numpy.maximum(0, xn*costheta - yn*sintheta)*dr).sum()
    #sig_xr = (numpy.maximum(0, X - x0)[:,None]*dr).sum()/(drs)
    #sig_yu = (numpy.maximum(0, y0 - Y)[None, :]*dr).sum()/(drs)
    sig_yu = (numpy.maximum(0, xn*sintheta + yn*costheta)*dr).sum()
    #sig_yd = (numpy.maximum(0, Y - y0)[None, :]*dr).sum()/(drs)
    return A, x0, y0, sig_xl - sig_yu