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


Python AIPSTask.antennas[1]方法代码示例

本文整理汇总了Python中AIPSTask.AIPSTask.antennas[1]方法的典型用法代码示例。如果您正苦于以下问题:Python AIPSTask.antennas[1]方法的具体用法?Python AIPSTask.antennas[1]怎么用?Python AIPSTask.antennas[1]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AIPSTask.AIPSTask的用法示例。


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

示例1: flagLOMK

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import antennas[1] [as 别名]
def flagLOMK(datafile):
	# WRITE A FLAG FOR MK2-LT SPACING
	uvflg = AIPSTask('UVFLG')
	print "UVFLG: FLAGGING MK2-LT Baseline " + datafile.name + '.' + datafile.klass + '.' + format(datafile.seq)
	uvflg.indata = datafile
	uvflg.outfgver = 1
	uvflg.bif = 1
	uvflg.eif = 0
	uvflg.opcode = 'FLAG'
	uvflg.reason = 'Lovell - Mk2 baseline'
	uvflg.antennas[1] = 1 #Lovell
	uvflg.baseline[1] = 2 #MK2
	uvflg.go()
开发者ID:h-ramp,项目名称:pipeline,代码行数:15,代码来源:eMERLIN_tasks.py

示例2: float

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import antennas[1] [as 别名]
    nbas = 21

    clip.inname = src
    clip.inclass = 'UVCOPY'
    clip.inseq = 1
    clip.indisk = 2
    
    # Go through baselines and clip those visibilies that
    # still get through at > 4x the mean clean level 

    for ib in np.arange(1,nbas):
        ant1 = base_ant[ib][0]
        ant2 = base_ant[ib][1]

        clip.antennas[1] = ant1
        clip.antennas[2] = 0

        clip.baseline[1] = ant2
        clip.baseline[2] = 0

        clip.stokes = 'RR'
        clip.aparm[1] = float(lev0[ib]*4)
        clip.aparm[2] = float(lev0[ib]*4)
        clip.aparm[3] = 0.0
        clip.aparm[4] = 0.0
        clip.go()

        clip.stokes = 'LL'
        clip.aparm[1] = float(lev1[ib]*4)
        clip.aparm[2] = float(lev1[ib]*4)
开发者ID:DrWhatson,项目名称:eMERLIN_RFI_flagger,代码行数:32,代码来源:apply_flags.py

示例3: flagmask

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import antennas[1] [as 别名]
def flagmask(uvdata):

	"Function to apply flags from a mask of known bad frequencies, derived by the e-MERLIN team."

	afile = 'flagmask512.fg'
	if os.path.isfile(afile) :
		flagfile = open(afile, "r")
	else :
		print "Error:" + afile + "does not exist, don't know what to flag."
		print "Error: If you do not have this file, ask the e-MERLIN team."
		sys.exit()

	start = 0

	space = re.compile(r'\s')
	newline = re.compile(r'\n')

	uvflg = AIPSTask('UVFLG')

	fqtab=uvdata.table('FQ',1)
	band_strt = uvdata.header.crval[2]
	nchan = uvdata.header.naxis[2]
	if uvdata.header.naxis[3] > 1:
		ifstep = fqtab[0].total_bandwidth[0]
		band_stop = uvdata.header.crval[2] + (len(fqtab[0].total_bandwidth) * ifstep)
		chan_wdth = fqtab[0].total_bandwidth[0] / nchan
	else:
		ifstep = fqtab[0].total_bandwidth
		band_stop = uvdata.header.crval[2] + ifstep
		chan_wdth = fqtab[0].total_bandwidth / nchan


	for line in flagfile:
		line = newline.sub(r'', line)
		if start == 0:
			print line
		if line == "***BEGIN*PASS***":
			start = 1
		elif line == "***END*PASS***":
			print line
			start = 0
		elif start == 1:
			freq1  = float(space.sub(r'', line[87:98]))
			#print freq1, band_strt, band_stop, chan_wdth, ifstep
			if (freq1 >= band_strt) and (freq1 <= band_stop):
				ant1 = int(space.sub(r'', line[50:52]))
				if uvdata.header.naxis[3] > 1:
					ifs1 = int( 1 + ((freq1 - uvdata.header.crval[2]) / ifstep) )
					chans1 = int( (freq1 - (band_strt + (ifstep * (ifs1 - 1)))) / chan_wdth)
				else:
					ifs1 = 1
					chans1 = int( (freq1 - band_strt) / chan_wdth)

				start = 2
				print line[0:49], str(ant1).rjust(2), line[53:76], str(ifs1).rjust(2), line[81:86], str(chans1).rjust(12), line[99:140]
				pass
		elif start == 2:
			freq2  = float(space.sub(r'', line[87:98]))
			if (freq2 >= band_strt) and (freq2 <= band_stop):
				ant2 = int(space.sub(r'', line[50:52]))
				if uvdata.header.naxis[3] > 1:
					ifs2 = int( 1 + ((freq2 - uvdata.header.crval[2]) / ifstep) )
					chans2 = int( (freq2 - (band_strt + (ifstep * (ifs2 - 1)))) / chan_wdth)
					if chans2 == 0:
						chans2 = nchan
				else:
					ifs2 = 1
					chans2 = int( (freq2 - band_strt) / chan_wdth)
					
				# Deal with commands which cross a band edge
				if chans2 < chans1 :
					
					print line[0:49], str(ant2).rjust(2), line[53:76], str(ifs1).rjust(2), line[81:86], str(nchan).rjust(12), line[99:140]
					print line[0:49], str(ant1).rjust(2), line[53:76], str(ifs2).rjust(2), line[81:86], str(1).rjust(12), line[99:140]
					print line[0:49], str(ant2).rjust(2), line[53:76], str(ifs2).rjust(2), line[81:86], str(chans2).rjust(12), line[99:140]

					uvflg.indata = uvdata
					uvflg.sources[1:] = ''
					uvflg.timerang[1:] = 0,0,0,0,999,23,59,59
					uvflg.bchan = chans1
					uvflg.echan = nchan
					uvflg.bif = ifs1
					uvflg.eif = ifs1
					uvflg.antennas[1] = ant1
					uvflg.baseline[1] = ant2
					uvflg.opcode = 'FLAG'
					uvflg.reason = 'e-MERLIN flag mask'
					uvflg.go()

					uvflg.indata = uvdata
					uvflg.sources[1:] = ''
					uvflg.timerang[1:] = 0,0,0,0,999,23,59,59
					uvflg.bchan = 1
					uvflg.echan = chans2
					uvflg.bif = ifs2
					uvflg.eif = ifs2
					uvflg.antennas[1] = ant1
					uvflg.baseline[1] = ant2
					uvflg.opcode = 'FLAG'
					uvflg.reason = 'e-MERLIN flag mask'
#.........这里部分代码省略.........
开发者ID:h-ramp,项目名称:pipeline,代码行数:103,代码来源:eMERLIN_tasks.py

示例4: assert

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import antennas[1] [as 别名]
assert(not uvdata.exists())

fitld = AIPSTask('fitld')
fitld.datain = file
fitld.outdata = uvdata
fitld.msgkill = 2
fitld.go()

assert(uvdata.exists())

try:
    uvflg = AIPSTask('uvflg')
    uvflg.indata = uvdata
    uvflg.bchan = 1
    uvflg.echan = 1
    uvflg.antennas[1] = 1
    uvflg.stokes = 'CROS'
    uvflg.reason = 'TEST'
    uvflg()

    uvflg.stokes = 'RL'
    uvflg()
    
    print uvdata.tables
    fqtable = uvdata.table('FQ', 0)
    print fqtable[0]
    fgtable = uvdata.table('FG', 0)
    for row in fgtable:
        print row
        continue
    assert (fgtable[0].pflags == [0, 0, 1, 1])
开发者ID:kernsuite-debian,项目名称:parseltongue,代码行数:33,代码来源:flag.py


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