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


Python AIPSTask.reweight[2]方法代码示例

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


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

示例1: run_dbcon

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

示例2: len

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import reweight[2] [as 别名]
    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
    dbcon.go()

    # and keep adding in one
    for i in range(2,len(myfiles)):
        # end of cat is always most recent dbcon result
        dbcon.inname = AIPSCat()[mydisk][-1].name
        dbcon.inclass = AIPSCat()[mydisk][-1].klass
        dbcon.inseq = AIPSCat()[mydisk][-1].seq
        dbcon.in2name = AIPSCat()[mydisk][i].name
        dbcon.in2class = AIPSCat()[mydisk][i].klass
        dbcon.in2seq = AIPSCat()[mydisk][i].seq
        dbcon.go()


# Extract the observations summary
开发者ID:jfoster17,项目名称:gbt-pipeline,代码行数:33,代码来源:imageW51.py

示例3: round

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import reweight[2] [as 别名]
#now have fewer channels, with broader frequencies
nChan = round(nChan/nAverage)
dNu = nAverage*dNu
refChan = refChan/nAverage

# Now make an image using the last entry in the catalog
sdgrd.indisk=mydisk
sdgrd.outdisk=mydisk
sdgrd.baddisk[1]=baddisk
sdgrd.inname=AIPSCat()[mydisk][-1].name
sdgrd.inclass=AIPSCat()[mydisk][-1].klass
sdgrd.inseq=AIPSCat()[mydisk][-1].seq
sdgrd.optype='-GLS'
sdgrd.reweight[1] = 0
sdgrd.reweight[2] = -1.E-6
# must break up RA into hours minutes seconds
sdgrd.aparm[1]=math.floor(raDeg/15.)
sdgrd.aparm[2]=math.floor(((raDeg/15.)-sdgrd.aparm[1])*60.)
sdgrd.aparm[3]=round(((((raDeg/15.)-sdgrd.aparm[1])*60.)-sdgrd.aparm[2])*60.)
#now break up degrees, but must preserve sign
decSign = 1.
if decDeg < 0.:
    decSign = -1.
    decDeg = -1. * decDeg

sdgrd.aparm[4]=math.floor(decDeg)
sdgrd.aparm[5]=math.floor((decDeg-sdgrd.aparm[4])*60.)
sdgrd.aparm[6]=round((((decDeg-sdgrd.aparm[4])*60.)-sdgrd.aparm[5])*60.)
#now deal with degrees and/or minutes == 0
if decSign < 0.:
开发者ID:jfoster17,项目名称:gbt-pipeline,代码行数:32,代码来源:mapNH3-50.py

示例4: make_cube

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import reweight[2] [as 别名]
def make_cube(args):

    print_header("Making image cube")

    average_channels(args.average)

    sdgrd = AIPSTask("sdgrd")

    # Now make an image using the last entry in the catalog
    sdgrd.indisk = DISK_ID
    sdgrd.outdisk = DISK_ID
    sdgrd.baddisk[1] = BADDISK
    last = cat.last_entry()
    sdgrd.inname = last.name
    sdgrd.inclass = last.klass
    sdgrd.inseq = last.seq
    sdgrd.optype = "-GLS"
    sdgrd.reweight[1] = 0

    spectra = cat.get_uv(last)
    if "center" in args and args.center:
        raDeg, decDeg = args.center
    else:
        raDeg, decDeg = spectra.header.crval[3], spectra.header.crval[4]

    # must break up RA into hours minutes seconds
    hh, mm, ss = ra_deg2hms(raDeg)
    sdgrd.aparm[1] = hh
    sdgrd.aparm[2] = mm
    sdgrd.aparm[3] = ss

    # now break up degrees, but must preserve sign
    decSign = 1
    if decDeg < 0:
        decSign = -1
        decDeg = -1 * decDeg

    hh, mm, ss = dec_deg2hms(decDeg)
    sdgrd.aparm[4] = hh
    sdgrd.aparm[5] = mm
    sdgrd.aparm[6] = ss

    # deal with degrees and/or minutes == 0
    if decSign < 0.0:
        sdgrd.aparm[4] = -1 * sdgrd.aparm[4]
        if sdgrd.aparm[4] == 0:
            sdgrd.aparm[5] = -1 * sdgrd.aparm[5]
            if sdgrd.aparm[5] == 0:
                sdgrd.aparm[6] = -1 * sdgrd.aparm[6]

    print raDeg, decDeg, "->", sdgrd.aparm[1:7]

    # transfer cellsize
    cellsize = round(spectra.header.cdelt[4] * 3600.0)
    sdgrd.cellsize[1] = sdgrd.cellsize[2] = cellsize

    # sdgrd.xtype=-16         # sync/bessel convolving type
    sdgrd.xtype = -12  # gaussian convolving type

    # sync/bessel function parameters
    if sdgrd.xtype == -16:
        sdgrd.xparm[1] = 3.0 * cellsize
        sdgrd.xparm[2] = 2.5 * cellsize
        sdgrd.xparm[3] = 1.5 * cellsize
        sdgrd.xparm[4] = 2
        sdgrd.reweight[2] = 0.01

    # gaussian parameters
    if sdgrd.xtype == -12:
        sdgrd.xparm[1] = 5.0 * cellsize
        sdgrd.xparm[2] = 1.5 * cellsize  # Parameter sets Gaussian FWHM
        sdgrd.xparm[3] = 2
        sdgrd.xparm[4] = 0
        sdgrd.reweight[2] = -1.0e-6

    # always make a circuluar convolving function
    sdgrd.ytype = sdgrd.xtype

    if "size" in args and args.size:
        imxSize, imySize = args.size
    else:
        imxSize = (2 * round(spectra.header.crpix[3] / 1.95)) + 20
        imySize = (2 * round(spectra.header.crpix[4] / 1.95)) + 20

    print "Ra, Dec          : {0}, {1}".format(raDeg, decDeg)
    print "Image size (X,Y) : {0}, {1}".format(imxSize, imySize)
    print "Cell size        : {0}".format(cellsize)

    sdgrd.imsize[1] = imxSize
    sdgrd.imsize[2] = imySize
    sdgrd.go()

    seqno, restFreqHz = update_header(args)
    outcube = write_image_cube(restFreqHz, args.uniqueid)

    return seqno, restFreqHz, outcube
开发者ID:nrao,项目名称:gbt-pipeline,代码行数:98,代码来源:image.py

示例5: len

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import reweight[2] [as 别名]
    uvlod.go()

if len(myfiles) > 1:
    # must DBCON

    # 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
    dbcon.go()

    # and keep adding in one
    for i in range(2,len(myfiles)):
        # end of cat is always most recent dbcon result
        dbcon.inname = AIPSCat()[mydisk][-1].name
        dbcon.inclass = AIPSCat()[mydisk][-1].klass
        dbcon.inseq = AIPSCat()[mydisk][-1].seq
        dbcon.in2name = AIPSCat()[mydisk][i].name
        dbcon.in2class = AIPSCat()[mydisk][i].klass
        dbcon.in2seq = AIPSCat()[mydisk][i].seq
        dbcon.go()


开发者ID:jfoster17,项目名称:gbt-pipeline,代码行数:30,代码来源:imNH3-11.py

示例6: dbcon

# 需要导入模块: from AIPSTask import AIPSTask [as 别名]
# 或者: from AIPSTask.AIPSTask import reweight[2] [as 别名]

#.........这里部分代码省略.........
        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
        dbcon.reweight[2] = 0
        dbcon.go()
    
        # and keep adding in one
        for i in range(2,kount):
            # end of cat is always most recent dbcon result
            dbcon.inname = AIPSCat()[mydisk][-1].name
            dbcon.inclass = 'DBCON'
            dbcon.inseq = i - 1
            dbcon.in2name = AIPSCat()[mydisk][i+1].name
            dbcon.in2class = AIPSCat()[mydisk][i+1].klass
            dbcon.in2seq = AIPSCat()[mydisk][i+1].seq
            print 'combining 1: ', dbcon.inname, dbcon.inclass, dbcon.inseq
            print 'combining 2: ', dbcon.in2name, dbcon.in2class, dbcon.in2seq
            #prepare to zap revious dbconned file
            dbcon.go()
            # now zap previous big input file 
            spectra = AIPSUVData(AIPSCat()[mydisk][-1].name, 'DBCON',mydisk, i-1)
            spectra.zap()
    
        # remove input files, must remove them in reverse to presurve catalog order
        for i in range(1,kount+1):
            j = kount+1-i
            aname = AIPSCat()[mydisk][j].name
            aclass = AIPSCat()[mydisk][j].klass
            aseq = AIPSCat()[mydisk][j].seq
            # print i, j, aname, aclass, aseq
            spectra = AIPSUVData( aname, aclass, mydisk, aseq)
            notFound = True
            # check if this object is already in the list
            for iii in range(0,nObjects):
                if (allObjects[iii] == spectra.header.object):
                    notFound = False
开发者ID:jfoster17,项目名称:gbt-pipeline,代码行数:70,代码来源:make_sdf_and_dbcon.py


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