processing_components/visibility/msv2.py
def _write_spectralwindow_table(self):
            """
            Write the spectral window table.
            """

            # Spectral Window

            nBand = len(self.freq)

            col1 = tableutil.makescacoldesc('MEAS_FREQ_REF', 0,
                                            comment='Frequency Measure reference')
            col2 = tableutil.makearrcoldesc('CHAN_FREQ', 0.0, 1,
                                            comment='Center frequencies for each channel in the data matrix',
                                            keywords={'QuantumUnits': ['Hz', ],
                                                      'MEASINFO': {'type': 'frequency',
                                                                   'VarRefCol': 'MEAS_FREQ_REF',
                                                                   'TabRefTypes': ['REST', 'LSRK', 'LSRD', 'BARY',
                                                                                   'GEO',
                                                                                   'TOPO', 'GALACTO', 'LGROUP', 'CMB',
                                                                                   'Undefined'],
                                                                   'TabRefCodes': [0, 1, 2, 3, 4, 5, 6, 7, 8, 64]}
                                                      })
            col3 = tableutil.makescacoldesc('REF_FREQUENCY', self.refVal,
                                            comment='The reference frequency',
                                            keywords={'QuantumUnits': ['Hz', ],
                                                      'MEASINFO': {'type': 'frequency',
                                                                   'VarRefCol': 'MEAS_FREQ_REF',
                                                                   'TabRefTypes': ['REST', 'LSRK', 'LSRD', 'BARY',
                                                                                   'GEO',
                                                                                   'TOPO', 'GALACTO', 'LGROUP', 'CMB',
                                                                                   'Undefined'],
                                                                   'TabRefCodes': [0, 1, 2, 3, 4, 5, 6, 7, 8, 64]}
                                                      })
            col4 = tableutil.makearrcoldesc('CHAN_WIDTH', 0.0, 1,
                                            comment='Channel width for each channel',
                                            keywords={'QuantumUnits': ['Hz', ]})
            col5 = tableutil.makearrcoldesc('EFFECTIVE_BW', 0.0, 1,
                                            comment='Effective noise bandwidth of each channel',
                                            keywords={'QuantumUnits': ['Hz', ]})
            col6 = tableutil.makearrcoldesc('RESOLUTION', 0.0, 1,
                                            comment='The effective noise bandwidth for each channel',
                                            keywords={'QuantumUnits': ['Hz', ]})
            col7 = tableutil.makescacoldesc('FLAG_ROW', False,
                                            comment='flag')
            col8 = tableutil.makescacoldesc('FREQ_GROUP', 1,
                                            comment='Frequency group')
            col9 = tableutil.makescacoldesc('FREQ_GROUP_NAME', "group1",
                                            comment='Frequency group name')
            col10 = tableutil.makescacoldesc('IF_CONV_CHAIN', 0,
                                             comment='The IF conversion chain number')
            col11 = tableutil.makescacoldesc('NAME', "%i channels" % self.nchan,
                                             comment='Spectral window name')
            col12 = tableutil.makescacoldesc('NET_SIDEBAND', 0,
                                             comment='Net sideband')
            col13 = tableutil.makescacoldesc('NUM_CHAN', 0,
                                             comment='Number of spectral channels')
            col14 = tableutil.makescacoldesc('TOTAL_BANDWIDTH', 0.0,
                                             comment='The total bandwidth for this window',
                                             keywords={'QuantumUnits': ['Hz', ]})

            desc = tableutil.maketabdesc([col1, col2, col3, col4, col5, col6, col7, col8, col9,
                                          col10, col11, col12, col13, col14])
            tb = table("%s/SPECTRAL_WINDOW" % self.basename, desc, nrow=nBand, ack=False)

            for i, freq in enumerate(self.freq):
                tb.putcell('MEAS_FREQ_REF', i, 5)  #https://github.com/ska-sa/pyxis/issues/27
                tb.putcell('CHAN_FREQ', i, self.refVal + freq.bandFreq + numpy.arange(self.nchan) * self.channelWidth)
                tb.putcell('REF_FREQUENCY', i, self.refVal)
                tb.putcell('CHAN_WIDTH', i, [freq.chWidth for j in range(self.nchan)])
                tb.putcell('EFFECTIVE_BW', i, [freq.chWidth for j in range(self.nchan)])
                tb.putcell('RESOLUTION', i, [freq.chWidth for j in range(self.nchan)])
                tb.putcell('FLAG_ROW', i, False)
                tb.putcell('FREQ_GROUP', i, i + 1)
                tb.putcell('FREQ_GROUP_NAME', i, 'group%i' % (i + 1))
                tb.putcell('IF_CONV_CHAIN', i, i)
                tb.putcell('NAME', i, "IF %i, %i channels" % (i + 1, self.nchan))
                tb.putcell('NET_SIDEBAND', i, 0)
                tb.putcell('NUM_CHAN', i, self.nchan)
                tb.putcell('TOTAL_BANDWIDTH', i, freq.totalBW)

            tb.flush()
            tb.close()

            Write the spectral window table.
            
Write the spectral window table.
Write the spectral window table .
def _write_spectralwindow_table(self):
            nBand = len(self.freq)
            col1 = tableutil.makescacoldesc('MEAS_FREQ_REF', 0,
                                            comment='Frequency Measure reference')
            col2 = tableutil.makearrcoldesc('CHAN_FREQ', 0.0, 1,
                                            comment='Center frequencies for each channel in the data matrix',
                                            keywords={'QuantumUnits': ['Hz', ],
                                                      'MEASINFO': {'type': 'frequency',
                                                                   'VarRefCol': 'MEAS_FREQ_REF',
                                                                   'TabRefTypes': ['REST', 'LSRK', 'LSRD', 'BARY',
                                                                                   'GEO',
                                                                                   'TOPO', 'GALACTO', 'LGROUP', 'CMB',
                                                                                   'Undefined'],
                                                                   'TabRefCodes': [0, 1, 2, 3, 4, 5, 6, 7, 8, 64]}
                                                      })
            col3 = tableutil.makescacoldesc('REF_FREQUENCY', self.refVal,
                                            comment='The reference frequency',
                                            keywords={'QuantumUnits': ['Hz', ],
                                                      'MEASINFO': {'type': 'frequency',
                                                                   'VarRefCol': 'MEAS_FREQ_REF',
                                                                   'TabRefTypes': ['REST', 'LSRK', 'LSRD', 'BARY',
                                                                                   'GEO',
                                                                                   'TOPO', 'GALACTO', 'LGROUP', 'CMB',
                                                                                   'Undefined'],
                                                                   'TabRefCodes': [0, 1, 2, 3, 4, 5, 6, 7, 8, 64]}
                                                      })
            col4 = tableutil.makearrcoldesc('CHAN_WIDTH', 0.0, 1,
                                            comment='Channel width for each channel',
                                            keywords={'QuantumUnits': ['Hz', ]})
            col5 = tableutil.makearrcoldesc('EFFECTIVE_BW', 0.0, 1,
                                            comment='Effective noise bandwidth of each channel',
                                            keywords={'QuantumUnits': ['Hz', ]})
            col6 = tableutil.makearrcoldesc('RESOLUTION', 0.0, 1,
                                            comment='The effective noise bandwidth for each channel',
                                            keywords={'QuantumUnits': ['Hz', ]})
            col7 = tableutil.makescacoldesc('FLAG_ROW', False,
                                            comment='flag')
            col8 = tableutil.makescacoldesc('FREQ_GROUP', 1,
                                            comment='Frequency group')
            col9 = tableutil.makescacoldesc('FREQ_GROUP_NAME', "group1",
                                            comment='Frequency group name')
            col10 = tableutil.makescacoldesc('IF_CONV_CHAIN', 0,
                                             comment='The IF conversion chain number')
            col11 = tableutil.makescacoldesc('NAME', "%i channels" % self.nchan,
                                             comment='Spectral window name')
            col12 = tableutil.makescacoldesc('NET_SIDEBAND', 0,
                                             comment='Net sideband')
            col13 = tableutil.makescacoldesc('NUM_CHAN', 0,
                                             comment='Number of spectral channels')
            col14 = tableutil.makescacoldesc('TOTAL_BANDWIDTH', 0.0,
                                             comment='The total bandwidth for this window',
                                             keywords={'QuantumUnits': ['Hz', ]})
            desc = tableutil.maketabdesc([col1, col2, col3, col4, col5, col6, col7, col8, col9,
                                          col10, col11, col12, col13, col14])
            tb = table("%s/SPECTRAL_WINDOW" % self.basename, desc, nrow=nBand, ack=False)
            for i, freq in enumerate(self.freq):
                tb.putcell('MEAS_FREQ_REF', i, 5)  
                tb.putcell('CHAN_FREQ', i, self.refVal + freq.bandFreq + numpy.arange(self.nchan) * self.channelWidth)
                tb.putcell('REF_FREQUENCY', i, self.refVal)
                tb.putcell('CHAN_WIDTH', i, [freq.chWidth for j in range(self.nchan)])
                tb.putcell('EFFECTIVE_BW', i, [freq.chWidth for j in range(self.nchan)])
                tb.putcell('RESOLUTION', i, [freq.chWidth for j in range(self.nchan)])
                tb.putcell('FLAG_ROW', i, False)
                tb.putcell('FREQ_GROUP', i, i + 1)
                tb.putcell('FREQ_GROUP_NAME', i, 'group%i' % (i + 1))
                tb.putcell('IF_CONV_CHAIN', i, i)
                tb.putcell('NAME', i, "IF %i, %i channels" % (i + 1, self.nchan))
                tb.putcell('NET_SIDEBAND', i, 0)
                tb.putcell('NUM_CHAN', i, self.nchan)
                tb.putcell('TOTAL_BANDWIDTH', i, freq.totalBW)
            tb.flush()
            tb.close()
def _write_spectralwindow_table ( self ) : nBand = len ( self . freq ) col1 = tableutil . makescacoldesc ( 'MEAS_FREQ_REF' , 0 , comment = 'Frequency Measure reference' ) col2 = tableutil . makearrcoldesc ( 'CHAN_FREQ' , 0.0 , 1 , comment = 'Center frequencies for each channel in the data matrix' , keywords = { 'QuantumUnits' : [ 'Hz' , ] , 'MEASINFO' : { 'type' : 'frequency' , 'VarRefCol' : 'MEAS_FREQ_REF' , 'TabRefTypes' : [ 'REST' , 'LSRK' , 'LSRD' , 'BARY' , 'GEO' , 'TOPO' , 'GALACTO' , 'LGROUP' , 'CMB' , 'Undefined' ] , 'TabRefCodes' : [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 64 ] } } ) col3 = tableutil . makescacoldesc ( 'REF_FREQUENCY' , self . refVal , comment = 'The reference frequency' , keywords = { 'QuantumUnits' : [ 'Hz' , ] , 'MEASINFO' : { 'type' : 'frequency' , 'VarRefCol' : 'MEAS_FREQ_REF' , 'TabRefTypes' : [ 'REST' , 'LSRK' , 'LSRD' , 'BARY' , 'GEO' , 'TOPO' , 'GALACTO' , 'LGROUP' , 'CMB' , 'Undefined' ] , 'TabRefCodes' : [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 64 ] } } ) col4 = tableutil . makearrcoldesc ( 'CHAN_WIDTH' , 0.0 , 1 , comment = 'Channel width for each channel' , keywords = { 'QuantumUnits' : [ 'Hz' , ] } ) col5 = tableutil . makearrcoldesc ( 'EFFECTIVE_BW' , 0.0 , 1 , comment = 'Effective noise bandwidth of each channel' , keywords = { 'QuantumUnits' : [ 'Hz' , ] } ) col6 = tableutil . makearrcoldesc ( 'RESOLUTION' , 0.0 , 1 , comment = 'The effective noise bandwidth for each channel' , keywords = { 'QuantumUnits' : [ 'Hz' , ] } ) col7 = tableutil . makescacoldesc ( 'FLAG_ROW' , False , comment = 'flag' ) col8 = tableutil . makescacoldesc ( 'FREQ_GROUP' , 1 , comment = 'Frequency group' ) col9 = tableutil . makescacoldesc ( 'FREQ_GROUP_NAME' , "group1" , comment = 'Frequency group name' ) col10 = tableutil . makescacoldesc ( 'IF_CONV_CHAIN' , 0 , comment = 'The IF conversion chain number' ) col11 = tableutil . makescacoldesc ( 'NAME' , "%i channels" % self . nchan , comment = 'Spectral window name' ) col12 = tableutil . makescacoldesc ( 'NET_SIDEBAND' , 0 , comment = 'Net sideband' ) col13 = tableutil . makescacoldesc ( 'NUM_CHAN' , 0 , comment = 'Number of spectral channels' ) col14 = tableutil . makescacoldesc ( 'TOTAL_BANDWIDTH' , 0.0 , comment = 'The total bandwidth for this window' , keywords = { 'QuantumUnits' : [ 'Hz' , ] } ) desc = tableutil . maketabdesc ( [ col1 , col2 , col3 , col4 , col5 , col6 , col7 , col8 , col9 , col10 , col11 , col12 , col13 , col14 ] ) tb = table ( "%s/SPECTRAL_WINDOW" % self . basename , desc , nrow = nBand , ack = False ) for i , freq in enumerate ( self . freq ) : tb . putcell ( 'MEAS_FREQ_REF' , i , 5 ) tb . putcell ( 'CHAN_FREQ' , i , self . refVal + freq . bandFreq + numpy . arange ( self . nchan ) * self . channelWidth ) tb . putcell ( 'REF_FREQUENCY' , i , self . refVal ) tb . putcell ( 'CHAN_WIDTH' , i , [ freq . chWidth for j in range ( self . nchan ) ] ) tb . putcell ( 'EFFECTIVE_BW' , i , [ freq . chWidth for j in range ( self . nchan ) ] ) tb . putcell ( 'RESOLUTION' , i , [ freq . chWidth for j in range ( self . nchan ) ] ) tb . putcell ( 'FLAG_ROW' , i , False ) tb . putcell ( 'FREQ_GROUP' , i , i + 1 ) tb . putcell ( 'FREQ_GROUP_NAME' , i , 'group%i' % ( i + 1 ) ) tb . putcell ( 'IF_CONV_CHAIN' , i , i ) tb . putcell ( 'NAME' , i , "IF %i, %i channels" % ( i + 1 , self . nchan ) ) tb . putcell ( 'NET_SIDEBAND' , i , 0 ) tb . putcell ( 'NUM_CHAN' , i , self . nchan ) tb . putcell ( 'TOTAL_BANDWIDTH' , i , freq . totalBW ) tb . flush ( ) tb . close ( )
Write the spectral window table.
Write the spectral window table .
"""
            Write the spectral window table.
            """ # Spectral Window #https://github.com/ska-sa/pyxis/issues/27
self