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


Python AIPSTask.bchan方法代码示例

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


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

示例1: runvplot

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import bchan [as 别名]
def runvplot(indata, sources, stokes, timer, anten, basel, bif, eif, bchan, echan, docalib, gainuse, flagver, doband, bpver, aparm, bparm, refant, dotv, nplots):
	vplot = AIPSTask('VPLOT')
	vplot.indata = indata
	vplot.sources[1:] = sources
	vplot.stokes = stokes
	vplot.timerang[1:] = timer
	vplot.antennas[1:] = anten
	vplot.baseline[1:] = basel
	vplot.bchan = bchan
	vplot.echan = echan
	vplot.avgchan = 1
	vplot.bif = bif
	vplot.eif = eif
	vplot.docalib = docalib
	vplot.gainuse = gainuse
	vplot.flagver = flagver
	vplot.doband = doband
	vplot.bpver = bpver
	vplot.aparm[1:] = aparm
	vplot.bparm[1:] = bparm
	vplot.crowded = 0
	vplot.refant = refant
	vplot.dotv = dotv
	vplot.xinc = 1
	vplot.nplots = nplots
	vplot.go()
开发者ID:h-ramp,项目名称:pipeline,代码行数:28,代码来源:eMERLIN_tasks.py

示例2: runquickvplot

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import bchan [as 别名]
def runquickvplot(uvdata):
	vplot = AIPSTask('VPLOT')
	vplot.indata = uvdata
	vplot.bchan =  3*uvdata.header['naxis'][2] /8 
	vplot.bchan =  5*uvdata.header['naxis'][2] /8
	vplot.solint = 0.5
	vplot.crowded = 3
	vplot.do3col = 1
	vplot.bparm[1] = 0
	vplot.bparm[2]=-2
	vplot.nplot = 6
	vplot.go()
开发者ID:h-ramp,项目名称:pipeline,代码行数:14,代码来源:eMERLIN_tasks.py

示例3: runfring

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import bchan [as 别名]
def runfring(indata, calsour, timer, docalib, gainuse, flagver, doband, bpver, refant, refantlist, solint, aparm, dparm, snver, snr, bchan, echan):
	print 'Running FRING on ', format(calsour)
	fring = AIPSTask('FRING')
	fring.indata = indata
	fring.calsour[1:] = calsour
	fring.timer[1:] = timer
	fring.docalib = docalib
	fring.gainuse = gainuse
	fring.flagver = flagver
	fring.doband = doband
	fring.bpver = bpver
	fring.refant = refant
	fring.search[1:] = refantlist
	fring.solint = solint
	fring.cmethod = 'DFT'
	fring.aparm[1:] = aparm
	fring.aparm[7] = snr
	fring.dparm[1:] = dparm
	fring.snver = snver
	fring.bchan = bchan
	fring.echan = echan
	fring.go()
开发者ID:h-ramp,项目名称:pipeline,代码行数:24,代码来源:eMERLIN_tasks.py

示例4: runuvhgm

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import bchan [as 别名]
def runuvhgm(indata, sources, anten, basel, SEFDbif, SEFDeif, SEFDbchan, SEFDechan):
	uvhgm = AIPSTask('UVHGM')
	uvhgm.indata = indata
	uvhgm.sources[1:] = sources
	uvhgm.antennas[1:] = anten
	uvhgm.baseline[1:] = basel
	uvhgm.bif = SEFDbif
	uvhgm.eif = SEFDeif
	uvhgm.flagver = 0
	uvhgm.stokes ='HALF'
	uvhgm.bchan = SEFDbchan
	uvhgm.echan = SEFDechan
	uvhgm.doall = 1
	uvhgm.axtype ='H'
	uvhgm.timerang[1:] = 0, 0, 0, 0, 0, 0, 0, 0
#	uvhgm.timerang[1:] = 0, 0, 0, 0, 3, 0, 0, 0
#	uvhgm.pixrange[1:] = -20, 20
	uvhgm.dotv = -1
	uvhgm.docal = 1
	uvhgm.gainuse = 0
	uvhgm.pixrange[1:] = -10, 10
	uvhgm.doband = -1
	uvhgm.nboxes = 1000
	uvhgm.go()
开发者ID:h-ramp,项目名称:pipeline,代码行数:26,代码来源:eMERLIN_tasks.py

示例5: runimagr

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import bchan [as 别名]
def runimagr(indata, sources, docalib, gainuse, flagver, doband, bpver, bchan, echan, nchav, chinc, cellsiz, imsiz, niter, dotv, outdisk):
	imagr = AIPSTask('IMAGR')
	imagr.indata = indata
	imagr.sources[1:] = sources
	source = str(sources[0])
	if len(source)>12 :
		source = source[0:12]
	imagr.outname = source
	imagr.outdisk = outdisk
	imagr.docalib = docalib
	imagr.gainuse = gainuse
	imagr.flagver = flagver
	imagr.doband = doband
	imagr.bpver = bpver
	imagr.bchan = bchan
	imagr.echan = echan
	imagr.nchav = nchav
	imagr.chinc = chinc
	imagr.cellsize[1:] = cellsiz
	imagr.imsize[1:] = imsiz
	imagr.niter = niter
	imagr.dotv = dotv
	imagr.inp()
	imagr.go()
开发者ID:h-ramp,项目名称:pipeline,代码行数:26,代码来源:eMERLIN_tasks.py

示例6: __init__

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import bchan [as 别名]

#.........这里部分代码省略.........
        apcal.tyver = 1
        apcal.gcver = 1
        apcal.go()
        
        snVers = snVers + 1
        print("apcal made snVers {0}".format(snVers))
        
        #applies new SN table to CL
        print("Running clcal.")
        clcal = AIPSTask('clcal') 
        clcal.indata = uvdata
        clcal.calsour[1] = self.args["cal"]
        clcal.timerang = self.args["time"]
        clcal.snver = snVers
        clcal.inver = snVers
        clcal.gainver = clInit #apply to original cl
        clcal.timer = self.args["time"]
        clcal.interpol = "ambg"
        clcal.opcode = "calp"
        clcal.refant = self.args["refTelly"]
        clcal.go()

        clVers = clVers + 1
        print("clcal made cl table {0}".format(clVers))
        """
        print("Running Fring.")
        fring = AIPSTask('fring') #finds fringes
        fring.indata = uvdata
        fring.docalib = 1
        fring.gainuse = clVers
        if self.args["excludeTelly"]:
            fring.antennas[1:] = self.args["excludedTellys"]
        fring.calsour[1] = self.args["cal"]
        fring.bchan = self.args["bchan"]
        fring.echan = self.args["echan"]
        fring.timer = self.args["time"]
        fring.refant = self.args["refTelly"]
        if self.args["doBP"]:
            fring.doband = 1
            fring.bpver = 1
        fring.go()
        
        snVers = snVers + 1
        SN = 0
        for i in uvdata.tables:
            if i[1] == 'AIPS SN' and i[0]>SN:
                SN = i[0]
        if not SN == snVers:
            sys.exit("SN table number missmatch")
        print("Fring created SN table {0}".\
              format(snVers))

        
        #applies new SN table to CL
        print("Running clcal.")
        clcal = AIPSTask('clcal') 
        clcal.indata = uvdata
        clcal.calsour[1] = self.args["cal"]
        clcal.timerang = self.args["time"]
        if self.args["excludeTelly"]:
            clcal.antennas[1:] = self.args["excludedTellys"]
        clcal.snver = snVers
        clcal.inver = snVers
        clcal.gainver = clInit #apply to original cl
        clcal.timer = self.args["time"]
        clcal.interpol = "ambg"
开发者ID:jkania7,项目名称:pride,代码行数:70,代码来源:cleaner.py

示例7: __init__

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import bchan [as 别名]
    def __init__(self, clVers, **args):
        self.clVers = clVers
        self.args = args
        self.clVers = 3
        AIPS.userno=self.args["user"]
        uvdata = AIPSUVData(self.args["name"], 'UVDATA', 1, self.args["inseq"])
        t = [] #files t with [day, hour, min, sec, day, hour, min, sec]
        with open(self.args["timeList"], 'r') as f:
            for l in f.readlines():
                t.append(map(str,l.split()[1:9]))
        
        
        for j in t:
            realtime = ''.join([j[i] for i in range(len(j))])[0:7]
            imgname = realtime[0:5]
            #need to shorten the names for AIPS
            imagr = AIPSTask('IMAGR')
            imagr.indata = uvdata
            imagr.sources[1] = self.args["source"]
            imagr.docalib = 1
            imagr.gainuse = self.clVers
            imagr.bchan = self.args["SCbchan"]
            imagr.echan = self.args["SCechan"]
            imagr.nchav = (self.args["SCechan"] - self.args["SCbchan"] + 1)
            #averages over all channels
	    if self.args["doBP"]:
	      imagr.doband = 1	
	      imagr.bpver = 1
            if self.args["excludeTelly"]:
                imagr.antennas[1:] = self.args["excludedTellys"]
            imagr.outname = imgname
            imagr.outseq = 1
            imagr.cellsize = AIPSList([0.0001,0.0001])
            #imagr.imsize = AIPSList([1024,1024])
            imagr.imsize = AIPSList([256,256])
            imagr.nboxes = 1
            imagr.clbox[1] = self.args["fitBox"]
            imagr.niter = 1000
            imagr.timerang[1:] = [int(j[i]) for i in range(len(j))]#AIPSList(j)
            good = True
            
            try:
                imagr.go()
            except RuntimeError as e:
                print("\nSomething went wrong!\n  => {0}".format(e))
                with open(os.getcwd() + '/images_{0}/badtimes.txt'.format(self.args["date"]), 'a') as out:
                    out.write("{0}\n".format(imgname))
                good = False
            if good:
                imageClean = AIPSImage(imgname, 'ICL001',1,1)
                imageDirty = AIPSImage(imgname, 'IBM001',1,1)
                imageClean.clrstat() #makes sure AIPS does not trip
                imageDirty.clrstat()

                jmfit = AIPSTask('JMFIT')
                jmfit.indata = imageClean
                jmfit.blc[1] = .80*self.args["fitBox"][1]#fraction to increase box size
                jmfit.blc[2] = .80*self.args["fitBox"][2]
                jmfit.trc[1] = 1.20*self.args["fitBox"][3]
                jmfit.trc[2] = 1.20*self.args["fitBox"][4]
                jmfit.niter = 1000
                jmfit.doprint = 1 #CHANGED TO doprint!  
                address = os.getcwd() + '/images_{0}/'.format(self.args["date"]) + realtime
                jmfit.fitout = address + '.crd'
                jmfit.go()

                RA = [None]*4 #holds locations
                DEC = [None]*4
                with open(address + '.crd', 'r') as f:
                    for l in f.readlines():
                        temp = l.split()
                        #for j in range(len(temp)):
                        if len(temp)>0:
                            if temp[0] == 'RA':
                                RA[0] = int(temp[1])
                                RA[1] = int(temp[2])
                                RA[2] = float(temp[3])
                                RA[3] = float(temp[5])
                            elif temp[0] =='DEC':
                                DEC[0] = int(temp[1])
                                DEC[1] = int(temp[2])
                                DEC[2] = float(temp[3])
                                DEC[3] = float(temp[5])
                                

                with open(os.getcwd() + '/images_{0}/locations.txt'.format(self.args["date"]), 'a') as out:
                    out.write("{0}\t{1}\t{2}\t{3:^10}\t{4:^6}\t{5}\t{6}\t{7:^7}\t{8}\n".
                              format(realtime, RA[0], RA[1], RA[2], RA[3], \
                                     DEC[0], DEC[1], DEC[2], DEC[3]))
                #makes contour plot
                kntr = AIPSTask('KNTR')
                kntr.indata = imageClean
                kntr.levs = AIPSList([2,3,4,5,7,10,13,17])
                kntr.dogrey = -1
                kntr.dotv = -1 
                kntr.dovect = -1 
                #kntr.blc[1] .80*self.args["fitBox"][1]
                #kntr.blc[2] .80*self.args["fitBox"][2]
                #kntr.trc[1] 1.20*self.args["fitBox"][3]
                #kntr.trc[2] 1.20*self.args["fitBox"][4]
#.........这里部分代码省略.........
开发者ID:jkania7,项目名称:pride,代码行数:103,代码来源:location_finder.py

示例8: flagmask

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import bchan [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

示例9: AIPSUVData

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import bchan [as 别名]
from AIPS import AIPS
from AIPSTask import AIPSTask, AIPSList
from AIPSData import AIPSUVData, AIPSImage
from subprocess import call
import os
AIPSTask.msgkill = 3
AIPS.userno = 916
uvdata = AIPSUVData('gr035', 'UVDATA', 1, 1)

for i,t in enumerate([[None,0], [None,0,18,59,30, 1,3,46,30], [None,1,2,1,30, 1,9,0,30], \
                      [None,1,8,18,30, 1,18,30,0]],start=0): 
    uvdata.zap_table('PL', -1)
    uvplt = AIPSTask('UVPLT')
    uvplt.timerang = t
    uvplt.indata = uvdata
    uvplt.bchan = 1
    uvplt.echan = 256
    uvplt.nchav = 256
    #uvplt.docalib = 1
    #uvplt.gainuse = 1 
    #uvplt.doband = 1
    #uvplt.bpver = 1
    uvplt.bparm = AIPSList([6, 7])
    uvplt.dotv = -1 
    uvplt.xinc = 20
    uvplt.go()

    lwpla = AIPSTask('LWPLA')
    lwpla.indata = uvdata
    lwpla.plver = 1
    lwpla.outfile = 'PWD:uvplt_time{0}.ps'.format(i)
开发者ID:jkania7,项目名称:pride,代码行数:33,代码来源:uvplts.py

示例10: assert

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import bchan [as 别名]
    pass

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
开发者ID:kernsuite-debian,项目名称:parseltongue,代码行数:33,代码来源:flag.py


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