本文整理汇总了Python中AIPSTask.AIPSTask.outcl方法的典型用法代码示例。如果您正苦于以下问题:Python AIPSTask.outcl方法的具体用法?Python AIPSTask.outcl怎么用?Python AIPSTask.outcl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AIPSTask.AIPSTask
的用法示例。
在下文中一共展示了AIPSTask.outcl方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: remove_continuum
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outcl [as 别名]
def remove_continuum(outseq):
trans = AIPSTask("trans")
imlin = AIPSTask("imlin")
entry = cat.get_entry(1) # get SDGRD entry
img = cat.get_image(entry)
nChan = round(img.header.naxis[2])
# transpose image in order to run IMLIN
trans.indisk = DISK_ID
trans.outdisk = DISK_ID
trans.baddisk[1] = BADDISK
trans.inname = entry.name
trans.inclass = "SDGRD"
trans.inseq = outseq
trans.transc = "312"
trans.outcl = "trans"
trans.go()
# Run imlin task on trans file
# remove a spectral baseline. Output image is in Freq-RA-Dec order
# (Transcod 312)
imlin.indisk = DISK_ID
imlin.outdisk = DISK_ID
imlin.outcl = "IMLIN"
last = cat.last_entry()
imlin.inname = last.name
imlin.inclass = last.klass
imlin.inseq = last.seq
imlin.nbox = 2
# use only the end channels for the default baseline fits
imlin.box[1][1] = round(nChan * 0.04) # 4-12%
imlin.box[1][2] = round(nChan * 0.12)
imlin.box[1][3] = round(nChan * 0.81) # 82-89%
imlin.box[1][4] = round(nChan * 0.89)
imlin.order = 0 # polynomial order
print "IMLIN box", imlin.box
imlin.go()
# Run transpose again task on sdgrd file produced by IMLIN
last = cat.last_entry()
trans.inname = last.name
trans.inclass = last.klass
trans.inseq = last.seq
trans.transc = "231"
trans.outdi = DISK_ID
trans.outcl = "baseli"
trans.go()
示例2: time_sort_data
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outcl [as 别名]
def time_sort_data():
"""Time-sort data in AIPS with the UVSRT task."""
print_header("Time-sorting data")
uvsrt = AIPSTask('uvsrt')
uvsrt.userno = AIPS.userno
# -------------------------------------------------------------------------
# UVSRT the data
# -------------------------------------------------------------------------
# sort data to prevent down stream problems
uvsrt.indisk = uvsrt.outdisk = DISK_ID
uvsrt.baddisk[1] = BADDISK
uvsrt.outcl = 'UVSRT'
uvsrt.sort = 'TB'
last = cat.last_entry()
uvsrt.inname = last.name
uvsrt.inclass = last.klass
uvsrt.inseq = last.seq
# will write to entry 1 because input sdf/uv files were removed
uvsrt.go()
nfiles = len(cat)
for dbcon_entry in range(nfiles-1):
cat.zap_entry(-1) # remove the DBCON entries
示例3: pload
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outcl [as 别名]
def pload (filename,aipsname,indisk,outcl,logfiledir='./',doindxr=True):
fitld = AIPSTask ('FITLD')
fitld.datain = str(filename)
fitld.outna = aipsname
fitld.outcl = outcl
fitld.outdisk = indisk
stdout = sys.stdout; sys.stdout = open(logfiledir+aipsname+'.log','a')
fitld.go ()
if doindxr:
uvdata = AIPSUVData (aipsname,'FITS',1,1)
indxr = AIPSTask ('INDXR')
indxr.cparm[1:] = [0,0,0.5,0,0,0,0,0,0,0]
indxr.indata = uvdata
indxr.go()
sys.stdout.close(); sys.stdout = stdout
示例4: average_channels
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outcl [as 别名]
def average_channels(binsize):
if binsize > 1:
print "Averaging ", binsize, " Spectral Channels"
else:
print "Not Averaging Spectral Channels"
return
avspc = AIPSTask("avspc")
last = cat.last_entry()
spectra = cat.get_uv(last)
nChan = round(spectra.header.naxis[2])
print spectra.header.naxis, nChan
# now average channels to reduce the image plane data volumn
avspc.indisk = avspc.outdisk = DISK_ID
avspc.outclass = ""
avspc.inname = last.name
avspc.inclass = last.klass
avspc.inseq = last.seq
avspc.channel = binsize
avspc.ichansel[1][1] = 1
avspc.ichansel[2][1] = nChan
avspc.ichansel[3][1] = 1
avspc.avoption = "SUBS"
avspc.outcl = "avg"
avspc.go()
# now have fewer channels, with broader frequencies
spectra.header.naxis[2] = round(nChan / binsize) # write back to header
print "naxis", spectra.header.naxis
print "cdelt", spectra.header.cdelt
dNu = spectra.header.cdelt[2]
dNu = binsize * dNu # write back to header !!!
print "cdelt", spectra.header.cdelt, "dNu", dNu, "binsize", binsize
refChan = spectra.header.crpix[2]
print "refChan", refChan, "crpix", spectra.header.crpix
refChan = refChan / binsize # write back to header !!!
print "refChan", refChan, "crpix", spectra.header.crpix
return
示例5:
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outcl [as 别名]
fittp.inseq=AIPSCat()[mydisk][-1].seq
outimage = os.path.splitext(myfiles[0])[0]+'_cont.fits'
if os.path.exists(outimage):
os.remove(outimage)
print 'Removed existing file to make room for new one :',outimage
fittp.dataout='PWD:'+outimage
fittp.go()
#Run trans task on sdgrd file to prepare for the Moment map
trans.indisk=mydisk
trans.outdisk=mydisk
trans.inname=AIPSCat()[mydisk][-1].name
trans.inclass='SDGRD'
trans.inseq=1
trans.transc= '312'
trans.outcl='312'
trans.go()
#Run imlin task on trans file
#remove a spectral baseline. Output image is in Freq-RA-Dec order
#(Transcod 312)
imlin.indisk=mydisk
imlin.outdisk=mydisk
imlin.outcl='IMLIN'
imlin.inname=AIPSCat()[mydisk][-1].name
imlin.inclass=AIPSCat()[mydisk][-1].klass
imlin.inseq=AIPSCat()[mydisk][-1].seq
imlin.nbox=2
# use only the end channels for the default fits
imlin.box[1][1]=round(nChan*0.05)
imlin.box[1][2]=round(nChan*0.1)
示例6: dbcon
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outcl [as 别名]
#.........这里部分代码省略.........
for iii in range(0,nObjects):
if (allObjects[iii] == spectra.header.object):
notFound = False
# if not in the list add to list and increment count
if (notFound):
allObjects[nObjects] = spectra.header.object
nObjects = nObjects+1
spectra.zap()
#print nObjects,' Object(s) Observed: ', allObjects
objectName = allObjects[0]
for iii in range(1,nObjects):
if len(allObjects[iii]) > 0:
objectName = objectName + '+' + allObjects[iii]
print nObjects,' Object(s) Observed: ', objectName
if nObjects > 2:
objectName = allObjects[0] + '+' + str( nObjects-1)
# Extract the observations summary
spectra = AIPSUVData(AIPSCat()[mydisk][-1].name, AIPSCat()[mydisk][-1].klass, mydisk, AIPSCat()[mydisk][-1].seq)
# Read parameters passed inside the spectra data header
nChan = round(spectra.header.naxis[2])
cellsize = round(spectra.header.cdelt[4] * 3600.)
refChan = spectra.header.crpix[2]
imxSize = 2*round(spectra.header.crpix[3]/1.5 )
imySize = 2*round(spectra.header.crpix[4]/1.5 )
raDeg = spectra.header.crval[3]
decDeg = spectra.header.crval[4]
nuRef = spectra.header.crval[2]
dNu = spectra.header.cdelt[2]
print "Ra,Dec:", raDeg, decDeg, "Image:", imxSize, imySize, cellsize,
#print spectra.header
#now free up slot 0
image = WizAIPSImage(AIPSCat()[mydisk][0].name, \
AIPSCat()[mydisk][0].klass, \
mydisk, AIPSCat()[mydisk][0].seq)
image.zap()
# sort data to prevent down stream probelms
uvsrt.indisk=mydisk
uvsrt.outdisk=mydisk
uvsrt.baddisk[1]=baddisk
uvsrt.outcl='UVSRT'
uvsrt.sort='TB'
uvsrt.inname=AIPSCat()[mydisk][-1].name
if kount < 2:
uvsrt.inclass=AIPSCat()[mydisk][-1].klass
uvsrt.inseq=kount
else:
uvsrt.inclass='DBCON'
uvsrt.inseq=kount - 1
uvsrt.go()
# now clean up the last of the input files
spectra.zap()
## and write the last thing now in the catalog to disk
fittp.indisk=mydisk
fittp.inname=AIPSCat()[mydisk][-1].name
fittp.inclass=AIPSCat()[mydisk][-1].klass
fittp.inseq=AIPSCat()[mydisk][-1].seq
outName = os.path.splitext(sdf_files[0])[0]
# Trim out the source name
iUnder = outName.find("_")
if iUnder > 0:
outName = outName[iUnder+1:]
# Trim out the beam number
iUnder = outName.find("_")
if iUnder > 0:
outName = outName[iUnder+1:]
# Trim out the first scan number
iUnder = outName.find("_")
if iUnder > 0:
outName = outName[iUnder+1:]
# Trim out the sampler number
iUnder = outName.rfind("_")
if iUnder > 0:
outName = outName[0:iUnder]
#Now prepend the objects
lObjectName = len(objectName)
if lObjectName > 40:
objectName = objectName[:40]
outimage = objectName+'_'+outName+'_dbcon.fits'
if os.path.exists(outimage):
os.remove(outimage)
print 'Removed existing file to make room for new one :',outimage
fittp.dataout='PWD:'+outimage
fittp.go()
if keeptempfiles != '1':
[os.unlink(xx) for xx in sdf_files]
if os.path.isdir('summary'):
[os.unlink('summary/'+xx) for xx in os.listdir('summary')]
os.rmdir('summary')
示例7: N
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outcl [as 别名]
#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'
comb.in2class='11'