예제 #1
0
파일: cleog.py 프로젝트: xshi/dhad
def check_decfile_double(opts, label, toppath, decfile, headername, modename):
    headerfile = os.path.join(toppath, 'tag_fragments', headername)
    modenames = modename.split('__')
    fragfile = os.path.join(toppath, 'tag_fragments', modenames[0])
    
    try:
        frag = open(fragfile, 'r')
    except IOError:
        tag_fragments(opts, [label])
        frag = open(fragfile, 'r')
         
    f = UserFile()
    fin = open(headerfile, 'r')
    f.extend(fin.readlines())
    f.extend(frag.readlines())
    fin.close()
    frag.close()

    fragfile2 = os.path.join(toppath, 'tag_fragments', modenames[1])
    frag2 = open(fragfile2, 'r')
    f.extend(frag2.readlines())
    frag2.close()
    
    f.append('End\n')
    verbose = opts.verbose
    if opts.test:
        verbose = 1
    
    f.output(decfile, verbose=verbose)
    frag2.close()
예제 #2
0
def check_decfile_double(opts, label, toppath, decfile, headername, modename):
    headerfile = os.path.join(toppath, 'tag_fragments', headername)
    modenames = modename.split('__')
    fragfile = os.path.join(toppath, 'tag_fragments', modenames[0])

    try:
        frag = open(fragfile, 'r')
    except IOError:
        tag_fragments(opts, [label])
        frag = open(fragfile, 'r')

    f = UserFile()
    fin = open(headerfile, 'r')
    f.extend(fin.readlines())
    f.extend(frag.readlines())
    fin.close()
    frag.close()

    fragfile2 = os.path.join(toppath, 'tag_fragments', modenames[1])
    frag2 = open(fragfile2, 'r')
    f.extend(frag2.readlines())
    frag2.close()

    f.append('End\n')
    verbose = opts.verbose
    if opts.test:
        verbose = 1

    f.output(decfile, verbose=verbose)
    frag2.close()
예제 #3
0
파일: brs.py 프로젝트: zhixing1996/dhad
def create_brsfile_three(args):
    comname = '_'.join(args)
    comname = comname.replace('.', '_')

    brsfile = set_file(extbase=attr.srcmnfpath, comname=comname, ext='mnf')
    brs = UserFile()
    header = r'''
set def
del 0
dep nmodes = 9

'''

    brs.append(header)

    label_0, content_0 = get_brs(args[0])

    label_1, content_1 = get_brs(args[2])
    label_2, content_2 = get_brs(args[1])
        
    brs.extend(content_0)
    brs.extend(content_1)

    hmin = 0.4
    hmax = 1.6
    xleft = 0.45
    textsize = 0.45

    if args[0] == 'pdg2010':
        hmin = 0.85
        hmax = 1.10
        xleft = 0.86
        
    trunk = r'''
exec colors
dep yoffset = -0.15
exec pdgCompareMany %s %s white mustard burgundy "%s" 4 "%s" 8

! Add another set of data points
rename 1 11
rename 2 12

''' % (hmin, hmax, label_0, label_1)
 
    brs.append(trunk)
    brs.extend(content_0)
    brs.extend(content_2)
        
    footer = r'''
dep yoffset = 0.15
exec pdgCompareMany %s %s white mustard burgundy "%s" 3 "%s" 6.5

over 11 -60/lavender
over 12 -60/lavender

key
1
new
1000
%s
13 17.5 0.4 0 left cm -2000 lavender 3 0.01 black

draw line 1 black 1 plot
%s, -3.5
%s, -3.5


! xleft is the x position of the mode label in plot units
dep xleft = %s
dep textsize = %s

exec pdgCompareComment 1 xleft textsize "'K^-![p]^+'"
exec pdgCompareComment 2 xleft textsize "'K^-![p]^+![p]^0!'"
exec pdgCompareComment 3 xleft textsize "'K^-![p]^+![p]^-![p]^+!'"
exec pdgCompareComment 4 xleft textsize "'K^-![p]^+![p]^+!'"
exec pdgCompareComment 5 xleft textsize "'K^-![p]^+![p]^+![p]^0!'"
exec pdgCompareComment 6 xleft textsize "'K^0?S![p]^+!'"
exec pdgCompareComment 7 xleft textsize "'K^0?S![p]^+![p]^0!'"
exec pdgCompareComment 8 xleft textsize "'K^0?S![p]^+![p]^-![p]^+!'"
exec pdgCompareComment 9 xleft textsize "'K^-!K^+![p]^+!'"

hard epost
'''  % (hmin, hmax, label_0, label_2, label_1, hmin, hmax, xleft, textsize)
    brs.append(footer)
    brs.output(brsfile)
    return brsfile