本文整理汇总了Python中AIPSTask.AIPSTask.userno方法的典型用法代码示例。如果您正苦于以下问题:Python AIPSTask.userno方法的具体用法?Python AIPSTask.userno怎么用?Python AIPSTask.userno使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AIPSTask.AIPSTask
的用法示例。
在下文中一共展示了AIPSTask.userno方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_dbcon
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import userno [as 别名]
def run_dbcon(entryA, entryB):
"""Combine the data in AIPS with the DBCON task"""
dbcon = AIPSTask('dbcon')
# always do firs
dbcon.indisk = dbcon.outdisk = dbcon.in2disk = DISK_ID
dbcon.userno = AIPS.userno
file1 = cat.get_entry(entryA)
dbcon.inname = file1.name
dbcon.inclass = file1.klass
dbcon.inseq = file1.seq
file2 = cat.get_entry(entryB)
dbcon.in2name = file2.name
dbcon.in2class = file2.klass
dbcon.in2seq = file2.seq
dbcon.reweight[1] = 0
dbcon.reweight[2] = 0
print 'combining 1: ', dbcon.inname, dbcon.inclass, dbcon.inseq
print 'combining 2: ', dbcon.in2name, dbcon.in2class, dbcon.in2seq
dbcon.go()
示例2: load_into_aips
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import userno [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: time_sort_data
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import userno [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
示例4: load_into_aips
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import userno [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: AIPSImage
# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import userno [as 别名]
from AIPS import AIPS
from AIPSTask import AIPSTask
from AIPSData import AIPSImage
AIPS.userno = 1999
image = AIPSImage('MANDELBROT', 'MANDL', 1, 1)
if image.exists():
image.zap()
image2 = AIPSImage('MANDELBROT', 'MANDL', 1, 1, 2)
if image2.exists():
image2.zap()
mandl = AIPSTask('mandl')
mandl.userno = 2
mandl.outdata = image
mandl.imsize[1:] = [ 512, 512 ]
mandl.go()
try:
assert(not image.exists())
assert(image2.exists())
AIPS.userno = 2
image = AIPSImage('MANDELBROT', 'MANDL', 1, 1)
assert(image.exists())
finally:
image2.zap()