processing_library/arrays/cleaners.py
def find_optimum_scale_zero_moment(smpsol, windowstack):
    """Find the optimum scale for moment zero

    Line 27 of Algorithm 1

    :param windowstack:
    :param smpsol: Decoupled residual images for each scale and moment
    :return: x, y, optimum scale for peak
    """
    nscales, nmoment, nx, ny = smpsol.shape
    sscale = 0
    sx = 0
    sy = 0
    optimum = 0.0

    for scale in range(nscales):

        if windowstack is not None:
            resid = smpsol[scale, 0, :, :] * windowstack[scale, :, :]
        else:
            resid = smpsol[scale, 0, :, :]

        this_max = numpy.max(numpy.abs(resid))
        if this_max > optimum:
            optimum = this_max
            sscale = scale
            sx, sy = argmax(smpsol[scale, 0, ...])

    return sx, sy, sscale
Find the optimum scale for moment zero

    Line 27 of Algorithm 1

    :param windowstack:
    :param smpsol: Decoupled residual images for each scale and moment
    :return: x, y, optimum scale for peak
    
Find the optimum scale for moment zero
Line 27 of Algorithm 1
Find the optimum scale for moment zero Line 27 of Algorithm 1
def find_optimum_scale_zero_moment(smpsol, windowstack):
    nscales, nmoment, nx, ny = smpsol.shape
    sscale = 0
    sx = 0
    sy = 0
    optimum = 0.0
    for scale in range(nscales):
        if windowstack is not None:
            resid = smpsol[scale, 0, :, :] * windowstack[scale, :, :]
        else:
            resid = smpsol[scale, 0, :, :]
        this_max = numpy.max(numpy.abs(resid))
        if this_max > optimum:
            optimum = this_max
            sscale = scale
            sx, sy = argmax(smpsol[scale, 0, ...])
    return sx, sy, sscale
def find_optimum_scale_zero_moment ( smpsol , windowstack ) : nscales , nmoment , nx , ny = smpsol . shape sscale = 0 sx = 0 sy = 0 optimum = 0.0 for scale in range ( nscales ) : if windowstack is not None : resid = smpsol [ scale , 0 , : , : ] * windowstack [ scale , : , : ] else : resid = smpsol [ scale , 0 , : , : ] this_max = numpy . max ( numpy . abs ( resid ) ) if this_max > optimum : optimum = this_max sscale = scale sx , sy = argmax ( smpsol [ scale , 0 , ... ] ) return sx , sy , sscale
Find the optimum scale for moment zero
Line 27 of Algorithm 1
Find the optimum scale for moment zero Line 27 of Algorithm 1
"""Find the optimum scale for moment zero

    Line 27 of Algorithm 1

    :param windowstack:
    :param smpsol: Decoupled residual images for each scale and moment
    :return: x, y, optimum scale for peak
    """
x, y, optimum scale for peak
x y optimum scale for peak
smpsol
Decoupled residual images for each scale and moment
Decoupled residual images for each scale and moment
windowstack
None