processing_components/imaging/base.py
def normalize_sumwt(im: Image, sumwt) -> Image:
    """Normalize out the sum of weights

    :param im: Image, im.data has shape [nchan, npol, ny, nx]
    :param sumwt: Sum of weights [nchan, npol]
    """
    nchan, npol, _, _ = im.data.shape
    assert isinstance(im, Image), im
    assert sumwt is not None
    assert nchan == sumwt.shape[0]
    assert npol == sumwt.shape[1]
    for chan in range(nchan):
        for pol in range(npol):
            if sumwt[chan, pol] > 0.0:
                im.data[chan, pol, :, :] = im.data[chan, pol, :, :] / sumwt[chan, pol]
            else:
                im.data[chan, pol, :, :] = 0.0
    return im
Normalize out the sum of weights

    :param im: Image, im.data has shape [nchan, npol, ny, nx]
    :param sumwt: Sum of weights [nchan, npol]
    
Normalize out the sum of weights
Normalize out the sum of weights
def normalize_sumwt(im: Image, sumwt) -> Image:
    nchan, npol, _, _ = im.data.shape
    assert isinstance(im, Image), im
    assert sumwt is not None
    assert nchan == sumwt.shape[0]
    assert npol == sumwt.shape[1]
    for chan in range(nchan):
        for pol in range(npol):
            if sumwt[chan, pol] > 0.0:
                im.data[chan, pol, :, :] = im.data[chan, pol, :, :] / sumwt[chan, pol]
            else:
                im.data[chan, pol, :, :] = 0.0
    return im
def normalize_sumwt ( im : Image , sumwt ) -> Image : nchan , npol , _ , _ = im . data . shape assert isinstance ( im , Image ) , im assert sumwt is not None assert nchan == sumwt . shape [ 0 ] assert npol == sumwt . shape [ 1 ] for chan in range ( nchan ) : for pol in range ( npol ) : if sumwt [ chan , pol ] > 0.0 : im . data [ chan , pol , : , : ] = im . data [ chan , pol , : , : ] / sumwt [ chan , pol ] else : im . data [ chan , pol , : , : ] = 0.0 return im
Normalize out the sum of weights
Normalize out the sum of weights
"""Normalize out the sum of weights

    :param im: Image, im.data has shape [nchan, npol, ny, nx]
    :param sumwt: Sum of weights [nchan, npol]
    """
im
Image
Image, im.data has shape [nchan, npol, ny, nx]
Image im . data has shape [ nchan npol ny nx ]
sumwt
Sum of weights [nchan, npol]
Sum of weights [ nchan npol ]