本文整理汇总了Python中AIPSTask.AIPSTask.opcode方法的典型用法代码示例。如果您正苦于以下问题:Python AIPSTask.opcode方法的具体用法?Python AIPSTask.opcode怎么用?Python AIPSTask.opcode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AIPSTask.AIPSTask
的用法示例。
在下文中一共展示了AIPSTask.opcode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: runclcal
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import opcode [as 别名]
def runclcal(indata, sources, calsour, opcode, interpol, snver, inver, gainver, gainuse, refant):
clcal = AIPSTask('CLCAL')
clcal.indata = indata
clcal.sources[1:] = sources
clcal.calsour[1:] = calsour
clcal.opcode = opcode
clcal.interpol = interpol
clcal.snver = snver
clcal.inver = inver
clcal.gainver = gainver
clcal.gainuse = gainuse
clcal.refant = refant
clcal.go()
示例2: flagLOMK
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import opcode [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()
示例3: __init__
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import opcode [as 别名]
#.........这里部分代码省略.........
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
apcal.timer = self.args["time"]
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))
示例4: AIPSTask
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import opcode [as 别名]
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
uvsub.inver = 1
uvsub.outdisk = indisk
uvsub.ncomp[1] = -1000000
uvsub.opcode = "DIV"
uvsub.go()
uvdata = AIPSUVData(uvname[i], "UVSUB", indisk, 1)
# wtmod = AIPSTask('WTMOD') #change weight relative to amplitude adjustments
# wtmod.indata = uvdata
# wtmod.aparm[1] = (maxamplitude(uvname[i])**2)*(10**10)
# wtmod.outdisk = indisk
# wtmod.go()
# uvdata = AIPSUVData(uvname[i],'WTMOD',2,1)
uvdata2 = WizAIPSUVData(uvname[i], "UVSUB", indisk, 1)
uvdata2.header["crval"][4] = pointcenRA
uvdata2.header.update()
uvdata2.header["crval"][5] = pointcenDEC
uvdata2.header.update()
示例5: flagmask
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import opcode [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'
#.........这里部分代码省略.........
示例6: AIPSTask
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import opcode [as 别名]
imean = AIPSTask('IMEAN')
imean.indata = imagedatacl
imean.indisk = 2
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
uvsub.inver = 1
uvsub.outdisk = 2
uvsub.ncomp[1] = -1000000
uvsub.opcode = 'DIV'
uvsub.go()
uvdata = AIPSUVData(uvname[i],'UVSUB',2,1)
wtmod = AIPSTask('WTMOD') #change weight relative to amplitude adjustments
wtmod.indata = uvdata
wtmod.aparm[1] = (maxamplitude(uvname[i])**2)*(10**10)
wtmod.outdisk = 2
wtmod.go()
uvdata = AIPSUVData(uvname[i],'WTMOD',2,1)
uvdata2 = WizAIPSUVData(uvname[i], 'WTMOD',2,1)
uvdata2.header['crval'][4] = pointcenRA
uvdata2.header.update()
uvdata2.header['crval'][5] = pointcenDEC
uvdata2.header.update()
示例7: N
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import opcode [as 别名]
subim.go()
#make a unit image for later use
comb.outdisk=mydisk
comb.indisk=mydisk
comb.inname=AIPSCat()[mydisk][-1].name
comb.inclass=AIPSCat()[mydisk][-1].klass
comb.inseq=AIPSCat()[mydisk][-1].seq
comb.in2disk=mydisk
comb.in2name=AIPSCat()[mydisk][-1].name
comb.in2class=AIPSCat()[mydisk][-1].klass
comb.in2seq=AIPSCat()[mydisk][-1].seq
comb.aparm[1]=1.
comb.aparm[2]=-1.
comb.aparm[3]=1.
comb.opcode='SUM'
comb.outcl='ONE'
comb.go()
#make a N(2,2) image
comb.aparm[1] = cLightKmS*(6./4.)*1.55e14/(restFreq22*restFreq22*1.E-9)
comb.aparm[2] = 1.E-10
comb.aparm[3] = 0
comb.aparm[4] = 0
comb.outcl='N(2,2)'
comb.opcode='SUM'
comb.go()
#make a N(1,1) image
comb.aparm[1] = cLightKmS*(2./1.)*1.55e14/(restFreq11*restFreq11*1.E-9)
comb.inclass='11'