本文整理汇总了Python中AIPSTask.AIPSTask.datain方法的典型用法代码示例。如果您正苦于以下问题:Python AIPSTask.datain方法的具体用法?Python AIPSTask.datain怎么用?Python AIPSTask.datain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AIPSTask.AIPSTask
的用法示例。
在下文中一共展示了AIPSTask.datain方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load_into_aips
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import datain [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()
示例2: runfitld
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import datain [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()
示例3: pload
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import datain [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: load_into_aips
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import datain [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()
示例5: assert
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import datain [as 别名]
import os
import urllib
AIPS.userno = 1999
# Download a smallish FITS file from the EVN archive.
url = 'http://archive.jive.nl/exp/N03L1_030225/fits/n03l1_1_1.IDI1'
file = '/tmp/' + os.path.basename(url)
if not os.path.isfile(file):
urllib.urlretrieve(url, file)
assert(os.path.isfile(file))
name = os.path.basename(url).split('_')[0].upper()
uvdata = AIPSUVData(name, 'UVDATA', 1, 1)
if uvdata.exists():
uvdata.zap()
fitld = AIPSTask('fitld')
fitld.datain = file
fitld.outdata = uvdata
fitld.douvcomp = 0
fitld.msgkill = 2
fitld.go()
uvdata = WizAIPSUVData(name, 'UVDATA', 1, 1, AIPS.userno)
for vis in uvdata:
vis.visibility[0][0][0][2] = 1.234
vis.update()
continue
示例6: __init__
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import datain [as 别名]
def __init__(self, iterNum, **args):
self.iterNum = iterNum
self.args = args
AIPS.userno=self.args["user"]#username
snInit = 0
clInit = 1
AIPSTask.msgkill = -5 #makes the output less verbose
uvdata = AIPSUVData(self.args["name"], 'UVDATA', 1, self.args["inseq"])
cleaninseq = iterNum
imageClean = AIPSImage(self.args["name"], 'ICL001', 1, cleaninseq)
imageDirty = AIPSImage(self.args["name"], 'IBM001', 1, cleaninseq)
imageCleanSC = AIPSImage(self.args["source"], 'ICL001', 1, 1)
imageDirtySC = AIPSImage(self.args["source"], 'IBM001', 1, 1)
flag = AIPSUVData(self.args["name"], 'TASAV', 1, 100)
if uvdata.exists() and iterNum == 1:
print("Data is already present")
ans1 = raw_input('\033[33mDo you want to zap the data (yes/no)? \033[0m').upper()
if ans1 == 'YES':
print("Zapping data and reloading.")
uvdata.clrstat()
uvdata.zap()
fitld = AIPSTask('fitld')
fitld.datain = self.args["dataPath"]
fitld.outname = self.args["name"]
fitld.outseq = self.args["inseq"]
fitld.ncount = self.args["fileCount"]
fitld.doconcat = 1
#fitldFL = AIPSTask("FITLD")
#fitldFL.datain = args["flagPath"]
#fitldFL.outname = self.args["name"]
#fitldFL.outseq = 100
#fitldFL.ncount = 1
#fitldFL.go()
snVers = 0
clVers = 1
fitld.go()
else:
ans2 = raw_input('\033[33mDo you want to zap the tables and images(yes/no)? \033[0m').upper()
if ans2 == 'YES':
print("Zapping tables/images.")
uvdata.clrstat()
uvdata.zap_table('SN', -1)
uvdata.zap_table('FL', -1)
tablesToDelete = 0
for i in uvdata.tables:
if i[1] == 'AIPS CL' and i[0]>tablesToDelete:
tablesToDelete = i[0]
for k in range(tablesToDelete,1,-1):
uvdata.zap_table('CL', k)
snVers = 0
clVers = 1
else:
print("Going direclty to imaging.")
"""
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]
"""
clVers = int(raw_input("What cl table would you like to use? "))
loc = location_finder.Location_finder(clVers, **self.args)
sys.exit()
elif not uvdata.exists():
print("Loading data")
fitld = AIPSTask('fitld')
fitld.datain = self.args["dataPath"]
fitld.outname = self.args["name"]
fitld.outseq = self.args["inseq"]
fitld.ncount = self.args["fileCount"]
fitld.doconcat = 1
fitld.go()
#fitldFL = AIPSTask("FITLD")
#fitldFL.datain = args["flagPath"]
#fitldFL.outname = self.args["name"]
#fitldFL.outseq = 100
#fitldFL.ncount = 1
#fitldFL.go()
snVers = 0
clVers = 1
else:
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.")
#.........这里部分代码省略.........
示例7: AIPSCat
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import datain [as 别名]
AIPSCat().zap() # empty the catalog
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
示例8: str
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import datain [as 别名]
tasavname = str(file)
print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
print "------------------------------------------------------------"
print " Loading your uv data file "
print "------------------------------------------------------------"
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)
示例9: str
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import datain [as 别名]
tasavname = str(file)
print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
print "------------------------------------------------------------"
print " Loading your uv data file "
print "------------------------------------------------------------"
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
示例10: AIPSList
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import datain [as 别名]
from AIPS import AIPS
from AIPSTask import AIPSTask, AIPSList
from AIPSData import AIPSUVData, AIPSImage
time = AIPSList([1,8,18,30, 1,18,30,0])
AIPS.userno = 1010
uvdata = AIPSUVData('gr035', 'UVDATA', 1, 1)
if uvdata.exists():
uvdata.zap()
fitld = AIPSTask('FITLD')
fitld.datain = 'PWD:gr035.sb5.idi'
fitld.outname = 'gr035'
fitld.outclass = 'UVDATA'
fitld.ncount = 6
fitld.doconcat = 1
#fitld.timer = time
fitld.go()
fring = AIPSTask('FRING')
fring.indata = uvdata
fring.calsour = AIPSList(['J1232-0224'])
fring.docalib = 1
fring.gainuse = 1
fring.timer = time
fring.go()
clcal = AIPSTask('clcal')
clcal.calsour = AIPSList(['J1232-0224'])
clcal.indata = uvdata
clcal.timer = time
clcal.go()
示例11: dbcon
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import datain [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
#.........这里部分代码省略.........