processing_components/griddata/kernels.py
def create_box_convolutionfunction(im, oversampling=1, support=1):
    """ Fill a box car function into a ConvolutionFunction

    Also returns the griddata correction function as an image

    :param im: Image template
    :param oversampling: Oversampling of the convolution function in uv space
    :return: griddata correction Image, griddata kernel as ConvolutionFunction
    """
    assert isinstance(im, Image)
    cf = create_convolutionfunction_from_image(im, oversampling=1, support=4)
    
    nchan, npol, _, _ = im.shape
    
    cf.data[...] = 0.0 + 0.0j
    cf.data[..., 2, 2] = 1.0 + 0.0j
    
    # Now calculate the griddata correction function as an image with the same coordinates as the image
    # which is necessary so that the correction function can be applied directly to the image
    nchan, npol, ny, nx = im.data.shape
    nu = numpy.abs(coordinates(nx))
    
    gcf1d = numpy.sinc(nu)
    gcf = numpy.outer(gcf1d, gcf1d)
    gcf = 1.0 / gcf
    
    gcf_data = numpy.zeros_like(im.data)
    gcf_data[...] = gcf[numpy.newaxis, numpy.newaxis, ...]
    gcf_image = create_image_from_array(gcf_data, cf.projection_wcs, im.polarisation_frame)
    
    return gcf_image, cf
 Fill a box car function into a ConvolutionFunction

    Also returns the griddata correction function as an image

    :param im: Image template
    :param oversampling: Oversampling of the convolution function in uv space
    :return: griddata correction Image, griddata kernel as ConvolutionFunction
    
Fill a box car function into a ConvolutionFunction
Also returns the griddata correction function as an image
Fill a box car function into a ConvolutionFunction Also returns the griddata correction function as an image
def create_box_convolutionfunction(im, oversampling=1, support=1):
    assert isinstance(im, Image)
    cf = create_convolutionfunction_from_image(im, oversampling=1, support=4)
    nchan, npol, _, _ = im.shape
    cf.data[...] = 0.0 + 0.0j
    cf.data[..., 2, 2] = 1.0 + 0.0j
    nchan, npol, ny, nx = im.data.shape
    nu = numpy.abs(coordinates(nx))
    gcf1d = numpy.sinc(nu)
    gcf = numpy.outer(gcf1d, gcf1d)
    gcf = 1.0 / gcf
    gcf_data = numpy.zeros_like(im.data)
    gcf_data[...] = gcf[numpy.newaxis, numpy.newaxis, ...]
    gcf_image = create_image_from_array(gcf_data, cf.projection_wcs, im.polarisation_frame)
    return gcf_image, cf
def create_box_convolutionfunction ( im , oversampling = 1 , support = 1 ) : assert isinstance ( im , Image ) cf = create_convolutionfunction_from_image ( im , oversampling = 1 , support = 4 ) nchan , npol , _ , _ = im . shape cf . data [ ... ] = 0.0 + 0.0j cf . data [ ... , 2 , 2 ] = 1.0 + 0.0j nchan , npol , ny , nx = im . data . shape nu = numpy . abs ( coordinates ( nx ) ) gcf1d = numpy . sinc ( nu ) gcf = numpy . outer ( gcf1d , gcf1d ) gcf = 1.0 / gcf gcf_data = numpy . zeros_like ( im . data ) gcf_data [ ... ] = gcf [ numpy . newaxis , numpy . newaxis , ... ] gcf_image = create_image_from_array ( gcf_data , cf . projection_wcs , im . polarisation_frame ) return gcf_image , cf
Fill a box car function into a ConvolutionFunction
Also returns the griddata correction function as an image
Fill a box car function into a ConvolutionFunction Also returns the griddata correction function as an image
""" Fill a box car function into a ConvolutionFunction

    Also returns the griddata correction function as an image

    :param im: Image template
    :param oversampling: Oversampling of the convolution function in uv space
    :return: griddata correction Image, griddata kernel as ConvolutionFunction
    """ # Now calculate the griddata correction function as an image with the same coordinates as the image # which is necessary so that the correction function can be applied directly to the image
griddata correction Image, griddata kernel as ConvolutionFunction
griddata correction Image griddata kernel as ConvolutionFunction
im
None
oversampling
Oversampling of the convolution function in uv space
Oversampling of the convolution function in uv space
support