本文整理汇总了Python中AIPSTask.AIPSTask.invers方法的典型用法代码示例。如果您正苦于以下问题:Python AIPSTask.invers方法的具体用法?Python AIPSTask.invers怎么用?Python AIPSTask.invers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AIPSTask.AIPSTask
的用法示例。
在下文中一共展示了AIPSTask.invers方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MergeCal
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import invers [as 别名]
def MergeCal(inUV, err, \
GCver=1, TYver=1, PCver=1, outVer=0, timeTol=1.0):
""" Fix up VLBA screwed up calibration
Merges redundant entries in VLBA GC, TY and PC tables
Translated from the AIPSish MERGECAL (requires AIPS task TAMRG)
inUV = UV data object to fix, MUST be in AIPS format
err = Python Obit Error/message stack
GCver = Version number of GC table to be fixed.
TYver = Version number of TY table to be fixed.
PCver = Version number of PC table to be fixed.
outVer = Version number of output tables
(same for all three table types).
timeTol = Tolerance for time comparisons in seconds.
Records will not be merged if their times differ
by more than this amount.
"""
################################################################
if inUV.FileType!='AIPS':
raise RuntimeError,"Can ONLY handle AIPS data"
# Set up
tamrg = AIPSTask("tamrg")
tamrg.inname = inUV.Aname
tamrg.inclass = inUV.Aclass
tamrg.indisk = inUV.Disk
tamrg.inseq = inUV.Aseq
# GC table
tamrg.inext = "GC"
tamrg.invers = GCver
tamrg.outvers = outVer
tamrg.aparm[1:] = [1.,1.,2.,1.,3.,1.,0.,0.,0.,0.]
tamrg.bparm[1:] = [1.,2.,3.,0.,0.,0.,0.,0.,0.,0.]
tamrg.cparm[1:] = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
tamrg.dparm[1:] = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
tamrg.g
# TY table
tamrg.inext = "TY"
tamrg.invers = TYver
tamrg.outvers = outVer
tamrg.aparm[1:] = [1.,1.,4.,1.,5.,1.,6.,1.,0.,0.]
tamrg.bparm[1:] = [1.,3.,4.,5.,6.,0.,0.,0.,0.,0.]
tamrg.cparm[1:] = [timeTol/(24.*60.*60.),0.,0.,0.,0.,0.,0.,0.,0.,0.]
tamrg.dparm[1:] = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
tamrg.g
# PC table
tamrg.inext = "PC"
tamrg.invers = PCver
tamrg.outvers = outVer
tamrg.aparm[1:] = [1.,1.,4.,1.,5.,1.,6.,1.,0.,0.]
tamrg.bparm[1:] = [1.,3.,4.,5.,6.,0.,0.,0.,0.,0.]
tamrg.cparm[1:] = [timeTol/(24.*60.*60.),0.,0.,0.,0.,0.,0.,0.,0.,0.]
tamrg.dparm[1:] = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
tamrg.g
示例2: runsnplt
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import invers [as 别名]
def runsnplt(indata, inext, invers, sources, nplots, optype, dotv):
snplt = AIPSTask('SNPLT')
snplt.indata = indata
snplt.inext= inext
snplt.invers = invers
snplt.sources[1:] = sources
snplt.nplots = nplots
snplt.optype = optype
snplt.dotv = dotv
snplt.go()
示例3: __init__
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import invers [as 别名]
#.........这里部分代码省略.........
snVers = 0
clVers = 0
for i in uvdata.tables:
if i[1] == 'AIPS SN' and i[0] > snVers:
snVers = i[0]
if i[1] == 'AIPS CL' and i[0] > clVers:
clVers = i[0]
print("Deleting tables.")
uvdata.zap_table('SN', -1)
for k in range(clVers,1,-1):
uvdata.zap_table('CL', k)
snVers = 0
clVers = 1
if imageClean.exists():
imageClean.clrstat()
imageClean.zap()
if imageDirty.exists():
imageDirty.clrstat()
imageDirty.zap()
if flag.exists():
flag.clrstat()
flag.zap()
fitldFL = AIPSTask("FITLD")
fitldFL.datain = args["flagPath"]
fitldFL.outname = self.args["name"]
fitldFL.outseq = 100
fitldFL.ncount = 1
fitldFL.go()
print("Copying flagging")
tacop = AIPSTask("TACOP")
tacop.indata = flag
tacop.invers = 3
tacop.ncount = 1
tacop.outname = self.args["name"]
tacop.outseq = self.args["inseq"]
tacop.outclass = 'UVDATA'
tacop.outdisk = 1
tacop.outver = 0
tacop.inext = 'FG'
tacop.go()
if self.args["doBP"]:
uvdata.zap_table('BP', -1) #create a new bp table for each reftelly
print("Running bandpass")
bpass = AIPSTask('BPASS')
bpass.indata = uvdata
bpass.calsour[1] = self.args["bandPassCal"]
bpass.timer = self.args["time"]
bpass.refant = self.args["refTelly"]
if self.args["excludeTelly"]:
bpass.antennas[1:] = self.args["excludedTellys"]
bpass.go()
"""
uvdata.zap_table('TY', -1)
uvdata.zap_table('GC', -1)
print("Running antab")
antab = AIPSTask('ANTAB')
antab.indata = uvdata
antab.calin = self.args["antPath"]
antab.go()
print("Running apcal")
apcal = AIPSTask('APCAL')
apcal.indata = uvdata
示例4:
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import invers [as 别名]
if combinIFLLRR == 2:
calib.aparm[1:] = 3, 0, 0, 0, 1, 0, 0, 0
if combinIFLLRR == 3:
calib.aparm[1:] = 3, 0, 1, 0, 0, 0, 0, 0
if combinIFLLRR == 4:
calib.aparm[1:] = 3, 0, 1, 0, 1, 0, 0, 0
calib.soltype = "L1"
calib.solmode = APhas
calib.snver = i
calib.go()
snplt.indata = uvdata
snplt.indisk = indisk
snplt.inext = "SN"
snplt.pixrange[1:] = -180, 180
snplt.invers = i
snplt.nplots = 9
snplt.optype = "PHAS"
if combinIFLLRR == 1:
snplt.opcode = ""
if combinIFLLRR == 2:
snplt.opcode = "ALIF"
if combinIFLLRR == 3:
snplt.opcode = "ALST"
if combinIFLLRR == 4:
snplt.opcode = "ALSI"
snplt.dotv = -1
snplt.go()
clcal.indata = uvdata
clcal.interpol = "AMBG"
示例5: __init__
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import invers [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()
示例6: assert
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import invers [as 别名]
assert(not uvdata.exists())
fitld = AIPSTask('fitld')
fitld.datain = file
fitld.outdata = uvdata
fitld.msgkill = 2
fitld.go()
assert(uvdata.exists())
try:
tacop = AIPSTask('tacop')
tacop.indata = uvdata
tacop.outdata = uvdata
tacop.inext = 'CL'
tacop.invers = 1
tacop.outvers = 3
tacop()
assert([3, 'AIPS CL'] in uvdata.tables)
uvdata.zap_table('CL', 1)
assert([3, 'AIPS CL'] in uvdata.tables)
assert([1, 'AIPS CL'] not in uvdata.tables)
tacop = AIPSTask('tacop')
tacop.indata = uvdata
tacop.outdata = uvdata
tacop.inext = 'CL'
tacop.invers = 3