processing_library/util/array_functions.py
def insert_array(im, x, y, flux, bandwidth=1.0, support=7, insert_function=insert_function_L):
    """ Insert point into image using specified function
    
    :param im: Image
    :param x: x in float pixels
    :param y: y in float pixels
    :param flux: Flux[nchan, npol]
    :param bandwidth: Support of data in uv plane
    :param support: Support of function in image space
    :param insert_function: insert_function_L or insert_function_Sinc or insert_function_pswf
    :return:
    """
    nchan, npol, ny, nx = im.shape
    intx = int(numpy.round(x))
    inty = int(numpy.round(y))
    fracx = x - intx
    fracy = y - inty
    gridx = numpy.arange(-support, support)
    gridy = numpy.arange(-support, support)
    
    insert = numpy.outer(insert_function(bandwidth * (gridy - fracy)),
                         insert_function(bandwidth * (gridx - fracx)))
    
    insertsum = numpy.sum(insert)
    assert insertsum > 0, "Sum of interpolation coefficients %g" % insertsum
    insert = insert / insertsum
    
    for chan in range(nchan):
        for pol in range(npol):
            im[chan, pol, inty - support:inty + support, intx - support:intx + support] += flux[chan, pol] * insert
    
    return im
 Insert point into image using specified function
    
    :param im: Image
    :param x: x in float pixels
    :param y: y in float pixels
    :param flux: Flux[nchan, npol]
    :param bandwidth: Support of data in uv plane
    :param support: Support of function in image space
    :param insert_function: insert_function_L or insert_function_Sinc or insert_function_pswf
    :return:
    
Insert point into image using specified function
Insert point into image using specified function
def insert_array(im, x, y, flux, bandwidth=1.0, support=7, insert_function=insert_function_L):
    nchan, npol, ny, nx = im.shape
    intx = int(numpy.round(x))
    inty = int(numpy.round(y))
    fracx = x - intx
    fracy = y - inty
    gridx = numpy.arange(-support, support)
    gridy = numpy.arange(-support, support)
    insert = numpy.outer(insert_function(bandwidth * (gridy - fracy)),
                         insert_function(bandwidth * (gridx - fracx)))
    insertsum = numpy.sum(insert)
    assert insertsum > 0, "Sum of interpolation coefficients %g" % insertsum
    insert = insert / insertsum
    for chan in range(nchan):
        for pol in range(npol):
            im[chan, pol, inty - support:inty + support, intx - support:intx + support] += flux[chan, pol] * insert
    return im
def insert_array ( im , x , y , flux , bandwidth = 1.0 , support = 7 , insert_function = insert_function_L ) : nchan , npol , ny , nx = im . shape intx = int ( numpy . round ( x ) ) inty = int ( numpy . round ( y ) ) fracx = x - intx fracy = y - inty gridx = numpy . arange ( - support , support ) gridy = numpy . arange ( - support , support ) insert = numpy . outer ( insert_function ( bandwidth * ( gridy - fracy ) ) , insert_function ( bandwidth * ( gridx - fracx ) ) ) insertsum = numpy . sum ( insert ) assert insertsum > 0 , "Sum of interpolation coefficients %g" % insertsum insert = insert / insertsum for chan in range ( nchan ) : for pol in range ( npol ) : im [ chan , pol , inty - support : inty + support , intx - support : intx + support ] += flux [ chan , pol ] * insert return im
Insert point into image using specified function
Insert point into image using specified function
""" Insert point into image using specified function
    
    :param im: Image
    :param x: x in float pixels
    :param y: y in float pixels
    :param flux: Flux[nchan, npol]
    :param bandwidth: Support of data in uv plane
    :param support: Support of function in image space
    :param insert_function: insert_function_L or insert_function_Sinc or insert_function_pswf
    :return:
    """
None
im
None
x
x in float pixels
x in float pixels
y
y in float pixels
y in float pixels
flux
None
bandwidth
Support of data in uv plane
Support of data in uv plane
support
Support of function in image space
Support of function in image space
insert_function
insert_function_L or insert_function_Sinc or insert_function_pswf
insert_function_L or insert_function_Sinc or insert_function_pswf