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


Python AIPSTask.niter方法代码示例

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


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

示例1: runimagr

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

示例2: __init__

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

#.........这里部分代码省略.........
        clcal.inver = snVers
        clcal.gainver = 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))
 
        #cleans the image
        print("Running imagr")
        imagr = AIPSTask('IMAGR')
        imagr.indata = uvdata
        imagr.sources[1] = self.args["cal"]
        imagr.timerang = self.args["time"]
        imagr.docalib = 1
        imagr.outseq = iterNum #test to force it to make file
        imagr.gainuse = clVers
        imagr.bchan = self.args["bchan"]
        imagr.echan = self.args["echan"]
        imagr.nchav = (self.args["echan"]-self.args["bchan"] + 1)
        if self.args["doBP"]:
            imagr.doband = 1
            imagr.bpver = 1
        if self.args["excludeTelly"]:
            imagr.antennas[1:] = self.args["excludedTellys"]
        imagr.cellsize = AIPSList([0.0001,0.0001])
        imagr.imsize = AIPSList([256,256])
        imagr.nboxes = len(self.args["CalCleanBox"])
        imagr.clbox[1:] = self.args["CalCleanBox"]
        imagr.niter = 1000
        imagr.go()
        print("Done with imagr")

        #to get last positive row
        latestImgTable = 0
        for j in imageClean.tables:
            if j[1] == 'AIPS CC' and j[0]>latestImgTable:
                latestImgTable = j[0]
        ccTable = imageClean.table('CC', latestImgTable)
        for row, i in enumerate(ccTable, start=2): #start @ 2 to get last positive
            if i['flux']<0:
                lastPositive = row
                break
        print("The last positive component number is: {0}".\
              format(lastPositive))

        print("Running Calib")
        calibSelf = AIPSTask('calib')
        calibSelf.in2data = imageClean 
        calibSelf.indata = uvdata
        calibSelf.calsour[1] = self.args["cal"]
        calibSelf.docalib = 1
        calibSelf.gainuse = clFring
        calibSelf.solint = 0.2
        calibSelf.soltype = 'L1'
        calibSelf.solmode = 'A&P'
        if self.args["excludeTelly"]:
            calibSelf.antennas[1:] = self.args["excludedTellys"]
        calibSelf.ncomp[1] = lastPositive
        calibSelf.timer = self.args["time"]
        if self.args["doBP"]:
            calibSelf.doband = 1
开发者ID:jkania7,项目名称:pride,代码行数:70,代码来源:cleaner.py

示例3: range

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import niter [as 别名]
    for i in range(len(uvname)):
        uvdata = AIPSUVData(uvname[i], "SPLAT", indisk, 1)  # name the uv file in AIPS
        imagedata = AIPSImage(uvname[i], "IIM001", indisk, 1)

        nchan = uvdata.header.naxis[2]
        imagr = AIPSTask("IMAGR")
        imagr.nchav = nchan  # use imagr to get a clean model!
        imagr.indata = uvdata
        imagr.outname = uvdata.name
        imagr.cellsize[1:] = findmaxb(uvdata)
        imagr.imsize[1:] = imsize
        imagr.nboxes = 1
        imagr.nfield = 1
        imagr.outdisk = indisk
        imagr.uvwtfn = ""
        imagr.niter = niter
        imagr.go()

        imagedatacl = AIPSImage(uvname[i], "ICL001", indisk, 1)

        imean = AIPSTask("IMEAN")
        imean.indata = imagedatacl
        imean.indisk = indisk
        imean.doprint = 1
        imean.outtext = "PWD:IMEAN" + uvname[i] + ".txt"
        imean()

        uvsub = AIPSTask("UVSUB")  # Divide visibilites by clean model!
        uvsub.indata = uvdata
        uvsub.nmaps = 1
        uvsub.in2data = imagedatacl
开发者ID:jradcliffe5,项目名称:multi_self_cal,代码行数:33,代码来源:multi_source_self_cal_v1.2.py

示例4: __init__

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


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