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


Python AIPSTask.outfile方法代码示例

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


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

示例1: lwpla

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outfile [as 别名]
def lwpla (aipsname,incl,indisk,outfile,logfiledir='./'):
    lwpla = AIPSTask('lwpla')
    lwpla.inname = aipsname
    lwpla.inclass = incl
    lwpla.indisk = indisk
    lwpla.outfile = outfile
    stdout = sys.stdout; sys.stdout = open(logfiledir+aipsname+'.log','a')
    lwpla.go()
    sys.stdout.close(); sys.stdout = stdout
开发者ID:varenius,项目名称:lofar-lb,代码行数:11,代码来源:lofipi_aips.py

示例2: runlwpla

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outfile [as 别名]
def runlwpla(indata, outfile):
	plver=0
	outfile = re.sub(r"\s+", '-', outfile)
	for tab in indata.tables :
		if 'PL' in tab[1] :
			plver = plver + 1
	if os.path.exists(outfile) :
		os.remove(outfile)
	lwpla = AIPSTask('LWPLA')
	lwpla.indata = indata
	lwpla.plver = 1
	lwpla.inver = plver
	lwpla.outfile = outfile
	lwpla.msgkill = -10
	lwpla.go()
	# Remove PL tables
	indata.zap_table('PL', -1)
开发者ID:h-ramp,项目名称:pipeline,代码行数:19,代码来源:eMERLIN_tasks.py

示例3: __init__

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

#.........这里部分代码省略.........
            calibSelf.doband = 1
            calibSelf.bpver = 1
        calibSelf.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:
            print("SN = {0} , snVers = {1}".format(SN, snVers))
            sys.exit("SN table number missmatch")


        print("calibSelf created SN table {0}".format(snVers))

        #makes contour plot
        kntr = AIPSTask('KNTR')
        kntr.indata = imageClean
        kntr.levs = AIPSList([-1,1,2,3,4,5,7,10])
        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]
        kntr.go()
        

        lwmp = AIPSTask('LWPLA')
        lwmp.indata = imageClean
        lwmp.plver = 1
        lwmp.invers = 1
        lwmp.outfile = os.getcwd() + '/images_{0}/{1}_time{2}'.format(self.args["date"],self.args["cal"],self.iterNum) + '.ps'
        lwmp.go()

        print("Running clcal")
        clcal.snver = snVers
        clcal.inver = snVers
        clcal.sources[1] = self.args["cal"]
        clcal.calsour[1] = self.args["cal"] 
        clcal.gainver = clVers
        print("clVers = {0}".format(clVers))
        clcal.go() #Apply only to cal
        clVers = clVers + 1
        CL = 0
        for i in uvdata.tables:
            if i[1] == 'AIPS CL' and i[0]>CL:
                CL = i[0]
        if not CL == clVers:
            sys.exit("CL table number missmatch")
        print("clcal created CL table {0}".format(clVers))

        print("Running clcal.")
        clcalFinal = AIPSTask('clcal') 
        clcalFinal.indata = uvdata
        clcalFinal.sources[1] = self.args["source"]
        clcalFinal.calsour[1] = self.args["cal"]
        clcalFinal.timerang = self.args["time"]
        clcalFinal.snver = snVers
        clcalFinal.inver = snVers
        clcalFinal.gainver = clFring
        if self.args["excludeTelly"]:
            clcalFinal.antennas[1:] = self.args["excludedTellys"]
        clcalFinal.timer = self.args["time"]
        clcalFinal.refant = self.args["refTelly"]
开发者ID:jkania7,项目名称:pride,代码行数:70,代码来源:cleaner.py

示例4: AIPSTask

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outfile [as 别名]
        clcal.go()

    lwpla = AIPSTask("LWPLA")
    lwpla.indata = uvdata
    lwpla.indisk = indisk
    lwpla.plver = 1
    if combinIFLLRR == 1:
        lwpla.invers = int(itercal * (math.ceil((noteles * 16) / 9.0)))
    if combinIFLLRR == 2:
        lwpla.invers = int(itercal * (math.ceil((noteles * 2) / 9.0)))
    if combinIFLLRR == 3:
        lwpla.invers = int(itercal * (math.ceil((noteles * 8) / 9.0)))
    if combinIFLLRR == 4:
        lwpla.invers = int(itercal * (math.ceil(noteles / 9.0)))
    lwpla.lpen = 1
    lwpla.outfile = "PWD:Sol_tabl_" + str(itercal) + "iter_" + str(soli) + "sol.ps"
    lwpla.go()

    tasav = AIPSTask("TASAV")
    tasav.indata = uvdata
    tasav.indisk = indisk
    tasav.outname = "MFSC_SN"
    tasav.outclass = "TASAV"
    tasav.outdisk = indisk
    tasav.go()

    fittp = AIPSTask("FITTP")
    fittp.indata = AIPSUVData("MFSC_SN", "TASAV", indisk, 1)
    fittp.indisk = indisk
    fittp.dataout = "PWD:MFSC_corr_" + str(itercal) + "iter_" + str(soli) + "sol.TASAV"
    fittp.go()
开发者ID:jradcliffe5,项目名称:multi_self_cal,代码行数:33,代码来源:multi_source_self_cal_v1.2.py

示例5: __init__

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

#.........这里部分代码省略.........
            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]
                kntr.go()
                
                lwmp = AIPSTask('LWPLA')
                lwmp.indata = imageClean
                lwmp.plver = 1
                lwmp.invers = 1
                if good:
                    lwmp.outfile = address +  '.ps'
                else:
                    lwmp.outfile = address  + '_bad.ps'
                lwmp.go()

                imageClean.zap()
                imageDirty.zap()
开发者ID:jkania7,项目名称:pride,代码行数:104,代码来源:location_finder.py

示例6: enumerate

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outfile [as 别名]
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)
    lwpla.go()
    """
    pwd = os.getcwd()
    p = "{0}/uvplt_time*.ps".format(pwd)
    print p
    call("ps2pdf","uvplt_time*.ps" )
    """
开发者ID:jkania7,项目名称:pride,代码行数:31,代码来源:uvplts.py

示例7: AIPSTask

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outfile [as 别名]
		clcal.go()
	
	lwpla = AIPSTask('LWPLA')
	lwpla.indata = uvdata
	lwpla.indisk = 2
	lwpla.plver = 1
	if combinIFLLRR == 1:
		lwpla.invers = int(itercal*(math.ceil((noteles*16)/9.0)))
	if combinIFLLRR == 2:
		lwpla.invers = int(itercal*(math.ceil((noteles*2)/9.0)))
	if combinIFLLRR == 3:
		lwpla.invers = int(itercal*(math.ceil((noteles*8)/9.0)))
	if combinIFLLRR == 4:
		lwpla.invers = int(itercal*(math.ceil(noteles/9.0)))
	lwpla.lpen = 1
	lwpla.outfile = 'PWD:Sol_tabl_' + str(itercal) + 'iter_' +str(soli)+ 'sol.ps'
	lwpla.go()

	tasav = AIPSTask('TASAV')
	tasav.indata = uvdata
	tasav.indisk = 2
	tasav.outname = 'MFSC_SN'
	tasav.outclass = 'TASAV'
	tasav.outdisk = 2
	tasav.go()

	fittp = AIPSTask('FITTP')
	fittp.indata = AIPSUVData('MFSC_SN','TASAV',2,1)
	fittp.indisk = 2
	fittp.dataout = 'PWD:MFSC_corr_' + str(itercal) + 'iter_' +str(soli)+ 'sol.TASAV'
	fittp.go()
开发者ID:jradcliffe5,项目名称:multi_self_cal,代码行数:33,代码来源:multi_source_self_cal.py


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