本文整理汇总了Python中AIPSTask.AIPSTask.outdisk方法的典型用法代码示例。如果您正苦于以下问题:Python AIPSTask.outdisk方法的具体用法?Python AIPSTask.outdisk怎么用?Python AIPSTask.outdisk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AIPSTask.AIPSTask
的用法示例。
在下文中一共展示了AIPSTask.outdisk方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: remove_continuum
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outdisk [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: load_into_aips
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outdisk [as 别名]
def load_into_aips(myfiles):
"""Load files into AIPS with UVLOD task."""
uvlod = AIPSTask('uvlod')
uvlod.outdisk = DISK_ID # write all input data to a select disk
uvlod.userno = AIPS.userno
first_file = True # to help determine center freq to use
for this_file in myfiles: # input all AIPS single dish FITS files
print 'Adding {0} to AIPS.'.format(this_file)
uvlod.datain = 'PWD:' + this_file
uvlod.go()
# get the center frequency of the sdf file that was just loaded
last = cat.last_entry()
spectra = cat.get_uv(last)
center_freq = spectra.header.crval[2]
# if this is the first file loaded, look for
# the same frequency in the next ones
if first_file:
expected_freq = center_freq
first_file = False
# if frequency of sdf file just loaded and 1st file differ by
# more than 100 kHz, do not use the current file
if abs(expected_freq - center_freq) > 1e5:
print 'Frequencies differ: {0} != {1}'.format(center_freq, expected_freq)
print ' Rejecting {0}'.format(this_file)
spectra.zap()
示例3: runsplat
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outdisk [as 别名]
def runsplat(uvdata, outchan, tint, sbandl, sbandu, smootha, smoothb, smoothc, indisk):
splat = AIPSTask('SPLAT')
splat.indata = uvdata
splat.outname = uvdata.name
splat.outdisk = indisk
splat.outclass = 'SPLAT'
splat.outseq = uvdata.seq
splat.solint = 0
if outchan != -1 :
aparm1 = 3
splat.channel = uvdata.header['naxis'][2] / outchan
splat.chinc = uvdata.header['naxis'][2] / outchan
if tint != -1 :
splat.solint = tint / 60
splat.bif = sbandl # SBLANL -- Lower sub-band for extraction
splat.eif = sbandu # SBANDU - Upper sub-band for extraction
splat.douvcomp = -1
splat.aparm[1] = 3
splat.aparm[2] = 1
# Smoothing options!?!?
splat.smooth[1] = smootha # 1 = hanning default
splat.smooth[2] = smoothb # 4 = hanning default
splat.smooth[3] = smoothc # 1 = hanning default
splat.flagver = 0
splat.go()
示例4: runfitld
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outdisk [as 别名]
def runfitld(datain, indisk, thisdir):
fitld = AIPSTask('FITLD')
fitld.datain = datain # "datain" is correct here (use "indata" in most other places)
fitld.outdisk = indisk
fitld.digicor = -1
fitld.douvcomp = -1
fitld.clint = 8/60
fitld.bif = 1
fitld.eif = 0
fitld.outdata = AIPSUVData('TMP','UVDATA',indisk,thisdir)
fitld.go()
示例5: pload
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outdisk [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
示例6: load_into_aips
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outdisk [as 别名]
def load_into_aips(myfiles):
"""Load files into AIPS with UVLOD task."""
# mandl = AIPSTask('mandl')
# mandl.outdisk = DISK_ID
# mandl.go()
print_header("Loading data into AIPS")
uvlod = AIPSTask('uvlod')
uvlod.outdisk = DISK_ID # write all input data to a select disk
uvlod.userno = AIPS.userno
first_file = True # to help determine center freq to use
for this_file in myfiles: # input all AIPS single dish FITS files
if not os.path.exists(this_file):
print 'WARNING: can not find file: {0}'.format(this_file)
continue
print 'Adding {0} to AIPS.'.format(this_file)
# AIPS has problems with long filenames so we create a symlink to a short filename
if os.path.exists(tmpfn):
os.unlink(tmpfn)
os.symlink(this_file, tmpfn)
uvlod.datain = 'PWD:' + tmpfn
uvlod.go()
os.unlink(tmpfn) # remove the temporary symlink
# get the center frequency of the sdf file that was just loaded
last = cat.last_entry()
spectra = cat.get_uv(last)
center_freq = spectra.header.crval[2]
# if this is the first file loaded, look for
# the same frequency in the next ones
if first_file:
expected_freq = center_freq
first_file = False
# if frequency of sdf file just loaded and 1st file differ by
# more than 100 kHz, do not use the current file
if abs(expected_freq - center_freq) > 1e5:
print 'Frequencies differ: {0} != {1}'.format(center_freq, expected_freq)
print ' Rejecting {0}'.format(this_file)
spectra.zap()
示例7: make_average_map
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outdisk [as 别名]
def make_average_map(restfreq, uniqueid):
print_header("Making average map")
sqash = AIPSTask("sqash")
# squash the frequency axis to make a continuum image
sqash.indisk = DISK_ID
sqash.outdisk = DISK_ID
last = cat.last_entry()
sqash.inname = last.name
sqash.inclass = last.klass
sqash.inseq = last.seq
sqash.bdrop = 3 # squash frequency axis
sqash.go()
outcont = write_average_map(restfreq, uniqueid)
return outcont
示例8: runimagr
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outdisk [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()
示例9:
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outdisk [as 别名]
print 'Source Channel :',lineChan,'+/-',lineWidthChan
#now calcuate channels from channel width
bChan = lineChan - lineWidthChan
eChan = lineChan + lineWidthChan
if bChan < 1:
bChan = 1
if bChan > nChan:
bChan = 1
if eChan > nChan:
eChan = nChan
if eChan < 1:
eChan = nChan
#Run momnt task
momnt.indisk=mydisk
momnt.outdisk=mydisk
momnt.inname=AIPSCat()[mydisk][-1].name
momnt.inclass='IMLIN'
momnt.inseq=1
momnt.icut=-10000.
momnt.flux=-.00001
momnt.outclass='0'
momnt.cellsize[1] = 0
momnt.cellsize[2] = 0
momnt.blc[1]=bChan
momnt.blc[2]=0
momnt.blc[3]=0
momnt.trc[1]=eChan
momnt.trc[2]=0
momnt.trc[3]=0
momnt.go()
示例10: __init__
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outdisk [as 别名]
#.........这里部分代码省略.........
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
apcal.timer = self.args["time"]
apcal.tyver = 1
apcal.gcver = 1
apcal.go()
示例11: len
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outdisk [as 别名]
uvlod=AIPSTask('uvlod') # Create structures for AIPS tasks
sdgrd=AIPSTask('sdgrd')
fittp=AIPSTask('fittp')
dbcon=AIPSTask('dbcon')
trans=AIPSTask('trans')
imlin=AIPSTask('imlin')
avspc=AIPSTask('avspc')
subim=AIPSTask('subim')
sqash=AIPSTask('sqash')
for thisFile in myfiles: # input all AIPS single dish FITS files
print thisFile
uvlod.datain='PWD:'+thisFile
print uvlod.datain
uvlod.outdisk=mydisk
uvlod.go()
if len(myfiles) > 1: # if more than 1 file DBCON them
# always do first 2
dbcon.indisk=mydisk
dbcon.outdisk=mydisk
dbcon.inname = AIPSCat()[mydisk][0].name
dbcon.inclass = AIPSCat()[mydisk][0].klass
dbcon.inseq = AIPSCat()[mydisk][0].seq
dbcon.in2name = AIPSCat()[mydisk][1].name
dbcon.in2class = AIPSCat()[mydisk][1].klass
dbcon.in2seq = AIPSCat()[mydisk][1].seq
dbcon.reweight[1] = 0
dbcon.reweight[2] = 0
示例12: round
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outdisk [as 别名]
print "Ra,Dec:", raDeg, decDeg, "Image:", imxSize, imySize, cellsize,
#print spectra.header
# set number of channels to average
if inNAve > 0:
nAverage = inNAve
else:
nAverage = 3
if nAverage > 1:
print 'Averaging ',nAverage,' Spectral Channels'
else:
print 'Not Averaging Spectral Channels'
# now average channels to reduce the image plane data volumn
avspc.indisk=mydisk
avspc.outdisk=mydisk
avspc.outclass=''
avspc.inname=AIPSCat()[mydisk][0].name
avspc.inclass=AIPSCat()[mydisk][0].klass
avspc.inseq=AIPSCat()[mydisk][0].seq
avspc.channel=nAverage
avspc.ichansel[1][1] = 1
avspc.ichansel[2][1] = nChan
avspc.ichansel[3][1] = 1
avspc.avoption='SUBS'
avspc.go()
#now have fewer channels, with broader frequencies
nChan = round(nChan/nAverage)
dNu = nAverage*dNu
refChan = refChan/nAverage
示例13: AIPSCat
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outdisk [as 别名]
if doload == 1:
AIPSCat().zap()
uvname = [] # HDF names of files
for file in listdir("./"):
if file.startswith(filestart):
uvdataname = str(file) # Load the UV data file & image
# uvdataname = uvdataname[:-1]
fitld = AIPSTask("FITLD")
fitld.datain = "PWD:" + uvdataname
fitld.ncount = 1
fitld.doconcat = 1
fitld.clint = 0
fitld.wtthresh = 0
fitld.outdisk = indisk
fitld.digicor = -1
fitld.go()
if file.endswith(fileend):
uvname.append(uvdataname[0:8])
# makes a list of file prefixes to be used in multi self cal, all data is loaded.
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
示例14: dbcon
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outdisk [as 别名]
def dbcon(sys):
argc = len(sys.argv)
if argc < 3:
print ''
print 'dbcon: Combine all observations into a single dish fits file'
print 'usage: doImage dbcon.py <aipsNumber> <feeds>'
print ' <average> <channels> <display> <rmsflag> <verbose> <baseline-subtract>'
print ' <keeptempfiles> <spectra File 1> [<spectra File n>]'
print 'where <aipsNumber> Your *PIPELINE* AIPS number (should always be the same)'
print ' <spectra File 1> One or more calibrated spectra files (*.fits)'
print ' Combined spectra are placed in catalog slot 1'
print ''
quit()
feeds = sys.argv[2].split(',')
average = sys.argv[3]
channels = sys.argv[4]
display_idlToSdfits = sys.argv[5]
idlToSdfits_rms_flag = sys.argv[6]
verbose = sys.argv[7]
idlToSdfits_baseline_subtract = sys.argv[8]
keeptempfiles = sys.argv[9]
imfiles = sys.argv[10:]
if not imfiles:
return
sdf_files = []
for feed in feeds:
files = []
for xx in imfiles:
if 'feed{num}'.format(num=feed) in xx:
files.append(xx)
if not files:
continue
sdf = run_idlToSdfits(files, average, channels, display_idlToSdfits,
idlToSdfits_rms_flag, verbose, idlToSdfits_baseline_subtract)
sdf_files.append(sdf)
AIPS.userno=int(sys.argv[1]) # retrieve AIPS pipeline user number
mydisk=2 # choose a good default work disk
baddisk=1 # list a disk to avoid (0==no avoidance)
AIPSCat().zap() # empty the catalog
uvlod=AIPSTask('uvlod') # Create structures for AIPS tasks
uvlod.outdisk=mydisk # write all input data to a select disk
fittp=AIPSTask('fittp')
dbcon=AIPSTask('dbcon')
uvsrt=AIPSTask('uvsrt')
mandl=AIPSTask('mandl')
# Need a temporary small file to reserve slot 1
mandl.outdisk = mydisk
# create an image that will be deleted at end
mandl.go()
#
kount = 0 # init count of similar input files
for thisFile in sdf_files: # input all AIPS single dish FITS files
uvlod.datain='PWD:'+thisFile
print uvlod.datain
uvlod.outdisk=mydisk
uvlod.go()
spectra = AIPSUVData(AIPSCat()[mydisk][-1].name, AIPSCat()[mydisk][-1].klass, mydisk, AIPSCat()[mydisk][-1].seq)
nuRef = spectra.header.crval[2]
if kount == 0:
firstNu = nuRef
if ((firstNu - nuRef) < -1.E5) or ((firstNu - nuRef) > 1.E5):
print 'Frequencies differ: ',nuRef,' != ',firstNu
spectra.zap()
else:
kount = kount+1
spectra = AIPSUVData(AIPSCat()[mydisk][-1].name, AIPSCat()[mydisk][-1].klass, mydisk, AIPSCat()[mydisk][-1].seq)
# prepare to accumulate source names
allObjects = ["","","","","","","","","","","","","","","","","","","",
"","","","","","","","","","","","","","","","","","",""]
allObjects[0] = spectra.header.object
nObjects = 1
if kount > 1: # if more than 1 file DBCON them
# always do first 2
dbcon.indisk=mydisk
dbcon.outdisk=mydisk
dbcon.in2disk=mydisk
dbcon.inname = AIPSCat()[mydisk][1].name
dbcon.inclass = AIPSCat()[mydisk][1].klass
dbcon.inseq = AIPSCat()[mydisk][1].seq
dbcon.in2name = AIPSCat()[mydisk][2].name
dbcon.in2class = AIPSCat()[mydisk][2].klass
dbcon.in2seq = AIPSCat()[mydisk][2].seq
print 'combining 1: ', dbcon.inname, dbcon.inclass, dbcon.inseq
print 'combining 2: ', dbcon.in2name, dbcon.in2class, dbcon.in2seq
dbcon.reweight[1] = 0
#.........这里部分代码省略.........
示例15: AIPSCat
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import outdisk [as 别名]
if doload == 1:
AIPSCat().zap()
uvname = [] #HDF names of files
for file in listdir('./'):
if file.startswith(filestart):
uvdataname = str(file) #Load the UV data file & image
#uvdataname = uvdataname[:-1]
fitld = AIPSTask('FITLD')
fitld.datain = ('PWD:' + uvdataname)
fitld.ncount = 1
fitld.doconcat = 1
fitld.clint = 0
fitld.wtthresh = 0
fitld.outdisk = 2
fitld.digicor = -1
fitld.go()
if file.endswith(fileend):
uvname.append(uvdataname[0:8])
# makes a list of file prefixes to be used in multi self cal, all data is loaded.
for i in range(len(uvname)):
uvdata = AIPSUVData(uvname[i],'SPLAT',2,1) #name the uv file in AIPS
imagedata = AIPSImage(uvname[i],'IIM001',2,1)
nchan = uvdata.header.naxis[2]
imagr = AIPSTask('IMAGR')
imagr.nchav = nchan #use imagr to get a clean model!