processing_components/visibility/operations.py
def integrate_visibility_by_channel(vis: BlockVisibility) -> BlockVisibility:
    """ Integrate visibility across channels, returning new visibility
    
    :param vis:
    :return: BlockVisibility
    """
    
    assert isinstance(vis, Visibility) or isinstance(vis, BlockVisibility), vis
    
    vis_shape = list(vis.vis.shape)
    ntimes, nants, _, nchan, npol = vis_shape
    vis_shape[-2] = 1
    newvis = BlockVisibility(data=None,
                             frequency=numpy.ones([1]) * numpy.average(vis.frequency),
                             channel_bandwidth=numpy.ones([1]) * numpy.sum(vis.channel_bandwidth),
                             phasecentre=vis.phasecentre,
                             configuration=vis.configuration,
                             uvw=vis.uvw,
                             time=vis.time,
                             vis=numpy.zeros(vis_shape, dtype='complex'),
                             weight=numpy.zeros(vis_shape, dtype='float'),
                             imaging_weight=numpy.zeros(vis_shape, dtype='float'),
                             integration_time=vis.integration_time,
                             polarisation_frame=vis.polarisation_frame,
                             source=vis.source,
                             meta=vis.meta)
    
    newvis.data['vis'][..., 0, :] = numpy.sum(vis.data['vis'] * vis.data['weight'], axis=-2)
    newvis.data['weight'][..., 0, :] = numpy.sum(vis.data['weight'], axis=-2)
    newvis.data['imaging_weight'][..., 0, :] = numpy.sum(vis.data['imaging_weight'], axis=-2)
    mask = newvis.data['weight'] > 0.0
    newvis.data['vis'][mask] = newvis.data['vis'][mask] / newvis.data['weight'][mask]
    
    return newvis
 Integrate visibility across channels, returning new visibility
    
    :param vis:
    :return: BlockVisibility
    
Integrate visibility across channels, returning new visibility
Integrate visibility across channels returning new visibility
def integrate_visibility_by_channel(vis: BlockVisibility) -> BlockVisibility:
    assert isinstance(vis, Visibility) or isinstance(vis, BlockVisibility), vis
    vis_shape = list(vis.vis.shape)
    ntimes, nants, _, nchan, npol = vis_shape
    vis_shape[-2] = 1
    newvis = BlockVisibility(data=None,
                             frequency=numpy.ones([1]) * numpy.average(vis.frequency),
                             channel_bandwidth=numpy.ones([1]) * numpy.sum(vis.channel_bandwidth),
                             phasecentre=vis.phasecentre,
                             configuration=vis.configuration,
                             uvw=vis.uvw,
                             time=vis.time,
                             vis=numpy.zeros(vis_shape, dtype='complex'),
                             weight=numpy.zeros(vis_shape, dtype='float'),
                             imaging_weight=numpy.zeros(vis_shape, dtype='float'),
                             integration_time=vis.integration_time,
                             polarisation_frame=vis.polarisation_frame,
                             source=vis.source,
                             meta=vis.meta)
    newvis.data['vis'][..., 0, :] = numpy.sum(vis.data['vis'] * vis.data['weight'], axis=-2)
    newvis.data['weight'][..., 0, :] = numpy.sum(vis.data['weight'], axis=-2)
    newvis.data['imaging_weight'][..., 0, :] = numpy.sum(vis.data['imaging_weight'], axis=-2)
    mask = newvis.data['weight'] > 0.0
    newvis.data['vis'][mask] = newvis.data['vis'][mask] / newvis.data['weight'][mask]
    return newvis
def integrate_visibility_by_channel ( vis : BlockVisibility ) -> BlockVisibility : assert isinstance ( vis , Visibility ) or isinstance ( vis , BlockVisibility ) , vis vis_shape = list ( vis . vis . shape ) ntimes , nants , _ , nchan , npol = vis_shape vis_shape [ - 2 ] = 1 newvis = BlockVisibility ( data = None , frequency = numpy . ones ( [ 1 ] ) * numpy . average ( vis . frequency ) , channel_bandwidth = numpy . ones ( [ 1 ] ) * numpy . sum ( vis . channel_bandwidth ) , phasecentre = vis . phasecentre , configuration = vis . configuration , uvw = vis . uvw , time = vis . time , vis = numpy . zeros ( vis_shape , dtype = 'complex' ) , weight = numpy . zeros ( vis_shape , dtype = 'float' ) , imaging_weight = numpy . zeros ( vis_shape , dtype = 'float' ) , integration_time = vis . integration_time , polarisation_frame = vis . polarisation_frame , source = vis . source , meta = vis . meta ) newvis . data [ 'vis' ] [ ... , 0 , : ] = numpy . sum ( vis . data [ 'vis' ] * vis . data [ 'weight' ] , axis = - 2 ) newvis . data [ 'weight' ] [ ... , 0 , : ] = numpy . sum ( vis . data [ 'weight' ] , axis = - 2 ) newvis . data [ 'imaging_weight' ] [ ... , 0 , : ] = numpy . sum ( vis . data [ 'imaging_weight' ] , axis = - 2 ) mask = newvis . data [ 'weight' ] > 0.0 newvis . data [ 'vis' ] [ mask ] = newvis . data [ 'vis' ] [ mask ] / newvis . data [ 'weight' ] [ mask ] return newvis
Integrate visibility across channels, returning new visibility
Integrate visibility across channels returning new visibility
""" Integrate visibility across channels, returning new visibility
    
    :param vis:
    :return: BlockVisibility
    """
None
vis
BlockVisibility
None