processing_components/visibility/gather_scatter.py
def visibility_gather(visibility_list: List[Visibility], vis: Visibility, vis_iter, vis_slices=None) -> Visibility:
    """Gather a list of subvisibilities back into a visibility
    
    The iterator setup must be the same as used in the scatter.

    :param visibility_list: List of subvisibilities
    :param vis: Output visibility
    :param vis_iter: visibility iterator
    :param vis_slices: Number of slices to be gathered (optional)
    :return: vis
    """
    
    if vis_slices == 1:
        return visibility_list[0]
    
    if vis_slices is None:
        vis_slices = len(visibility_list)
    
    rowses = []
    for i, rows in enumerate(vis_iter(vis, vis_slices=vis_slices)):
        rowses.append(rows)

    for i, rows in enumerate(rowses):
        assert i < len(visibility_list), "Gather not consistent with scatter for slice %d" % i
        if visibility_list[i] is not None and numpy.sum(rows):
            assert numpy.sum(rows) == visibility_list[i].nvis, \
                "Mismatch in number of rows (%d, %d) in gather for slice %d" % \
            (numpy.sum(rows), visibility_list[i].nvis, i)
            vis.data[rows] = visibility_list[i].data[...]
    
    return vis
Gather a list of subvisibilities back into a visibility
    
    The iterator setup must be the same as used in the scatter.

    :param visibility_list: List of subvisibilities
    :param vis: Output visibility
    :param vis_iter: visibility iterator
    :param vis_slices: Number of slices to be gathered (optional)
    :return: vis
    
Gather a list of subvisibilities back into a visibility
The iterator setup must be the same as used in the scatter.
Gather a list of subvisibilities back into a visibility The iterator setup must be the same as used in the scatter .
def visibility_gather(visibility_list: List[Visibility], vis: Visibility, vis_iter, vis_slices=None) -> Visibility:
    if vis_slices == 1:
        return visibility_list[0]
    if vis_slices is None:
        vis_slices = len(visibility_list)
    rowses = []
    for i, rows in enumerate(vis_iter(vis, vis_slices=vis_slices)):
        rowses.append(rows)
    for i, rows in enumerate(rowses):
        assert i < len(visibility_list), "Gather not consistent with scatter for slice %d" % i
        if visibility_list[i] is not None and numpy.sum(rows):
            assert numpy.sum(rows) == visibility_list[i].nvis, \
                "Mismatch in number of rows (%d, %d) in gather for slice %d" % \
            (numpy.sum(rows), visibility_list[i].nvis, i)
            vis.data[rows] = visibility_list[i].data[...]
    return vis
def visibility_gather ( visibility_list : List [ Visibility ] , vis : Visibility , vis_iter , vis_slices = None ) -> Visibility : if vis_slices == 1 : return visibility_list [ 0 ] if vis_slices is None : vis_slices = len ( visibility_list ) rowses = [ ] for i , rows in enumerate ( vis_iter ( vis , vis_slices = vis_slices ) ) : rowses . append ( rows ) for i , rows in enumerate ( rowses ) : assert i < len ( visibility_list ) , "Gather not consistent with scatter for slice %d" % i if visibility_list [ i ] is not None and numpy . sum ( rows ) : assert numpy . sum ( rows ) == visibility_list [ i ] . nvis , "Mismatch in number of rows (%d, %d) in gather for slice %d" % ( numpy . sum ( rows ) , visibility_list [ i ] . nvis , i ) vis . data [ rows ] = visibility_list [ i ] . data [ ... ] return vis
Gather a list of subvisibilities back into a visibility
The iterator setup must be the same as used in the scatter.
Gather a list of subvisibilities back into a visibility The iterator setup must be the same as used in the scatter .
"""Gather a list of subvisibilities back into a visibility
    
    The iterator setup must be the same as used in the scatter.

    :param visibility_list: List of subvisibilities
    :param vis: Output visibility
    :param vis_iter: visibility iterator
    :param vis_slices: Number of slices to be gathered (optional)
    :return: vis
    """
None
visibility_list
List[Visibility]
List of subvisibilities
List of subvisibilities
vis
Visibility
None
vis_iter
None
vis_slices
Number of slices to be gathered (optional)
Number of slices to be gathered ( optional )