当前位置: 首页>>代码示例>>Python>>正文


Python AIPSTask.sort方法代码示例

本文整理汇总了Python中AIPSTask.AIPSTask.sort方法的典型用法代码示例。如果您正苦于以下问题:Python AIPSTask.sort方法的具体用法?Python AIPSTask.sort怎么用?Python AIPSTask.sort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AIPSTask.AIPSTask的用法示例。


在下文中一共展示了AIPSTask.sort方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: time_sort_data

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import sort [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
开发者ID:nrao,项目名称:gbt-pipeline,代码行数:31,代码来源:load.py

示例2: runmsort

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import sort [as 别名]
def runmsort(indata):
	print 'Running MSORT.'
	msort = AIPSTask('MSORT')
	msort.indata = indata
	msort.outdata = indata
	msort.sort = 'TB'
	msort.go()
开发者ID:h-ramp,项目名称:pipeline,代码行数:9,代码来源:eMERLIN_tasks.py

示例3: runuvsrt

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import sort [as 别名]
def runuvsrt(datafile, inname, indisk, thisdir):
	uvsrt = AIPSTask('UVSRT')
	klass = datafile.klass
	uvsrt.indata = datafile
	uvsrt.outdata = AIPSUVData(datafile.name,'UVSRT',indisk,datafile.seq)
	uvsrt.sort = 'TB'
	uvsrt.go()
	datafile.zap()
	datafile = AIPSUVData(inname,'UVSRT',indisk,thisdir)
	datafile.rename(inname,klass,thisdir)
开发者ID:h-ramp,项目名称:pipeline,代码行数:12,代码来源:eMERLIN_tasks.py

示例4: len

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import sort [as 别名]
        uvdata2.header.update()
        uvdata.rename(name="COMBO", klass="UV", seq=0)
    if len(uvname) > 1:
        dbapp = AIPSTask("DBAPP")
        uvdata = AIPSUVData("COMBO", "UV", indisk, 1)
        dbapp.inname = "COMBO"
        dbapp.inclass = "UV"
        dbapp.indisk = indisk
        dbapp.inseq = 2
        dbapp.in2seq = len(uvname)
        dbapp.outdata = uvdata
        dbapp.outdisk = indisk
        dbapp.go()

    uvsrt = AIPSTask("UVSRT")
    uvsrt.sort = "TB"
    uvsrt.indata = uvdata
    uvsrt.outdata = uvdata
    uvsrt.outdisk = indisk
    uvsrt.go()

    uvdata.zap_table("CL", 1)
    indxr = AIPSTask("INDXR")
    indxr.indata = uvdata
    indxr.cparm[1] = 360
    indxr.cparm[2] = 360
    indxr.cparm[3] = 0.25
    indxr.go()

    multi = AIPSTask("MULTI")
    multi.indata = uvdata
开发者ID:jradcliffe5,项目名称:multi_self_cal,代码行数:33,代码来源:multi_source_self_cal_v1.2.py

示例5: len

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import sort [as 别名]
			uvdata2.header.update()
			uvdata.rename(name='COMBO',klass='UV', seq=0)
	if len(uvname) > 1:
		dbapp = AIPSTask('DBAPP')
		uvdata = AIPSUVData('COMBO','UV',2,1)
		dbapp.inname = 'COMBO'
		dbapp.inclass = 'UV'
		dbapp.indisk = 2
		dbapp.inseq = 2
		dbapp.in2seq = len(uvname)
		dbapp.outdata = uvdata
		dbapp.outdisk = 2
		dbapp.go()

	uvsrt = AIPSTask('UVSRT')
	uvsrt.sort = 'TB'
	uvsrt.indata = uvdata
	uvsrt.outdata = uvdata
	uvsrt.outdisk = 2
	uvsrt.go()

	uvdata.zap_table('CL',1)
	indxr = AIPSTask('INDXR')
	indxr.indata = uvdata
	indxr.cparm[1]=360
	indxr.cparm[2] = 360
	indxr.cparm[3] = 0.25
	indxr.go()

	multi = AIPSTask('MULTI') 
	multi.indata = uvdata
开发者ID:jradcliffe5,项目名称:multi_self_cal,代码行数:33,代码来源:multi_source_self_cal.py

示例6: dbcon

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import sort [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')
开发者ID:jfoster17,项目名称:gbt-pipeline,代码行数:104,代码来源:make_sdf_and_dbcon.py


注:本文中的AIPSTask.AIPSTask.sort方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。