当前位置: 首页>>代码示例>>Python>>正文


Python parallel_data_helper.ParallelDataHelper类代码示例

本文整理汇总了Python中parallel.parallel_data_helper.ParallelDataHelper的典型用法代码示例。如果您正苦于以下问题:Python ParallelDataHelper类的具体用法?Python ParallelDataHelper怎么用?Python ParallelDataHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ParallelDataHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_default_cols

    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,代码行数:25,代码来源:test_hanningsmooth2.py

示例2: split2

def split2(vis, 
          outputvis, 
          keepmms,
          field,
          spw, 
          scan, 
          antenna, 
          correlation,
          timerange, 
          intent,
          array,
          uvrange,
          observation,
          feed,
          datacolumn, 
          keepflags,
          width, 
          timebin, 
          combine 
          ):
    
    """Create a visibility subset from an existing visibility set"""

    casalog.origin('split2')
    
    # Initialize the helper class  
    pdh = ParallelDataHelper("split2", locals()) 
        
    # Validate input and output parameters
    try:
        pdh.setupIO()
    except Exception, instance:
        casalog.post('%s'%instance,'ERROR')
        return False
开发者ID:schiebel,项目名称:casa,代码行数:34,代码来源:task_split2.py

示例3: test_default_cols

    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,代码行数:25,代码来源:test_hanningsmooth.py

示例4: hanningsmooth

def hanningsmooth(
    vis=None,
    outputvis=None,
    keepmms=None,
    field=None,
    spw=None,
    scan=None,
    antenna=None,
    correlation=None,
    timerange=None,
    intent=None,
    array=None,
    uvrange=None,
    observation=None,
    feed=None,
    datacolumn=None,
):

    """Hanning smooth frequency channel data to remove Gibbs ringing

    """

    casalog.origin("hanningsmooth")

    # Initiate the helper class
    pdh = ParallelDataHelper("hanningsmooth", locals())

    # Validate input and output parameters
    try:
        pdh.setupIO()
    except Exception, instance:
        casalog.post("%s" % instance, "ERROR")
        return False
开发者ID:radio-astro,项目名称:casa,代码行数:33,代码来源:task_hanningsmooth.py

示例5: test_mms5

 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,代码行数:14,代码来源:test_importasdm_mms.py

示例6: test_MMS1

    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,代码行数:34,代码来源:test_mstransform_mms.py

示例7: test_output_mms4

 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,代码行数:7,代码来源:test_mstransform_mms.py

示例8: test_mms2

    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,代码行数:7,代码来源:test_importasdm_mms.py

示例9: test_combspws_timespan

 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,代码行数:8,代码来源:test_mstransform_mms.py

示例10: test_sd_data_mms

    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,代码行数:8,代码来源:test_importasdm_mms.py

示例11: test_mms3

    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,代码行数:9,代码来源:test_importasdm_mms.py

示例12: test_float_data_mms

    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,代码行数:9,代码来源:test_importasdm_mms.py

示例13: cvel2

def cvel2(
    vis,
    outputvis,
    keepmms,
    passall,  # hidden parameter for backwards compatibiliy
    field,
    spw,
    scan,
    antenna,
    correlation,
    timerange,
    intent,
    array,
    uvrange,
    observation,
    feed,
    datacolumn,
    mode,
    nchan,
    start,
    width,
    interpolation,
    phasecenter,
    restfreq,
    outframe,
    veltype,
    hanning,
):

    """ This task used the MSTransform framework. It needs to use the ParallelDataHelper
        class, implemented in parallel.parallel_data_helper.py. 
    """

    # Initialize the helper class
    pdh = ParallelDataHelper("cvel2", locals())

    casalog.origin("cvel2")

    # Validate input and output parameters
    try:
        pdh.setupIO()
    except Exception, instance:
        casalog.post("%s" % instance, "ERROR")
        return False
开发者ID:radio-astro,项目名称:casa,代码行数:44,代码来源:task_cvel2.py

示例14: test_combspws_timespan_scan_axis

 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,代码行数:12,代码来源:test_mstransform_mms.py

示例15: test_combspws_timespan_spw_axis

 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,代码行数:12,代码来源:test_mstransform_mms.py


注:本文中的parallel.parallel_data_helper.ParallelDataHelper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。