processing_library/arrays/cleaners.py
def update_scale_moment_residual(smresidual, ssmmpsf, lhs, rhs, gain, mscale, mval):
    """ Update residual by subtracting the effect of model update for each moment

    """
    # Lines 30 - 32 of Algorithm 1.
    nscales, nmoment, _, _ = smresidual.shape
    smresidual[:, :, lhs[0]:lhs[1], lhs[2]:lhs[3]] -= \
        gain * numpy.einsum("stqxy,q->stxy", ssmmpsf[mscale, :, :, :, rhs[0]:rhs[1], rhs[2]:rhs[3]], mval)

    return smresidual
 Update residual by subtracting the effect of model update for each moment

    
Update residual by subtracting the effect of model update for each moment
Update residual by subtracting the effect of model update for each moment
def update_scale_moment_residual(smresidual, ssmmpsf, lhs, rhs, gain, mscale, mval):
    nscales, nmoment, _, _ = smresidual.shape
    smresidual[:, :, lhs[0]:lhs[1], lhs[2]:lhs[3]] -= \
        gain * numpy.einsum("stqxy,q->stxy", ssmmpsf[mscale, :, :, :, rhs[0]:rhs[1], rhs[2]:rhs[3]], mval)
    return smresidual
def update_scale_moment_residual ( smresidual , ssmmpsf , lhs , rhs , gain , mscale , mval ) : nscales , nmoment , _ , _ = smresidual . shape smresidual [ : , : , lhs [ 0 ] : lhs [ 1 ] , lhs [ 2 ] : lhs [ 3 ] ] -= gain * numpy . einsum ( "stqxy,q->stxy" , ssmmpsf [ mscale , : , : , : , rhs [ 0 ] : rhs [ 1 ] , rhs [ 2 ] : rhs [ 3 ] ] , mval ) return smresidual
Update residual by subtracting the effect of model update for each moment
Update residual by subtracting the effect of model update for each moment
""" Update residual by subtracting the effect of model update for each moment

    """ # Lines 30 - 32 of Algorithm 1.
smresidual
ssmmpsf
lhs
rhs
gain
mscale
mval