本文整理汇总了Python中taskinit.aftool函数的典型用法代码示例。如果您正苦于以下问题:Python aftool函数的具体用法?Python aftool怎么用?Python aftool使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了aftool函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_manual_field_msSelection_layer_for_tsys_CalTable
def test_manual_field_msSelection_layer_for_tsys_CalTable(self):
"""AgentFlagger:: Manually flag a Tsys-based CalTable using MSSelection for field """
aflocal = aftool()
aflocal.open(self.vis)
aflocal.selectdata(field='0')
agentUnflag={'apply':True,'mode':'unflag'}
agentManual={'apply':True,'mode':'manual'}
aflocal.parseagentparameters(agentUnflag)
aflocal.parseagentparameters(agentManual)
aflocal.init()
summary = aflocal.run(writeflags=True)
aflocal.done()
aflocal.open(self.vis)
aflocal.selectdata()
agentSummary={'apply':True,'mode':'summary'}
aflocal.parseagentparameters(agentSummary)
aflocal.init()
summary = aflocal.run(writeflags=True)
aflocal.done()
self.assertEqual(summary['report0']['field']['3c279']['flagged'], 9216.0)
self.assertEqual(summary['report0']['field']['Titan']['flagged'], 0)
self.assertEqual(summary['report0']['field']['TW Hya']['flagged'], 0)
self.assertEqual(summary['report0']['field']['J1037-295=QSO']['flagged'], 0)
开发者ID:schiebel,项目名称:casa,代码行数:26,代码来源:test_agentflagger.py
示例2: test_display_cal_tables
def test_display_cal_tables(self):
'''AgentFlagger: Select spws, display and flag cal tables'''
self.setUp_bpass_case()
aflocal = aftool()
aflocal.open(self.vis)
aflocal.selectdata(spw='1')
aflocal.parsemanualparameters(spw='1:0~10;60~63')
aflocal.parsesummaryparameters(spwchan=True)
# agentManual={'apply':True,'mode':'manual'}
# agentSummary={'apply':True,'mode':'summary','spwchan':True}
agentDisplay={'mode':'display','datadisplay':True,'pause':False,'datacolumn':'CPARAM'}
# aflocal.parseagentparameters(agentManual)
# aflocal.parseagentparameters(agentSummary)
aflocal.parseagentparameters(agentDisplay)
aflocal.init()
summary = aflocal.run(writeflags=True)
aflocal.done()
self.assertEqual(summary['report0']['spw:channel']['1:0']['flagged'], 1300)
self.assertEqual(summary['report0']['spw:channel']['1:5']['flagged'], 1300)
self.assertEqual(summary['report0']['spw:channel']['1:10']['flagged'], 1300)
self.assertEqual(summary['report0']['spw:channel']['1:11']['flagged'], 0)
self.assertEqual(summary['report0']['spw:channel']['1:60']['flagged'], 1300)
self.assertEqual(summary['report0']['spw:channel']['1:59']['flagged'], 0)
self.assertEqual(summary['report0']['flagged'], 15*1300)
开发者ID:schiebel,项目名称:casa,代码行数:25,代码来源:test_agentflagger.py
示例3: test_tfcrop_cparam_sol1_extension
def test_tfcrop_cparam_sol1_extension(self):
"""AgentFlagger:: Test tfcrop first calibration solution product of CPARAM column,
and then extend to the other solution for bpass CalTable"""
aflocal = aftool()
datacolumn = "CPARAM"
correlation = 'Sol1'
aflocal.open(self.vis)
aflocal.selectdata()
# Pre-clip data to avoid problems with near-zero values
agentClip={'apply':True,'mode':'clip','clipzeros':True,'datacolumn':datacolumn,'correlation':correlation}
aflocal.parseagentparameters(agentClip)
aflocal.parsetfcropparameters(datacolumn=datacolumn, correlation=correlation,
extendflags=False)
aflocal.parsesummaryparameters()
# Extend to the other solution
aflocal.parseextendparameters(extendpols=True,growfreq=0.0,growtime=0.0)
aflocal.parsesummaryparameters()
aflocal.init()
summary = aflocal.run(writeflags=True)
aflocal.done()
# flags from first summary, only tfcrop
assert abs(summary['report0']['flagged'] - 30427) <= 5
assert abs(summary['report0']['correlation']['Sol1']['flagged'] - 30427) <= 5
# flags from second summary, tfcrop+extend
assert abs(summary['report2']['flagged'] - 2*30427) <= 10
assert abs(summary['report2']['correlation']['Sol2']['flagged'] - 30427) <= 5
开发者ID:schiebel,项目名称:casa,代码行数:30,代码来源:test_agentflagger.py
示例4: test_mixed_agents_tsys
def test_mixed_agents_tsys(self):
'''AgentFlagger: supported and unsupported agents in a list'''
aflocal = aftool()
aflocal.open(self.vis)
aflocal.selectdata()
aflocal.parsemanualparameters(spw='1')
aflocal.parseagentparameters({'mode':'shadow','spw':'3'}) #unsupported mode
aflocal.parseelevationparameters() # unsupported mode
aflocal.parsemanualparameters(spw='5')
aflocal.parsesummaryparameters(spw='1,3,5', fieldcnt=True)
aflocal.init()
res = aflocal.run(writeflags=True)
aflocal.done()
# Check the summary dictionary with field breakdown
fields = res['report0'].keys()
fields.remove('name')
fields.remove('type')
fflags1 = 0
fflags3 = 0
fflags5 = 0
totalflags = 0
for ff in fields:
fflags1 += res['report0'][ff]['spw']['1']['flagged']
fflags3 += res['report0'][ff]['spw']['3']['flagged']
fflags5 += res['report0'][ff]['spw']['5']['flagged']
totalflags += res['report0'][ff]['flagged']
self.assertEqual(fflags1, 32256)
self.assertEqual(fflags3, 0)
self.assertEqual(fflags5, 32256)
self.assertEqual(totalflags, 32256*2)
开发者ID:schiebel,项目名称:casa,代码行数:32,代码来源:test_agentflagger.py
示例5: test_manual_field_msSelection_layer_for_bpass_CalTable
def test_manual_field_msSelection_layer_for_bpass_CalTable(self):
"""AgentFlagger:: Manually flag a bpass-based CalTable using MSSelection for field """
aflocal = aftool()
aflocal.open(self.vis)
aflocal.selectdata({'field':'3C286_A'})
agentUnflag={'apply':True,'mode':'unflag'}
agentManual={'apply':True,'mode':'manual'}
aflocal.parseagentparameters(agentUnflag)
aflocal.parseagentparameters(agentManual)
aflocal.init()
summary = aflocal.run(writeflags=True)
aflocal.done()
aflocal.open(self.vis)
aflocal.selectdata()
agentSummary={'apply':True,'mode':'summary'}
aflocal.parseagentparameters(agentSummary)
aflocal.init()
summary = aflocal.run(writeflags=True)
aflocal.done()
self.assertEqual(summary['report0']['field']['3C286_A']['flagged'], 499200.0)
self.assertEqual(summary['report0']['field']['3C286_B']['flagged'], 0)
self.assertEqual(summary['report0']['field']['3C286_C']['flagged'], 0)
self.assertEqual(summary['report0']['field']['3C286_D']['flagged'], 0)
开发者ID:schiebel,项目名称:casa,代码行数:26,代码来源:test_agentflagger.py
示例6: unflag_table
def unflag_table(self):
aflocal = aftool()
aflocal.open(self.vis)
aflocal.selectdata()
agentUnflag={'apply':True,'mode':'unflag'}
aflocal.parseagentparameters(agentUnflag)
aflocal.init()
aflocal.run(writeflags=True)
aflocal.done()
开发者ID:schiebel,项目名称:casa,代码行数:10,代码来源:test_agentflagger.py
示例7: test_unsupported_elevation_tsys
def test_unsupported_elevation_tsys(self):
'''AgentFlagger: Unsupported elevation mode'''
aflocal = aftool()
aflocal.open(self.vis)
aflocal.selectdata()
aflocal.parseelevationparameters()
aflocal.init()
res = aflocal.run(writeflags=True)
aflocal.done()
self.assertEqual(res, {})
开发者ID:schiebel,项目名称:casa,代码行数:10,代码来源:test_agentflagger.py
示例8: test_default_cparam_bpass
def test_default_cparam_bpass(self):
'''Flagdata: flag CPARAM data column'''
aflocal = aftool()
aflocal.open(self.vis)
aflocal.selectdata()
aflocal.parseclipparameters(clipzeros=True,datacolumn='CPARAM')
aflocal.parsesummaryparameters()
aflocal.init()
summary = aflocal.run(writeflags=True)
aflocal.done()
self.assertEqual(summary['report0']['flagged'], 11078.0, 'Should use CPARAM as the default column')
开发者ID:schiebel,项目名称:casa,代码行数:11,代码来源:test_agentflagger.py
示例9: test_display_float_data
def test_display_float_data(self):
'''AgentFlagger: Select spw, display and flag single-dish MS'''
self.setUp_float_data()
aflocal = aftool()
aflocal.open(self.vis)
aflocal.selectdata(spw='1~4')
aflocal.parsemanualparameters()
aflocal.parsesummaryparameters(name='Single-dish')
agentDisplay={'mode':'display','datadisplay':True,'pause':False,'datacolumn':'FLOAT_DATA'}
aflocal.parseagentparameters(agentDisplay)
aflocal.init()
summary = aflocal.run(writeflags=True)
aflocal.done()
self.assertEqual(summary['report0']['flagged'], 2052)
开发者ID:schiebel,项目名称:casa,代码行数:14,代码来源:test_agentflagger.py
示例10: test_flagversions
def test_flagversions(self):
"""Partition: check that the .flagversions is created"""
# Run partition and create the .flagversions
partition(vis=self.msfile, outputvis=self.mmsfile, createmms=True, disableparallel=True, datacolumn="data")
self.assertTrue(os.path.exists(self.mmsfile + ".flagversions"))
# Check that the number of backups in MMS is correct
aflocal = aftool()
aflocal.open(self.mmsfile)
nv = aflocal.getflagversionlist()
aflocal.done()
self.assertEqual(len(nv), 3)
# Run flagdata on MMS to check if it works well.
flagdata(vis=self.mmsfile, mode="unflag", flagbackup=True)
# Check that the number of backups in MMS is correct
aflocal = aftool()
aflocal.open(self.mmsfile)
nvref = aflocal.getflagversionlist()
aflocal.done()
self.assertEqual(len(nvref), 4)
开发者ID:schiebel,项目名称:casa,代码行数:23,代码来源:test_partition.py
示例11: test_clip_minmax_cparam_for_bpass
def test_clip_minmax_cparam_for_bpass(self):
"""AgentFlagger:: Clip all calibration solutions of CPARAM column using a minmax range"""
aflocal = aftool()
datacolumn = 'CPARAM'
aflocal.open(self.vis)
aflocal.selectdata()
aflocal.parseclipparameters(clipminmax=[0.,0.3],datacolumn=datacolumn,clipzeros=True)
aflocal.parsesummaryparameters()
aflocal.init()
summary = aflocal.run(writeflags=True)
aflocal.done()
self.assertEqual(summary['report0']['flagged'], 11175.0)
self.assertEqual(summary['report0']['total'], 1248000)
self.assertEqual(summary['report0']['correlation']['Sol1']['flagged'], 11136.0)
self.assertEqual(summary['report0']['correlation']['Sol2']['flagged'], 39)
开发者ID:schiebel,项目名称:casa,代码行数:15,代码来源:test_agentflagger.py
示例12: test_display_data_single_channel_selection
def test_display_data_single_channel_selection(self):
"""AgentFlagger:: Check nominal behaviour for single spw:chan selection """
self.setUp_4Ants()
aflocal = aftool()
aflocal.open(self.vis)
aflocal.selectdata()
agentUnflag={'apply':True,'mode':'unflag'}
agentManual={'apply':True,'mode':'manual','spw':'*:20~40'}
agentSummary={'apply':True,'mode':'summary'}
agentDisplay={'mode':'display','datadisplay':True,'pause':False}
aflocal.parseagentparameters(agentManual)
aflocal.parseagentparameters(agentSummary)
aflocal.parseagentparameters(agentDisplay)
aflocal.init()
summary = aflocal.run(writeflags=True)
aflocal.done()
开发者ID:schiebel,项目名称:casa,代码行数:16,代码来源:test_agentflagger.py
示例13: test_manual_antenna_selection_agent_layer_for_tsys_CalTable2
def test_manual_antenna_selection_agent_layer_for_tsys_CalTable2(self):
"""AgentFlagger:: Manually flag a Tsys-based CalTable using flag agent selection engine for antenna"""
# Run the previous test but using the specific parsing functions
aflocal = aftool()
aflocal.open(self.vis)
aflocal.selectdata()
aflocal.parsemanualparameters(apply=False)
aflocal.parsemanualparameters(antenna='DV09')
aflocal.parsesummaryparameters()
aflocal.init()
summary = aflocal.run(writeflags=True)
aflocal.done()
self.assertEqual(summary['report0']['antenna']['DV09']['flagged'], 14336)
self.assertEqual(summary['report0']['antenna']['DV10']['flagged'], 0)
开发者ID:schiebel,项目名称:casa,代码行数:16,代码来源:test_agentflagger.py
示例14: test_null_intent_selection1
def test_null_intent_selection1(self):
'''Agentflagger: handle unknown scan intent in list mode'''
aflocal = aftool()
aflocal.open(self.vis)
aflocal.selectdata()
aflocal.parsemanualparameters(intent='FOCUS') # non-existing intent
aflocal.parsemanualparameters(intent='CALIBRATE_POINTING*') # scan=1
aflocal.parsemanualparameters(intent='CALIBRATE_AMPLI_ON_SOURC') # typo
aflocal.parsemanualparameters(intent='*DELAY*') # non-existing
aflocal.parsesummaryparameters()
aflocal.init()
summary = aflocal.run()
aflocal.done()
self.assertEqual(summary['report0']['scan']['1']['flagged'], 192416)
self.assertEqual(summary['report0']['scan']['8']['flagged'], 0)
self.assertEqual(summary['report0']['flagged'], 192416)
开发者ID:schiebel,项目名称:casa,代码行数:17,代码来源:test_agentflagger.py
示例15: test_display_data_different_corrs_per_spw
def test_display_data_different_corrs_per_spw(self):
"""AgentFlagger:: Check behaviour when the number of correlation products changes between SPWs """
self.setUp_CAS_4052()
aflocal = aftool()
aflocal.open(self.vis)
aflocal.selectdata()
agentUnflag={'apply':True,'mode':'unflag'}
agentManual={'apply':True,'mode':'manual','spw':'*:100~200;300~400'}
agentSummary={'apply':True,'mode':'summary'}
agentDisplay={'mode':'display','datadisplay':True,'pause':False}
aflocal.parseagentparameters(agentUnflag)
aflocal.parseagentparameters(agentManual)
aflocal.parseagentparameters(agentSummary)
aflocal.parseagentparameters(agentDisplay)
aflocal.init()
summary = aflocal.run(writeflags=True)
aflocal.done()
开发者ID:schiebel,项目名称:casa,代码行数:17,代码来源:test_agentflagger.py
示例16: test_manual_antenna_selection_agent_layer_for_bpass_CalTable
def test_manual_antenna_selection_agent_layer_for_bpass_CalTable(self):
"""AgentFlagger:: Manually flag a bpass-based CalTable using flag agent selection engine for antenna"""
aflocal = aftool()
aflocal.open(self.vis)
aflocal.selectdata()
agentUnflag={'apply':True,'mode':'unflag'}
agentManual={'apply':True,'mode':'manual','antenna':'ea09'}
agentSummary={'apply':True,'mode':'summary'}
aflocal.parseagentparameters(agentUnflag)
aflocal.parseagentparameters(agentManual)
aflocal.parseagentparameters(agentSummary)
aflocal.init()
summary = aflocal.run(writeflags=True)
aflocal.done()
self.assertEqual(summary['report0']['antenna']['ea09']['flagged'], 48000.0)
self.assertEqual(summary['report0']['antenna']['ea10']['flagged'], 0.0)
开发者ID:schiebel,项目名称:casa,代码行数:17,代码来源:test_agentflagger.py
示例17: test_rflag_cparam_sol2
def test_rflag_cparam_sol2(self):
"""AgentFlagger:: Test rflag solution 2 of CPARAM column for bpass"""
aflocal = aftool()
correlation = 'Sol2'
aflocal.open(self.vis)
aflocal.selectdata()
agentRflag={'apply':True,'mode':'rflag','correlation':correlation,
'extendflags':False,'datacolumn':'CPARAM'}
agentSummary={'apply':True,'mode':'summary'}
aflocal.parseagentparameters(agentRflag)
aflocal.parseagentparameters(agentSummary)
aflocal.init()
summary = aflocal.run(writeflags=True)
aflocal.done()
self.assertEqual(summary['report0']['flagged'], 13197)
self.assertEqual(summary['report0']['correlation']['Sol1']['flagged'], 0)
self.assertEqual(summary['report0']['correlation']['Sol2']['flagged'], 13197)
开发者ID:schiebel,项目名称:casa,代码行数:17,代码来源:test_agentflagger.py
示例18: test_clip_minmax_fparm_sol1_extension
def test_clip_minmax_fparm_sol1_extension(self):
"""AgentFlagger:: Test cliping first calibration solution product of FPARAM column using a minmax range, and then extend to the other solution """
aflocal = aftool()
datacolumn = 'FPARAM'
aflocal.open(self.vis)
aflocal.selectdata()
agentUnflag={'apply':True,'mode':'unflag'}
agentClip={'apply':True,'mode':'clip','clipzeros':True,'clipminmax':[0.,600.],'datacolumn':datacolumn,'correlation':'Sol1'}
agentExtension={'apply':True,'mode':'extend','extendpols':True,'growfreq':0.0, 'growtime':0.0}
agentSummary={'apply':True,'mode':'summary','correlation':'""'}
aflocal.parseagentparameters(agentUnflag)
aflocal.parseagentparameters(agentClip)
aflocal.parseagentparameters(agentExtension)
aflocal.parseagentparameters(agentSummary)
aflocal.init()
summary = aflocal.run(writeflags=True)
aflocal.done()
self.assertEqual(summary['report0']['total'], 129024)
self.assertEqual(summary['report0']['flagged'], 1500)
self.assertEqual(summary['report0']['correlation']['Sol1']['flagged'], 750)
self.assertEqual(summary['report0']['correlation']['Sol2']['flagged'], 750)
开发者ID:schiebel,项目名称:casa,代码行数:22,代码来源:test_agentflagger.py
示例19: test_summarylist1
def test_summarylist1(self):
'''agentflagger: multiple summaries'''
aflocal = aftool()
aflocal.open(self.vis)
aflocal.selectdata()
aflocal.parsesummaryparameters(name='summary_1')
aflocal.parsemanualparameters(intent='FOCUS') # non-existing intent
aflocal.parsesummaryparameters(name='summary_2')
aflocal.parsemanualparameters(spw='0')
aflocal.parsesummaryparameters(name='summary_3')
aflocal.init()
summary = aflocal.run()
aflocal.done()
# It creates 2 reports per summary agent. One is type='summary',
# ther other is type='plotpoints'
self.assertEqual(summary['report0']['name'],'summary_1')
self.assertEqual(summary['report2']['name'],'summary_2')
self.assertEqual(summary['report4']['name'],'summary_3')
self.assertEqual(summary['report0']['flagged'], 0)
self.assertEqual(summary['report2']['flagged'], 0)
self.assertEqual(summary['report4']['spw']['0']['flagged'], summary['report4']['spw']['0']['total'])
开发者ID:schiebel,项目名称:casa,代码行数:22,代码来源:test_agentflagger.py
示例20: test_clip_minmax_fparm_sol1_2
def test_clip_minmax_fparm_sol1_2(self):
"""AgentFlagger:: Test cliping first calibration solution product of FPARAM column using a minmax range """
# Run the previous test but using the specific parsing functions
aflocal = aftool()
datacolumn = 'FPARAM'
correlation = 'Sol1'
aflocal.open(self.vis)
aflocal.selectdata()
aflocal.parsemanualparameters(apply=False)
aflocal.parseclipparameters(clipzeros=True,clipminmax=[0.,600.],datacolumn=datacolumn,
correlation=correlation)
aflocal.parsesummaryparameters()
aflocal.init()
summary = aflocal.run(writeflags=True)
aflocal.done()
self.assertEqual(summary['report0']['total'], 129024)
self.assertEqual(summary['report0']['flagged'], 750)
self.assertEqual(summary['report0']['correlation']['Sol1']['flagged'], 750)
self.assertEqual(summary['report0']['correlation']['Sol1']['total'], 64512)
self.assertEqual(summary['report0']['correlation']['Sol2']['flagged'], 0)
self.assertEqual(summary['report0']['correlation']['Sol2']['total'], 64512)
开发者ID:schiebel,项目名称:casa,代码行数:22,代码来源:test_agentflagger.py
注:本文中的taskinit.aftool函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论