processing_components/calibration/operations.py
def create_gaintable_from_blockvisibility(vis: BlockVisibility, timeslice=None,
                                          frequencyslice: float = None, **kwargs) -> GainTable:
    """ Create gain table from visibility.
    
    This makes an empty gain table consistent with the BlockVisibility.
    
    :param vis: BlockVisibilty
    :param timeslice: Time interval between solutions (s)
    :param frequency_width: Frequency solution width (Hz)
    :return: GainTable
    
    """
    assert isinstance(vis, BlockVisibility), "vis is not a BlockVisibility: %r" % vis
    
    nants = vis.nants
    
    if timeslice is None or timeslice == 'auto':
        timeslice = numpy.min(vis.integration_time)
    
    utimes = timeslice * numpy.unique(numpy.round((vis.time - vis.time[0]) / timeslice))
    ntimes = len(utimes)
    gain_interval = timeslice * numpy.ones([ntimes])

    #    log.debug('create_gaintable_from_blockvisibility: times are %s' % str(utimes))
    #    log.debug('create_gaintable_from_blockvisibility: intervals are %s' % str(gain_interval))
    
    ntimes = len(utimes)
    ufrequency = numpy.unique(vis.frequency)
    nfrequency = len(ufrequency)
    
    receptor_frame = ReceptorFrame(vis.polarisation_frame.type)
    nrec = receptor_frame.nrec
    
    gainshape = [ntimes, nants, nfrequency, nrec, nrec]
    gain = numpy.ones(gainshape, dtype='complex')
    if nrec > 1:
        gain[..., 0, 1] = 0.0
        gain[..., 1, 0] = 0.0
    
    gain_weight = numpy.ones(gainshape)
    gain_time = utimes + vis.time[0]
    gain_frequency = ufrequency
    gain_residual = numpy.zeros([ntimes, nfrequency, nrec, nrec])
    
    gt = GainTable(gain=gain, time=gain_time, interval=gain_interval, weight=gain_weight, residual=gain_residual,
                   frequency=gain_frequency, receptor_frame=receptor_frame, phasecentre=vis.phasecentre,
                   configuration=vis.configuration)
    
    assert isinstance(gt, GainTable), "gt is not a GainTable: %r" % gt
    assert_vis_gt_compatible(vis, gt)
    
    return gt
 Create gain table from visibility.
    
    This makes an empty gain table consistent with the BlockVisibility.
    
    :param vis: BlockVisibilty
    :param timeslice: Time interval between solutions (s)
    :param frequency_width: Frequency solution width (Hz)
    :return: GainTable
    
    
Create gain table from visibility.
This makes an empty gain table consistent with the BlockVisibility.
Create gain table from visibility . This makes an empty gain table consistent with the BlockVisibility .
def create_gaintable_from_blockvisibility(vis: BlockVisibility, timeslice=None,
                                          frequencyslice: float = None, **kwargs) -> GainTable:
    assert isinstance(vis, BlockVisibility), "vis is not a BlockVisibility: %r" % vis
    nants = vis.nants
    if timeslice is None or timeslice == 'auto':
        timeslice = numpy.min(vis.integration_time)
    utimes = timeslice * numpy.unique(numpy.round((vis.time - vis.time[0]) / timeslice))
    ntimes = len(utimes)
    gain_interval = timeslice * numpy.ones([ntimes])
    ntimes = len(utimes)
    ufrequency = numpy.unique(vis.frequency)
    nfrequency = len(ufrequency)
    receptor_frame = ReceptorFrame(vis.polarisation_frame.type)
    nrec = receptor_frame.nrec
    gainshape = [ntimes, nants, nfrequency, nrec, nrec]
    gain = numpy.ones(gainshape, dtype='complex')
    if nrec > 1:
        gain[..., 0, 1] = 0.0
        gain[..., 1, 0] = 0.0
    gain_weight = numpy.ones(gainshape)
    gain_time = utimes + vis.time[0]
    gain_frequency = ufrequency
    gain_residual = numpy.zeros([ntimes, nfrequency, nrec, nrec])
    gt = GainTable(gain=gain, time=gain_time, interval=gain_interval, weight=gain_weight, residual=gain_residual,
                   frequency=gain_frequency, receptor_frame=receptor_frame, phasecentre=vis.phasecentre,
                   configuration=vis.configuration)
    assert isinstance(gt, GainTable), "gt is not a GainTable: %r" % gt
    assert_vis_gt_compatible(vis, gt)
    return gt
def create_gaintable_from_blockvisibility ( vis : BlockVisibility , timeslice = None , frequencyslice : float = None , ** kwargs ) -> GainTable : assert isinstance ( vis , BlockVisibility ) , "vis is not a BlockVisibility: %r" % vis nants = vis . nants if timeslice is None or timeslice == 'auto' : timeslice = numpy . min ( vis . integration_time ) utimes = timeslice * numpy . unique ( numpy . round ( ( vis . time - vis . time [ 0 ] ) / timeslice ) ) ntimes = len ( utimes ) gain_interval = timeslice * numpy . ones ( [ ntimes ] ) ntimes = len ( utimes ) ufrequency = numpy . unique ( vis . frequency ) nfrequency = len ( ufrequency ) receptor_frame = ReceptorFrame ( vis . polarisation_frame . type ) nrec = receptor_frame . nrec gainshape = [ ntimes , nants , nfrequency , nrec , nrec ] gain = numpy . ones ( gainshape , dtype = 'complex' ) if nrec > 1 : gain [ ... , 0 , 1 ] = 0.0 gain [ ... , 1 , 0 ] = 0.0 gain_weight = numpy . ones ( gainshape ) gain_time = utimes + vis . time [ 0 ] gain_frequency = ufrequency gain_residual = numpy . zeros ( [ ntimes , nfrequency , nrec , nrec ] ) gt = GainTable ( gain = gain , time = gain_time , interval = gain_interval , weight = gain_weight , residual = gain_residual , frequency = gain_frequency , receptor_frame = receptor_frame , phasecentre = vis . phasecentre , configuration = vis . configuration ) assert isinstance ( gt , GainTable ) , "gt is not a GainTable: %r" % gt assert_vis_gt_compatible ( vis , gt ) return gt
Create gain table from visibility.
Create gain table from visibility .
""" Create gain table from visibility.
    
    This makes an empty gain table consistent with the BlockVisibility.
    
    :param vis: BlockVisibilty
    :param timeslice: Time interval between solutions (s)
    :param frequency_width: Frequency solution width (Hz)
    :return: GainTable
    
    """ #    log.debug('create_gaintable_from_blockvisibility: times are %s' % str(utimes)) #    log.debug('create_gaintable_from_blockvisibility: intervals are %s' % str(gain_interval))
None
vis
BlockVisibility
None
timeslice
Time interval between solutions (s)
Time interval between solutions ( s )
frequencyslice
float
frequency_width
Frequency solution width (Hz)
Frequency solution width ( Hz )