tests/processing_components/test_export_ms.py
def __initData(self):
        """Private function to generate a random set of data for writing a UVFITS
        file.  The data is returned as a dictionary with keys:
         * freq - frequency array in Hz
         * site - Observatory object
         * stands - array of stand numbers
         * bl - list of baseline pairs in real stand numbers
         * vis - array of visibility data in baseline x freq format
        """
        if run_ms_tests == False:
            return

        # Frequency range
        freq = numpy.arange(0,512)*20e6/512 + 40e6
        channel_width = numpy.full_like(freq,20e6/512.)

        # Site and stands
        obs = EarthLocation(lon="116.76444824", lat="-26.824722084", height=300.0)

        mount = numpy.array(['equat','equat','equat','equat','equat','equat','equat','equat','equat','equat'])
        names = numpy.array(['ak02','ak04','ak05','ak12','ak13','ak14','ak16','ak24','ak28','ak30'])
        diameter = numpy.array([12.,12.,12.,12.,12.,12.,12.,12.,12.,12.])
        xyz = numpy.array([[-2556109.98244348,5097388.70050131,-2848440.1332423 ],
            [-2556087.396082  ,  5097423.589662  , -2848396.867933  ],
            [-2556028.60254059,  5097451.46195695, -2848399.83113161],
            [-2556496.23893101,  5097333.71466669, -2848187.33832738],
            [-2556407.35299627,  5097064.98390756, -2848756.02069474],
            [-2555972.78456557,  5097233.65481756, -2848839.88915184],
            [-2555592.88867802,  5097835.02121109, -2848098.26409648],
            [-2555959.34313275,  5096979.52802882, -2849303.57702486],
            [-2556552.97431815,  5097767.23612874, -2847354.29540396],
            [-2557348.40370367,  5097170.17682775, -2847716.21368966]])

        site_config = Configuration(name='ASKAP', data=None, location= obs,
                                        names=names, xyz=xyz, mount=mount, frame=None,
                                        receptor_frame=ReceptorFrame("linear"),
                                        diameter=diameter)
        antennas = []
        for i in range(len(names)):
            antennas.append(Antenna(i,Stand(names[i],xyz[i,0],xyz[i,1],xyz[i,2])))

        # Set baselines and data
        blList = []
        N = len(antennas)

        antennas2 = antennas

        for i in range(0, N - 1):
            for j in range(i + 1, N):
                blList.append((antennas[i], antennas2[j]))

        visData = numpy.random.rand(len(blList), len(freq))
        visData = visData.astype(numpy.complex64)
        
        return {'freq': freq, 'channel_width':channel_width, 'site': site_config, 'antennas': antennas, 'bl': blList, 'vis': visData}
Private function to generate a random set of data for writing a UVFITS
        file.  The data is returned as a dictionary with keys:
         * freq - frequency array in Hz
         * site - Observatory object
         * stands - array of stand numbers
         * bl - list of baseline pairs in real stand numbers
         * vis - array of visibility data in baseline x freq format
        
Private function to generate a random set of data for writing a UVFITS
file.
Private function to generate a random set of data for writing a UVFITS file .
def __initData(self):
        if run_ms_tests == False:
            return
        freq = numpy.arange(0,512)*20e6/512 + 40e6
        channel_width = numpy.full_like(freq,20e6/512.)
        obs = EarthLocation(lon="116.76444824", lat="-26.824722084", height=300.0)
        mount = numpy.array(['equat','equat','equat','equat','equat','equat','equat','equat','equat','equat'])
        names = numpy.array(['ak02','ak04','ak05','ak12','ak13','ak14','ak16','ak24','ak28','ak30'])
        diameter = numpy.array([12.,12.,12.,12.,12.,12.,12.,12.,12.,12.])
        xyz = numpy.array([[-2556109.98244348,5097388.70050131,-2848440.1332423 ],
            [-2556087.396082  ,  5097423.589662  , -2848396.867933  ],
            [-2556028.60254059,  5097451.46195695, -2848399.83113161],
            [-2556496.23893101,  5097333.71466669, -2848187.33832738],
            [-2556407.35299627,  5097064.98390756, -2848756.02069474],
            [-2555972.78456557,  5097233.65481756, -2848839.88915184],
            [-2555592.88867802,  5097835.02121109, -2848098.26409648],
            [-2555959.34313275,  5096979.52802882, -2849303.57702486],
            [-2556552.97431815,  5097767.23612874, -2847354.29540396],
            [-2557348.40370367,  5097170.17682775, -2847716.21368966]])
        site_config = Configuration(name='ASKAP', data=None, location= obs,
                                        names=names, xyz=xyz, mount=mount, frame=None,
                                        receptor_frame=ReceptorFrame("linear"),
                                        diameter=diameter)
        antennas = []
        for i in range(len(names)):
            antennas.append(Antenna(i,Stand(names[i],xyz[i,0],xyz[i,1],xyz[i,2])))
        blList = []
        N = len(antennas)
        antennas2 = antennas
        for i in range(0, N - 1):
            for j in range(i + 1, N):
                blList.append((antennas[i], antennas2[j]))
        visData = numpy.random.rand(len(blList), len(freq))
        visData = visData.astype(numpy.complex64)
        return {'freq': freq, 'channel_width':channel_width, 'site': site_config, 'antennas': antennas, 'bl': blList, 'vis': visData}
def __initData ( self ) : if run_ms_tests == False : return freq = numpy . arange ( 0 , 512 ) * 20e6 / 512 + 40e6 channel_width = numpy . full_like ( freq , 20e6 / 512. ) obs = EarthLocation ( lon = "116.76444824" , lat = "-26.824722084" , height = 300.0 ) mount = numpy . array ( [ 'equat' , 'equat' , 'equat' , 'equat' , 'equat' , 'equat' , 'equat' , 'equat' , 'equat' , 'equat' ] ) names = numpy . array ( [ 'ak02' , 'ak04' , 'ak05' , 'ak12' , 'ak13' , 'ak14' , 'ak16' , 'ak24' , 'ak28' , 'ak30' ] ) diameter = numpy . array ( [ 12. , 12. , 12. , 12. , 12. , 12. , 12. , 12. , 12. , 12. ] ) xyz = numpy . array ( [ [ - 2556109.98244348 , 5097388.70050131 , - 2848440.1332423 ] , [ - 2556087.396082 , 5097423.589662 , - 2848396.867933 ] , [ - 2556028.60254059 , 5097451.46195695 , - 2848399.83113161 ] , [ - 2556496.23893101 , 5097333.71466669 , - 2848187.33832738 ] , [ - 2556407.35299627 , 5097064.98390756 , - 2848756.02069474 ] , [ - 2555972.78456557 , 5097233.65481756 , - 2848839.88915184 ] , [ - 2555592.88867802 , 5097835.02121109 , - 2848098.26409648 ] , [ - 2555959.34313275 , 5096979.52802882 , - 2849303.57702486 ] , [ - 2556552.97431815 , 5097767.23612874 , - 2847354.29540396 ] , [ - 2557348.40370367 , 5097170.17682775 , - 2847716.21368966 ] ] ) site_config = Configuration ( name = 'ASKAP' , data = None , location = obs , names = names , xyz = xyz , mount = mount , frame = None , receptor_frame = ReceptorFrame ( "linear" ) , diameter = diameter ) antennas = [ ] for i in range ( len ( names ) ) : antennas . append ( Antenna ( i , Stand ( names [ i ] , xyz [ i , 0 ] , xyz [ i , 1 ] , xyz [ i , 2 ] ) ) ) blList = [ ] N = len ( antennas ) antennas2 = antennas for i in range ( 0 , N - 1 ) : for j in range ( i + 1 , N ) : blList . append ( ( antennas [ i ] , antennas2 [ j ] ) ) visData = numpy . random . rand ( len ( blList ) , len ( freq ) ) visData = visData . astype ( numpy . complex64 ) return { 'freq' : freq , 'channel_width' : channel_width , 'site' : site_config , 'antennas' : antennas , 'bl' : blList , 'vis' : visData }
Private function to generate a random set of data for writing a UVFITS
file.
Private function to generate a random set of data for writing a UVFITS file .
"""Private function to generate a random set of data for writing a UVFITS
        file.  The data is returned as a dictionary with keys:
         * freq - frequency array in Hz
         * site - Observatory object
         * stands - array of stand numbers
         * bl - list of baseline pairs in real stand numbers
         * vis - array of visibility data in baseline x freq format
        """ # Frequency range # Site and stands # Set baselines and data
self