processing_library/arrays/cleaners.py
def find_max_abs_stack(stack, windowstack, couplingmatrix):
    """Find the location and value of the absolute maximum in this stack
    :param stack: stack to be searched
    :param windowstack: Window for the search
    :param couplingmatrix: Coupling matrix between difference scales
    :return: x, y, scale

    """
    pabsmax = 0.0
    pscale = 0
    px = 0
    py = 0
    nscales = stack.shape[0]
    assert nscales > 0
    pshape = [stack.shape[1], stack.shape[2]]
    for iscale in range(nscales):
        if windowstack is not None:
            resid = stack[iscale, :, :] * windowstack[iscale, :, :] / couplingmatrix[iscale, iscale]
        else:
            resid = stack[iscale, :, :] / couplingmatrix[iscale, iscale]

        # Find the peak in the scaled residual image
        mx, my = numpy.unravel_index(numpy.abs(resid).argmax(), pshape)

        # Is this the peak over all scales?
        thisabsmax = numpy.abs(resid[mx, my])
        if thisabsmax > pabsmax:
            px = mx
            py = my
            pscale = iscale
            pabsmax = thisabsmax

    return px, py, pscale
Find the location and value of the absolute maximum in this stack
    :param stack: stack to be searched
    :param windowstack: Window for the search
    :param couplingmatrix: Coupling matrix between difference scales
    :return: x, y, scale

    
Find the location and value of the absolute maximum in this stack
Find the location and value of the absolute maximum in this stack
def find_max_abs_stack(stack, windowstack, couplingmatrix):
    pabsmax = 0.0
    pscale = 0
    px = 0
    py = 0
    nscales = stack.shape[0]
    assert nscales > 0
    pshape = [stack.shape[1], stack.shape[2]]
    for iscale in range(nscales):
        if windowstack is not None:
            resid = stack[iscale, :, :] * windowstack[iscale, :, :] / couplingmatrix[iscale, iscale]
        else:
            resid = stack[iscale, :, :] / couplingmatrix[iscale, iscale]
        mx, my = numpy.unravel_index(numpy.abs(resid).argmax(), pshape)
        thisabsmax = numpy.abs(resid[mx, my])
        if thisabsmax > pabsmax:
            px = mx
            py = my
            pscale = iscale
            pabsmax = thisabsmax
    return px, py, pscale
def find_max_abs_stack ( stack , windowstack , couplingmatrix ) : pabsmax = 0.0 pscale = 0 px = 0 py = 0 nscales = stack . shape [ 0 ] assert nscales > 0 pshape = [ stack . shape [ 1 ] , stack . shape [ 2 ] ] for iscale in range ( nscales ) : if windowstack is not None : resid = stack [ iscale , : , : ] * windowstack [ iscale , : , : ] / couplingmatrix [ iscale , iscale ] else : resid = stack [ iscale , : , : ] / couplingmatrix [ iscale , iscale ] mx , my = numpy . unravel_index ( numpy . abs ( resid ) . argmax ( ) , pshape ) thisabsmax = numpy . abs ( resid [ mx , my ] ) if thisabsmax > pabsmax : px = mx py = my pscale = iscale pabsmax = thisabsmax return px , py , pscale
Find the location and value of the absolute maximum in this stack
Find the location and value of the absolute maximum in this stack
"""Find the location and value of the absolute maximum in this stack
    :param stack: stack to be searched
    :param windowstack: Window for the search
    :param couplingmatrix: Coupling matrix between difference scales
    :return: x, y, scale

    """ # Find the peak in the scaled residual image # Is this the peak over all scales?
x, y, scale
x y scale
stack
stack to be searched
stack to be searched
windowstack
Window for the search
Window for the search
couplingmatrix
Coupling matrix between difference scales
Coupling matrix between difference scales