processing_components/visibility/coalesce.py
def coalesce_visibility(vis: BlockVisibility, **kwargs) -> Visibility:
    """ Coalesce the BlockVisibility data_models. The output format is a Visibility, as needed for imaging

    Coalesce by baseline-dependent averaging (optional). The number of integrations averaged goes as the ratio of the
    maximum possible baseline length to that for this baseline. This number can be scaled by coalescence_factor and
    limited by max_coalescence.

    When faceting, the coalescence factors should be roughly the same as the number of facets on one axis.

    If coalescence_factor=0.0 then just a format conversion is done

    :param vis: BlockVisibility to be coalesced
    :return: Coalesced visibility with  cindex and blockvis filled in
    """

    assert isinstance(vis, BlockVisibility), "vis is not a BlockVisibility: %r" % vis

    time_coal = get_parameter(kwargs, 'time_coal', 0.0)
    max_time_coal = get_parameter(kwargs, 'max_time_coal', 100)
    frequency_coal = get_parameter(kwargs, 'frequency_coal', 0.0)
    max_frequency_coal = get_parameter(kwargs, 'max_frequency_coal', 100)

    if time_coal == 0.0 and frequency_coal == 0.0:
        return convert_blockvisibility_to_visibility((vis))

    cvis, cuvw, cwts, cimwt, ctime, cfrequency, cchannel_bandwidth, ca1, ca2, cintegration_time, cindex \
        = average_in_blocks(vis.data['vis'], vis.data['uvw'], vis.data['weight'], vis.data['imaging_weight'],
                            vis.time, vis.integration_time,
                            vis.frequency, vis.channel_bandwidth, time_coal, max_time_coal,
                            frequency_coal, max_frequency_coal)
    coalesced_vis = Visibility(uvw=cuvw, time=ctime, frequency=cfrequency,
                               channel_bandwidth=cchannel_bandwidth,
                               phasecentre=vis.phasecentre, antenna1=ca1, antenna2=ca2, vis=cvis,
                               weight=cwts, imaging_weight=cimwt,
                               configuration=vis.configuration, integration_time=cintegration_time,
                               polarisation_frame=vis.polarisation_frame, cindex=cindex,
                               blockvis=vis, meta=vis.meta)

    log.debug(
        'coalesce_visibility: Created new Visibility for coalesced data_models, coalescence factors (t,f) = (%.3f,%.3f)'
        % (time_coal, frequency_coal))
    log.debug('coalesce_visibility: Maximum coalescence (t,f) = (%d, %d)' % (max_time_coal, max_frequency_coal))
    log.debug('coalesce_visibility: Original %s, coalesced %s' % (vis_summary(vis),
                                                                  vis_summary(coalesced_vis)))

    return coalesced_vis
 Coalesce the BlockVisibility data_models. The output format is a Visibility, as needed for imaging

    Coalesce by baseline-dependent averaging (optional). The number of integrations averaged goes as the ratio of the
    maximum possible baseline length to that for this baseline. This number can be scaled by coalescence_factor and
    limited by max_coalescence.

    When faceting, the coalescence factors should be roughly the same as the number of facets on one axis.

    If coalescence_factor=0.0 then just a format conversion is done

    :param vis: BlockVisibility to be coalesced
    :return: Coalesced visibility with  cindex and blockvis filled in
    


When faceting, the coalescence factors should be roughly the same as the number of facets on one axis.

If coalescence_factor=0.0 then just a format conversion is done
When faceting the coalescence factors should be roughly the same as the number of facets on one axis . If coalescence_factor = 0 . 0 then just a format conversion is done
def coalesce_visibility(vis: BlockVisibility, **kwargs) -> Visibility:
    assert isinstance(vis, BlockVisibility), "vis is not a BlockVisibility: %r" % vis
    time_coal = get_parameter(kwargs, 'time_coal', 0.0)
    max_time_coal = get_parameter(kwargs, 'max_time_coal', 100)
    frequency_coal = get_parameter(kwargs, 'frequency_coal', 0.0)
    max_frequency_coal = get_parameter(kwargs, 'max_frequency_coal', 100)
    if time_coal == 0.0 and frequency_coal == 0.0:
        return convert_blockvisibility_to_visibility((vis))
    cvis, cuvw, cwts, cimwt, ctime, cfrequency, cchannel_bandwidth, ca1, ca2, cintegration_time, cindex \
        = average_in_blocks(vis.data['vis'], vis.data['uvw'], vis.data['weight'], vis.data['imaging_weight'],
                            vis.time, vis.integration_time,
                            vis.frequency, vis.channel_bandwidth, time_coal, max_time_coal,
                            frequency_coal, max_frequency_coal)
    coalesced_vis = Visibility(uvw=cuvw, time=ctime, frequency=cfrequency,
                               channel_bandwidth=cchannel_bandwidth,
                               phasecentre=vis.phasecentre, antenna1=ca1, antenna2=ca2, vis=cvis,
                               weight=cwts, imaging_weight=cimwt,
                               configuration=vis.configuration, integration_time=cintegration_time,
                               polarisation_frame=vis.polarisation_frame, cindex=cindex,
                               blockvis=vis, meta=vis.meta)
    log.debug(
        'coalesce_visibility: Created new Visibility for coalesced data_models, coalescence factors (t,f) = (%.3f,%.3f)'
        % (time_coal, frequency_coal))
    log.debug('coalesce_visibility: Maximum coalescence (t,f) = (%d, %d)' % (max_time_coal, max_frequency_coal))
    log.debug('coalesce_visibility: Original %s, coalesced %s' % (vis_summary(vis),
                                                                  vis_summary(coalesced_vis)))
    return coalesced_vis
def coalesce_visibility ( vis : BlockVisibility , ** kwargs ) -> Visibility : assert isinstance ( vis , BlockVisibility ) , "vis is not a BlockVisibility: %r" % vis time_coal = get_parameter ( kwargs , 'time_coal' , 0.0 ) max_time_coal = get_parameter ( kwargs , 'max_time_coal' , 100 ) frequency_coal = get_parameter ( kwargs , 'frequency_coal' , 0.0 ) max_frequency_coal = get_parameter ( kwargs , 'max_frequency_coal' , 100 ) if time_coal == 0.0 and frequency_coal == 0.0 : return convert_blockvisibility_to_visibility ( ( vis ) ) cvis , cuvw , cwts , cimwt , ctime , cfrequency , cchannel_bandwidth , ca1 , ca2 , cintegration_time , cindex = average_in_blocks ( vis . data [ 'vis' ] , vis . data [ 'uvw' ] , vis . data [ 'weight' ] , vis . data [ 'imaging_weight' ] , vis . time , vis . integration_time , vis . frequency , vis . channel_bandwidth , time_coal , max_time_coal , frequency_coal , max_frequency_coal ) coalesced_vis = Visibility ( uvw = cuvw , time = ctime , frequency = cfrequency , channel_bandwidth = cchannel_bandwidth , phasecentre = vis . phasecentre , antenna1 = ca1 , antenna2 = ca2 , vis = cvis , weight = cwts , imaging_weight = cimwt , configuration = vis . configuration , integration_time = cintegration_time , polarisation_frame = vis . polarisation_frame , cindex = cindex , blockvis = vis , meta = vis . meta ) log . debug ( 'coalesce_visibility: Created new Visibility for coalesced data_models, coalescence factors (t,f) = (%.3f,%.3f)' % ( time_coal , frequency_coal ) ) log . debug ( 'coalesce_visibility: Maximum coalescence (t,f) = (%d, %d)' % ( max_time_coal , max_frequency_coal ) ) log . debug ( 'coalesce_visibility: Original %s, coalesced %s' % ( vis_summary ( vis ) , vis_summary ( coalesced_vis ) ) ) return coalesced_vis
Coalesce the BlockVisibility data_models.
Coalesce the BlockVisibility data_models .
""" Coalesce the BlockVisibility data_models. The output format is a Visibility, as needed for imaging

    Coalesce by baseline-dependent averaging (optional). The number of integrations averaged goes as the ratio of the
    maximum possible baseline length to that for this baseline. This number can be scaled by coalescence_factor and
    limited by max_coalescence.

    When faceting, the coalescence factors should be roughly the same as the number of facets on one axis.

    If coalescence_factor=0.0 then just a format conversion is done

    :param vis: BlockVisibility to be coalesced
    :return: Coalesced visibility with  cindex and blockvis filled in
    """
Coalesced visibility with  cindex and blockvis filled in
Coalesced visibility with cindex and blockvis filled in
vis
BlockVisibility
BlockVisibility to be coalesced
BlockVisibility to be coalesced