processing_components/visibility/coalesce.py
def decoalesce_visibility(vis: Visibility, **kwargs) -> BlockVisibility:
    """ Decoalesce the visibilities to the original values (opposite of coalesce_visibility)

    This relies upon the block vis and the index being part of the vis. Needs the index generated by coalesce_visibility

    :param vis: (Coalesced visibility)
    :return: BlockVisibility with vis and weight columns overwritten
    """

    assert isinstance(vis, Visibility), "vis is not a Visibility: %r" % vis
    assert isinstance(vis.blockvis, BlockVisibility), "No blockvisibility in vis %r" % vis
    assert vis.cindex is not None, "No reverse index in Visibility %r" % vis

    log.debug('decoalesce_visibility: Created new Visibility for decoalesced data_models')
    decomp_vis = copy_visibility(vis.blockvis)

    vshape = decomp_vis.data['vis'].shape

    npol = vshape[-1]
    dvis = numpy.zeros(vshape, dtype='complex')
    assert numpy.max(vis.cindex) < dvis.size
    assert numpy.max(vis.cindex) < vis.vis.shape[0], "Incorrect template used in decoalescing"
    for i in range(dvis.size // npol):
        decomp_vis.data['vis'].flat[i:i + npol] = vis.data['vis'][vis.cindex[i]]
        decomp_vis.data['weight'].flat[i:i + npol] = vis.data['weight'][vis.cindex[i]]
        decomp_vis.data['imaging_weight'].flat[i:i + npol] = vis.data['imaging_weight'][vis.cindex[i]]

    log.debug('decoalesce_visibility: Coalesced %s, decoalesced %s' % (vis_summary(vis),
                                                                       vis_summary(
                                                                           decomp_vis)))

    return decomp_vis
 Decoalesce the visibilities to the original values (opposite of coalesce_visibility)

    This relies upon the block vis and the index being part of the vis. Needs the index generated by coalesce_visibility

    :param vis: (Coalesced visibility)
    :return: BlockVisibility with vis and weight columns overwritten
    
Decoalesce the visibilities to the original values (opposite of coalesce_visibility)
This relies upon the block vis and the index being part of the vis. Needs the index generated by coalesce_visibility
Decoalesce the visibilities to the original values ( opposite of coalesce_visibility ) This relies upon the block vis and the index being part of the vis . Needs the index generated by coalesce_visibility
def decoalesce_visibility(vis: Visibility, **kwargs) -> BlockVisibility:
    assert isinstance(vis, Visibility), "vis is not a Visibility: %r" % vis
    assert isinstance(vis.blockvis, BlockVisibility), "No blockvisibility in vis %r" % vis
    assert vis.cindex is not None, "No reverse index in Visibility %r" % vis
    log.debug('decoalesce_visibility: Created new Visibility for decoalesced data_models')
    decomp_vis = copy_visibility(vis.blockvis)
    vshape = decomp_vis.data['vis'].shape
    npol = vshape[-1]
    dvis = numpy.zeros(vshape, dtype='complex')
    assert numpy.max(vis.cindex) < dvis.size
    assert numpy.max(vis.cindex) < vis.vis.shape[0], "Incorrect template used in decoalescing"
    for i in range(dvis.size // npol):
        decomp_vis.data['vis'].flat[i:i + npol] = vis.data['vis'][vis.cindex[i]]
        decomp_vis.data['weight'].flat[i:i + npol] = vis.data['weight'][vis.cindex[i]]
        decomp_vis.data['imaging_weight'].flat[i:i + npol] = vis.data['imaging_weight'][vis.cindex[i]]
    log.debug('decoalesce_visibility: Coalesced %s, decoalesced %s' % (vis_summary(vis),
                                                                       vis_summary(
                                                                           decomp_vis)))
    return decomp_vis
def decoalesce_visibility ( vis : Visibility , ** kwargs ) -> BlockVisibility : assert isinstance ( vis , Visibility ) , "vis is not a Visibility: %r" % vis assert isinstance ( vis . blockvis , BlockVisibility ) , "No blockvisibility in vis %r" % vis assert vis . cindex is not None , "No reverse index in Visibility %r" % vis log . debug ( 'decoalesce_visibility: Created new Visibility for decoalesced data_models' ) decomp_vis = copy_visibility ( vis . blockvis ) vshape = decomp_vis . data [ 'vis' ] . shape npol = vshape [ - 1 ] dvis = numpy . zeros ( vshape , dtype = 'complex' ) assert numpy . max ( vis . cindex ) < dvis . size assert numpy . max ( vis . cindex ) < vis . vis . shape [ 0 ] , "Incorrect template used in decoalescing" for i in range ( dvis . size // npol ) : decomp_vis . data [ 'vis' ] . flat [ i : i + npol ] = vis . data [ 'vis' ] [ vis . cindex [ i ] ] decomp_vis . data [ 'weight' ] . flat [ i : i + npol ] = vis . data [ 'weight' ] [ vis . cindex [ i ] ] decomp_vis . data [ 'imaging_weight' ] . flat [ i : i + npol ] = vis . data [ 'imaging_weight' ] [ vis . cindex [ i ] ] log . debug ( 'decoalesce_visibility: Coalesced %s, decoalesced %s' % ( vis_summary ( vis ) , vis_summary ( decomp_vis ) ) ) return decomp_vis
Decoalesce the visibilities to the original values (opposite of coalesce_visibility)
This relies upon the block vis and the index being part of the vis.
Decoalesce the visibilities to the original values ( opposite of coalesce_visibility ) This relies upon the block vis and the index being part of the vis .
""" Decoalesce the visibilities to the original values (opposite of coalesce_visibility)

    This relies upon the block vis and the index being part of the vis. Needs the index generated by coalesce_visibility

    :param vis: (Coalesced visibility)
    :return: BlockVisibility with vis and weight columns overwritten
    """
BlockVisibility with vis and weight columns overwritten
BlockVisibility with vis and weight columns overwritten
vis
Visibility
None