當前位置: 首頁>>代碼示例>>Python>>正文


Python ParallelDataHelper.isParallelMS方法代碼示例

本文整理匯總了Python中parallel.parallel_data_helper.ParallelDataHelper.isParallelMS方法的典型用法代碼示例。如果您正苦於以下問題:Python ParallelDataHelper.isParallelMS方法的具體用法?Python ParallelDataHelper.isParallelMS怎麽用?Python ParallelDataHelper.isParallelMS使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在parallel.parallel_data_helper.ParallelDataHelper的用法示例。


在下文中一共展示了ParallelDataHelper.isParallelMS方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_default_cols

# 需要導入模塊: from parallel.parallel_data_helper import ParallelDataHelper [as 別名]
# 或者: from parallel.parallel_data_helper.ParallelDataHelper import isParallelMS [as 別名]
    def test_default_cols(self):
        '''hanningsmooth2: Default datacolumn=all and MMS output'''
        
        self.createMMS(self.msfile,column='all')
        self.outputms = 'hannall.ms'

        hanningsmooth2(vis=self.testmms, outputvis=self.outputms)
        self.assertTrue(ParallelDataHelper.isParallelMS(self.outputms), 'Output should be an MMS')
        
        # Should have all scratch columns in output
        cd = th.getColDesc(self.outputms, 'DATA')
        self.assertGreater(len(cd), 0, 'DATA column does not exist')
        cc = th.getColDesc(self.outputms, 'CORRECTED_DATA')
        self.assertGreater(len(cc), 0, 'CORRECTED_DATA does not exist')
        
        # Now repeat the above steps but create an output MS by setting keepmms=False
        os.system('rm -rf '+self.outputms)
        hanningsmooth2(vis=self.testmms, outputvis=self.outputms, keepmms=False)
        self.assertFalse(ParallelDataHelper.isParallelMS(self.outputms), 'Output should be a normal MS')
        
        # Should have all scratch columns in output
        cd = th.getColDesc(self.outputms, 'DATA')
        self.assertGreater(len(cd), 0, 'DATA column does not exist')
        cc = th.getColDesc(self.outputms, 'CORRECTED_DATA')
        self.assertGreater(len(cc), 0, 'CORRECTED_DATA does not exist')
開發者ID:schiebel,項目名稱:casa,代碼行數:27,代碼來源:test_hanningsmooth2.py

示例2: test_default_cols

# 需要導入模塊: from parallel.parallel_data_helper import ParallelDataHelper [as 別名]
# 或者: from parallel.parallel_data_helper.ParallelDataHelper import isParallelMS [as 別名]
    def test_default_cols(self):
        """hanningsmooth: Default datacolumn=all and MMS output"""

        self.createMMS(self.msfile, column="all")
        self.outputms = "hannall.ms"

        hanningsmooth(vis=self.testmms, outputvis=self.outputms)
        self.assertTrue(ParallelDataHelper.isParallelMS(self.outputms), "Output should be an MMS")

        # Should have all scratch columns in output
        cd = th.getColDesc(self.outputms, "DATA")
        self.assertGreater(len(cd), 0, "DATA column does not exist")
        cc = th.getColDesc(self.outputms, "CORRECTED_DATA")
        self.assertGreater(len(cc), 0, "CORRECTED_DATA does not exist")

        # Now repeat the above steps but create an output MS by setting keepmms=False
        os.system("rm -rf " + self.outputms)
        hanningsmooth(vis=self.testmms, outputvis=self.outputms, keepmms=False)
        self.assertFalse(ParallelDataHelper.isParallelMS(self.outputms), "Output should be a normal MS")

        # Should have all scratch columns in output
        cd = th.getColDesc(self.outputms, "DATA")
        self.assertGreater(len(cd), 0, "DATA column does not exist")
        cc = th.getColDesc(self.outputms, "CORRECTED_DATA")
        self.assertGreater(len(cc), 0, "CORRECTED_DATA does not exist")
開發者ID:radio-astro,項目名稱:casa,代碼行數:27,代碼來源:test_hanningsmooth.py

示例3: test_mms5

# 需要導入模塊: from parallel.parallel_data_helper import ParallelDataHelper [as 別名]
# 或者: from parallel.parallel_data_helper.ParallelDataHelper import isParallelMS [as 別名]
 def test_mms5(self):
     '''test_mms5: Create 2 MMS, 2 flagversions and 2 online flag files'''
     myasdmname = 'uid___A002_X71e4ae_X317_short'
     themsname = myasdmname+".ms"
     wvrmsname = myasdmname+'-wvr-corrected.ms'
     flagfile1 = myasdmname+'_cmd.txt'
     flagfile2 = myasdmname+'-wvr-corrected'+'_cmd.txt'
     
     importasdm(myasdmname, vis=themsname, lazy=True, scans='0:1~4', wvr_corrected_data='both', savecmds=True,
                createmms=True)
     self.assertTrue(ParallelDataHelper.isParallelMS(themsname), 'Output is not a Multi-MS')
     self.assertTrue(ParallelDataHelper.isParallelMS(wvrmsname), 'Output is not a Multi-MS')
     self.assertTrue(os.path.exists(flagfile1))
     self.assertTrue(os.path.exists(flagfile2))
開發者ID:radio-astro,項目名稱:casa,代碼行數:16,代碼來源:test_importasdm_mms.py

示例4: test_MMS1

# 需要導入模塊: from parallel.parallel_data_helper import ParallelDataHelper [as 別名]
# 或者: from parallel.parallel_data_helper.ParallelDataHelper import isParallelMS [as 別名]
    def test_MMS1(self):
        '''mstransform: input MMS should be the same as output MMS'''
        
        # Create an MMS in the setup
        self.createMMS(self.vis, axis='scan', spws='0,1')
                
        # Create another MS and compare. They should be the same
        self.outputms = 'thesame.mms'
        mstransform(vis=self.testmms, outputvis=self.outputms, datacolumn='data')
        
        self.assertTrue(ParallelDataHelper.isParallelMS(self.outputms),'Output is not an MMS')
                
        # Sort the MSs so that they can be compared
        myms = mstool()
        
        myms.open(self.testmms)
        myms.sort('input_sorted.ms',['OBSERVATION_ID','ARRAY_ID','SCAN_NUMBER','FIELD_ID','DATA_DESC_ID','ANTENNA1','ANTENNA2','TIME'])
        myms.done()
        
        myms.open(self.outputms)
        myms.sort('output_sorted.ms',['OBSERVATION_ID','ARRAY_ID','SCAN_NUMBER','FIELD_ID','DATA_DESC_ID','ANTENNA1','ANTENNA2','TIME'])
        myms.done()

        # Compare both tables. Ignore the DATA column and compare it in next line
        self.assertTrue(th.compTables('input_sorted.ms','output_sorted.ms', 
                                      ['FLAG_CATEGORY','FLAG','WEIGHT_SPECTRUM','SIGMA_SPECTRUM','DATA']))
        
        # Compare the DATA column
        self.assertTrue(th.compVarColTables('input_sorted.ms','output_sorted.ms','DATA'))
        
        # The separation axis should be copied to the output MMS
        in_sepaxis = ph.axisType(self.testmms)
        out_sepaxis = ph.axisType(self.outputms)
        self.assertEqual(in_sepaxis, out_sepaxis, 'AxisTypes from input and output MMS do not match')
開發者ID:schiebel,項目名稱:casa,代碼行數:36,代碼來源:test_mstransform_mms.py

示例5: test_output_mms4

# 需要導入模塊: from parallel.parallel_data_helper import ParallelDataHelper [as 別名]
# 或者: from parallel.parallel_data_helper.ParallelDataHelper import isParallelMS [as 別名]
 def test_output_mms4(self):
     '''mstransform: timeaverage=True, output axis=scan, timespan=scan'''
     self.outputms = 'outmms4.mms'
     # Just give a WARNING
     mstransform(self.vis, outputvis=self.outputms, datacolumn='corrected', createmms=True, timeaverage=True, spw='12,13',
                 separationaxis='scan',timebin='10s',timespan='scan')
     self.assertTrue(ParallelDataHelper.isParallelMS(self.outputms),'Output should be an MMS')
開發者ID:schiebel,項目名稱:casa,代碼行數:9,代碼來源:test_mstransform_mms.py

示例6: test_mms2

# 需要導入模塊: from parallel.parallel_data_helper import ParallelDataHelper [as 別名]
# 或者: from parallel.parallel_data_helper.ParallelDataHelper import isParallelMS [as 別名]
    def test_mms2(self):
        '''test_mms2: Create an MMS with default name and lazy=True'''
        myasdmname = 'uid___A002_X71e4ae_X317_short'
        themsname = myasdmname+".ms"

        importasdm(myasdmname, createmms=True, lazy=True, scans='2')
        self.assertTrue(ParallelDataHelper.isParallelMS(themsname), 'Output is not a Multi-MS')
開發者ID:radio-astro,項目名稱:casa,代碼行數:9,代碼來源:test_importasdm_mms.py

示例7: test_sd_data_mms

# 需要導入模塊: from parallel.parallel_data_helper import ParallelDataHelper [as 別名]
# 或者: from parallel.parallel_data_helper.ParallelDataHelper import isParallelMS [as 別名]
    def test_sd_data_mms(self):
        '''importasdm: Create an MMS from a single-dish MS and DATA column '''
        myasdmname = 'uid___A002_X6218fb_X264'
        themsname = myasdmname+".ms"

        importasdm(myasdmname, vis=themsname, scans='1,4', createmms=True, separationaxis='scan', numsubms=2, flagbackup=False)
        self.assertTrue(ParallelDataHelper.isParallelMS(themsname), 'Output is not a Multi-MS')
        self.assertTrue(len(th.getColDesc(themsname, 'DATA')) > 0)
開發者ID:radio-astro,項目名稱:casa,代碼行數:10,代碼來源:test_importasdm_mms.py

示例8: test_combspws_timespan

# 需要導入模塊: from parallel.parallel_data_helper import ParallelDataHelper [as 別名]
# 或者: from parallel.parallel_data_helper.ParallelDataHelper import isParallelMS [as 別名]
 def test_combspws_timespan(self):
     '''mstransform: combinespws=True, timespan=scan axis=auto'''
     self.createMMS(self.vis, axis='auto',spws='3')
     self.outputms = "2transformations.mms"
     # This should work. 
     mstransform(vis=self.testmms, outputvis=self.outputms, datacolumn='data',
                     combinespws=True, timeaverage=True, timebin='40s',timespan='scan')
     self.assertFalse(ParallelDataHelper.isParallelMS(self.outputms),'Output should be an MS')
開發者ID:schiebel,項目名稱:casa,代碼行數:10,代碼來源:test_mstransform_mms.py

示例9: test_mms3

# 需要導入模塊: from parallel.parallel_data_helper import ParallelDataHelper [as 別名]
# 或者: from parallel.parallel_data_helper.ParallelDataHelper import isParallelMS [as 別名]
    def test_mms3(self):
        '''test_mms3: Create MMS with separationaxis=spw and lazy=True'''
        myasdmname = 'uid___A002_X71e4ae_X317_short'
        themsname = myasdmname+".ms"

        importasdm(myasdmname, createmms=True, lazy=True, scans='1,2', separationaxis='spw', flagbackup=False,
                   process_flags=False)
        self.assertTrue(ParallelDataHelper.isParallelMS(themsname), 'Output is not a Multi-MS')
        self.assertEqual(ph.axisType(themsname), 'spw', 'Separation axis of MMS should be spw')
開發者ID:radio-astro,項目名稱:casa,代碼行數:11,代碼來源:test_importasdm_mms.py

示例10: test_float_data_mms

# 需要導入模塊: from parallel.parallel_data_helper import ParallelDataHelper [as 別名]
# 或者: from parallel.parallel_data_helper.ParallelDataHelper import isParallelMS [as 別名]
    def test_float_data_mms(self):
        '''importasdm: Create an MMS from a FLOAT_DATA MS '''
        myasdmname = 'uid___A002_X6218fb_X264'
        themsname = myasdmname+".ms"

        # The ocorr_mode='ao' option will create a FLOAT_DATA column instead of DATA
        importasdm(myasdmname, vis=themsname, ocorr_mode='ao', createmms=True, scans='1')
        self.assertTrue(ParallelDataHelper.isParallelMS(themsname), 'Output is not a Multi-MS')        
        self.assertTrue(len(th.getColDesc(themsname, 'FLOAT_DATA')) > 0)
開發者ID:radio-astro,項目名稱:casa,代碼行數:11,代碼來源:test_importasdm_mms.py

示例11: test_combspws_timespan_scan_axis

# 需要導入模塊: from parallel.parallel_data_helper import ParallelDataHelper [as 別名]
# 或者: from parallel.parallel_data_helper.ParallelDataHelper import isParallelMS [as 別名]
 def test_combspws_timespan_scan_axis(self):
     '''mstransform: combinespws=True, timespan=scan axis=scan'''
     self.createMMS(self.vis, axis='scan',spws='0')
     self.outputms = "scanaxiserror.mms"
     # subMSs do not have all scans. Create an MS.
     try:
         mstransform(vis=self.testmms, outputvis=self.outputms, datacolumn='data',
                     combinespws=True, timeaverage=True, timebin='20s',timespan='scan')
         self.assertTrue((ParallelDataHelper.isParallelMS(self.outputms),'Output should be an MMS'))
     
     except Exception, instance:
         print 'Expected error: %s'%instance
開發者ID:schiebel,項目名稱:casa,代碼行數:14,代碼來源:test_mstransform_mms.py

示例12: test_combspws_timespan_spw_axis

# 需要導入模塊: from parallel.parallel_data_helper import ParallelDataHelper [as 別名]
# 或者: from parallel.parallel_data_helper.ParallelDataHelper import isParallelMS [as 別名]
 def test_combspws_timespan_spw_axis(self):
     '''mstransform: combinespws=True, timespan=scan axis=spw'''
     self.createMMS(self.vis, axis='spw',scans='30',spws='10')
     self.outputms = "spwaxisok.mms"
     # This should work
     try:
         mstransform(vis=self.testmms, outputvis=self.outputms, datacolumn='data',
                     combinespws=True, timeaverage=True, timebin='20s',timespan='scan')
         self.assertTrue((ParallelDataHelper.isParallelMS(self.outputms),'Output should be an MMS'))
     
     except Exception, instance:
         print 'This error should have not happened %s'%instance
開發者ID:schiebel,項目名稱:casa,代碼行數:14,代碼來源:test_mstransform_mms.py

示例13: test_combspws_timespan_error

# 需要導入模塊: from parallel.parallel_data_helper import ParallelDataHelper [as 別名]
# 或者: from parallel.parallel_data_helper.ParallelDataHelper import isParallelMS [as 別名]
 def test_combspws_timespan_error(self):
     '''mstransform: combinespws=True, timespan=scan axis=auto timebin=40s'''
     self.createMMS(self.vis, axis='auto',spws='1,3', numms=4)
     self.outputms = "spanscan_comb.mms"
     # combinespws is not possible. It should create and MS
     mstransform(vis=self.testmms, outputvis=self.outputms, datacolumn='data',
                 combinespws=True, timeaverage=True, timebin='40s',timespan='scan')
     self.assertFalse(ParallelDataHelper.isParallelMS(self.outputms),'Output should be an MS')
     mymsmd = msmdtool()
     mymsmd.open(self.outputms)
     nspw = mymsmd.nspw()
     mymsmd.close()
     self.assertEqual(nspw,1)
開發者ID:schiebel,項目名稱:casa,代碼行數:15,代碼來源:test_mstransform_mms.py

示例14: test_monolithic_combspw1_1

# 需要導入模塊: from parallel.parallel_data_helper import ParallelDataHelper [as 別名]
# 或者: from parallel.parallel_data_helper.ParallelDataHelper import isParallelMS [as 別名]
    def test_monolithic_combspw1_1(self):
        '''mstransform: Combine four spws into one using a monolithic-MMS'''
        self.createMMS(self.vis, axis='spw',spws='0~3')

        self.outputms = "monocombspw11.ms"
        mstransform(vis=self.testmms, outputvis=self.outputms, datacolumn='data',combinespws=True, spw='0~3')
        self.assertTrue(ParallelDataHelper.isParallelMS(self.outputms),'Output should be an MMS')

        ret = th.verifyMS(self.outputms, 1, 256, 0)
        self.assertTrue(ret[0],ret[1])

        listobs(self.outputms, listfile='list2.obs')
        self.assertTrue(os.path.exists('list2.obs'), 'Probable error in sub-table re-indexing')
開發者ID:schiebel,項目名稱:casa,代碼行數:15,代碼來源:test_mstransform_mms.py

示例15: test_combspws_timespan_spw_axis_error

# 需要導入模塊: from parallel.parallel_data_helper import ParallelDataHelper [as 別名]
# 或者: from parallel.parallel_data_helper.ParallelDataHelper import isParallelMS [as 別名]
 def test_combspws_timespan_spw_axis_error(self):
     '''mstransform: combinespws=True, timespan=scan axis=spw'''
     self.createMMS(self.vis, axis='spw',scans='30',spws='10,11')
     self.outputms = "spwaxiserror.mms"
     # subMSs do not have all spws. Create an MS
     mstransform(vis=self.testmms, outputvis=self.outputms, datacolumn='data',
                 combinespws=True, timeaverage=True, timebin='20s',timespan='scan')
     self.assertFalse(ParallelDataHelper.isParallelMS(self.outputms),'Output should be an MS')
     mymsmd = msmdtool()
     mymsmd.open(self.outputms)
     nspw = mymsmd.nspw()
     mymsmd.close()
     self.assertEqual(nspw,1)
開發者ID:schiebel,項目名稱:casa,代碼行數:15,代碼來源:test_mstransform_mms.py


注:本文中的parallel.parallel_data_helper.ParallelDataHelper.isParallelMS方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。