processing_library/image/operations.py
def create_w_term_like(im: Image, w, phasecentre=None, remove_shift=False, dopol=False) -> Image:
    """Create an image with a w term phase term in it:
    
    .. math::

    I(l,m) = e^{-2 \\pi j (w(\\sqrt{1-l^2-m^2}-1)}

    
    The vis phasecentre is used as the delay centre for the w term (i.e. where n==0)

    :param phasecentre:
    :param im: template image
    :param w: w value to evaluate (default is median abs)
    :param remove_shift:
    :param dopol: Do screen in polarisation?
    :return: Image
    """
    
    fim_shape = list(im.shape)
    if not dopol:
        fim_shape[1] = 1
    
    fim_array = numpy.zeros(fim_shape, dtype='complex')
    fim = create_image_from_array(fim_array, wcs=im.wcs, polarisation_frame=im.polarisation_frame)
    
    cellsize = abs(fim.wcs.wcs.cdelt[0]) * numpy.pi / 180.0
    nchan, npol, _, npixel = fim_shape
    if phasecentre is SkyCoord:
        wcentre = phasecentre.to_pixel(im.wcs, origin=0)
    else:
        wcentre = [im.wcs.wcs.crpix[0] - 1.0, im.wcs.wcs.crpix[1] - 1.0]
    
    # for chan in range(nchan):
    #     for pol in range(npol):
    #         fim.data[chan, pol, ...] = w_beam(npixel, npixel * cellsize, w=w, cx=wcentre[0],
    #                                           cy=wcentre[1], remove_shift=remove_shift)

    temp = w_beam(npixel, npixel * cellsize, w=w, cx=wcentre[0], cy=wcentre[1], remove_shift=remove_shift)
    fim.data[:, :, ...] = temp

    fov = npixel * cellsize
    fresnel = numpy.abs(w) * (0.5 * fov) ** 2
    log.debug('create_w_term_image: For w = %.1f, field of view = %.6f, Fresnel number = %.2f' % (w, fov, fresnel))
    
    return fim
Create an image with a w term phase term in it:
    
    .. math::

    I(l,m) = e^{-2 \\pi j (w(\\sqrt{1-l^2-m^2}-1)}

    
    The vis phasecentre is used as the delay centre for the w term (i.e. where n==0)

    :param phasecentre:
    :param im: template image
    :param w: w value to evaluate (default is median abs)
    :param remove_shift:
    :param dopol: Do screen in polarisation?
    :return: Image
    
Create an image with a w term phase term in it:
math:.



The vis phasecentre is used as the delay centre for the w term
Create an image with a w term phase term in it : math : . The vis phasecentre is used as the delay centre for the w term
def create_w_term_like(im: Image, w, phasecentre=None, remove_shift=False, dopol=False) -> Image:
    fim_shape = list(im.shape)
    if not dopol:
        fim_shape[1] = 1
    fim_array = numpy.zeros(fim_shape, dtype='complex')
    fim = create_image_from_array(fim_array, wcs=im.wcs, polarisation_frame=im.polarisation_frame)
    cellsize = abs(fim.wcs.wcs.cdelt[0]) * numpy.pi / 180.0
    nchan, npol, _, npixel = fim_shape
    if phasecentre is SkyCoord:
        wcentre = phasecentre.to_pixel(im.wcs, origin=0)
    else:
        wcentre = [im.wcs.wcs.crpix[0] - 1.0, im.wcs.wcs.crpix[1] - 1.0]
    temp = w_beam(npixel, npixel * cellsize, w=w, cx=wcentre[0], cy=wcentre[1], remove_shift=remove_shift)
    fim.data[:, :, ...] = temp
    fov = npixel * cellsize
    fresnel = numpy.abs(w) * (0.5 * fov) ** 2
    log.debug('create_w_term_image: For w = %.1f, field of view = %.6f, Fresnel number = %.2f' % (w, fov, fresnel))
    return fim
def create_w_term_like ( im : Image , w , phasecentre = None , remove_shift = False , dopol = False ) -> Image : fim_shape = list ( im . shape ) if not dopol : fim_shape [ 1 ] = 1 fim_array = numpy . zeros ( fim_shape , dtype = 'complex' ) fim = create_image_from_array ( fim_array , wcs = im . wcs , polarisation_frame = im . polarisation_frame ) cellsize = abs ( fim . wcs . wcs . cdelt [ 0 ] ) * numpy . pi / 180.0 nchan , npol , _ , npixel = fim_shape if phasecentre is SkyCoord : wcentre = phasecentre . to_pixel ( im . wcs , origin = 0 ) else : wcentre = [ im . wcs . wcs . crpix [ 0 ] - 1.0 , im . wcs . wcs . crpix [ 1 ] - 1.0 ] temp = w_beam ( npixel , npixel * cellsize , w = w , cx = wcentre [ 0 ] , cy = wcentre [ 1 ] , remove_shift = remove_shift ) fim . data [ : , : , ... ] = temp fov = npixel * cellsize fresnel = numpy . abs ( w ) * ( 0.5 * fov ) ** 2 log . debug ( 'create_w_term_image: For w = %.1f, field of view = %.6f, Fresnel number = %.2f' % ( w , fov , fresnel ) ) return fim
Create an image with a w term phase term in it:
.. math::
Create an image with a w term phase term in it : .. math ::
"""Create an image with a w term phase term in it:
    
    .. math::

    I(l,m) = e^{-2 \\pi j (w(\\sqrt{1-l^2-m^2}-1)}

    
    The vis phasecentre is used as the delay centre for the w term (i.e. where n==0)

    :param phasecentre:
    :param im: template image
    :param w: w value to evaluate (default is median abs)
    :param remove_shift:
    :param dopol: Do screen in polarisation?
    :return: Image
    """ # for chan in range(nchan): #     for pol in range(npol): #         fim.data[chan, pol, ...] = w_beam(npixel, npixel * cellsize, w=w, cx=wcentre[0], #                                           cy=wcentre[1], remove_shift=remove_shift)
None
im
Image
None
w
w value to evaluate (default is median abs)
w value to evaluate ( default is median abs )
phasecentre
None
remove_shift
None
dopol
None