processing_components/visibility/operations.py
def sum_visibility(vis: Visibility, direction: SkyCoord) -> numpy.array:
    """ Direct Fourier summation in a given direction

    :param vis: Visibility to be summed
    :param direction: Direction of summation
    :return: flux[nch,npol], weight[nch,pol]
    """
    # TODO: Convert to Visibility or remove?
    
    assert isinstance(vis, Visibility) or isinstance(vis, BlockVisibility), vis
    
    svis = copy_visibility(vis)
    
    l, m, n = skycoord_to_lmn(direction, svis.phasecentre)
    phasor = numpy.conjugate(simulate_point(svis.uvw, l, m))
    
    # Need to put correct mapping here
    _, frequency = get_frequency_map(svis, None)
    
    frequency = list(frequency)
    
    nchan = max(frequency) + 1
    npol = svis.polarisation_frame.npol
    
    flux = numpy.zeros([nchan, npol])
    weight = numpy.zeros([nchan, npol])
    
    coords = svis.vis, svis.weight, phasor, list(frequency)
    for v, wt, p, ic in zip(*coords):
        for pol in range(npol):
            flux[ic, pol] += numpy.real(wt[pol] * v[pol] * p)
            weight[ic, pol] += wt[pol]
    
    flux[weight > 0.0] = flux[weight > 0.0] / weight[weight > 0.0]
    flux[weight <= 0.0] = 0.0
    return flux, weight
 Direct Fourier summation in a given direction

    :param vis: Visibility to be summed
    :param direction: Direction of summation
    :return: flux[nch,npol], weight[nch,pol]
    
Direct Fourier summation in a given direction
Direct Fourier summation in a given direction
def sum_visibility(vis: Visibility, direction: SkyCoord) -> numpy.array:
    assert isinstance(vis, Visibility) or isinstance(vis, BlockVisibility), vis
    svis = copy_visibility(vis)
    l, m, n = skycoord_to_lmn(direction, svis.phasecentre)
    phasor = numpy.conjugate(simulate_point(svis.uvw, l, m))
    _, frequency = get_frequency_map(svis, None)
    frequency = list(frequency)
    nchan = max(frequency) + 1
    npol = svis.polarisation_frame.npol
    flux = numpy.zeros([nchan, npol])
    weight = numpy.zeros([nchan, npol])
    coords = svis.vis, svis.weight, phasor, list(frequency)
    for v, wt, p, ic in zip(*coords):
        for pol in range(npol):
            flux[ic, pol] += numpy.real(wt[pol] * v[pol] * p)
            weight[ic, pol] += wt[pol]
    flux[weight > 0.0] = flux[weight > 0.0] / weight[weight > 0.0]
    flux[weight <= 0.0] = 0.0
    return flux, weight
def sum_visibility ( vis : Visibility , direction : SkyCoord ) -> numpy . array : assert isinstance ( vis , Visibility ) or isinstance ( vis , BlockVisibility ) , vis svis = copy_visibility ( vis ) l , m , n = skycoord_to_lmn ( direction , svis . phasecentre ) phasor = numpy . conjugate ( simulate_point ( svis . uvw , l , m ) ) _ , frequency = get_frequency_map ( svis , None ) frequency = list ( frequency ) nchan = max ( frequency ) + 1 npol = svis . polarisation_frame . npol flux = numpy . zeros ( [ nchan , npol ] ) weight = numpy . zeros ( [ nchan , npol ] ) coords = svis . vis , svis . weight , phasor , list ( frequency ) for v , wt , p , ic in zip ( * coords ) : for pol in range ( npol ) : flux [ ic , pol ] += numpy . real ( wt [ pol ] * v [ pol ] * p ) weight [ ic , pol ] += wt [ pol ] flux [ weight > 0.0 ] = flux [ weight > 0.0 ] / weight [ weight > 0.0 ] flux [ weight <= 0.0 ] = 0.0 return flux , weight
Direct Fourier summation in a given direction
Direct Fourier summation in a given direction
""" Direct Fourier summation in a given direction

    :param vis: Visibility to be summed
    :param direction: Direction of summation
    :return: flux[nch,npol], weight[nch,pol]
    """ # TODO: Convert to Visibility or remove? # Need to put correct mapping here
None
vis
Visibility
Visibility to be summed
Visibility to be summed
direction
SkyCoord
Direction of summation
Direction of summation