コード例 #1
0
ファイル: ths.py プロジェクト: zhixing1996/dhad
def vary_argus_single(opts, tabname):
    tab = THSTable()
    tabprefix = 'dir_818ipbv12'
    tab.column_append_from_dict('Mode', 'fname,fnamebar')
    titles = ['argus_low', 'std', 'argus_high']
    tab.column_append_from_files(titles[0], 'N1,N2', fitbase,
                                 tabprefix+'/argus_low', 'd', 's', 'txt')
    tab.column_append_from_files(titles[1], 'N1,N2', fitbase, tabprefix,  
                                 'd', 's', 'txt')
    tab.column_append_from_files(titles[2], 'N1,N2', fitbase,
                                 tabprefix+'/argus_high', 'd', 's', 'txt')

    std = titles[1]
    colA = titles[0]
    colB = titles[2]
    headA = 'diff(%s)' %colA
    headB = 'diff(%s)' %colB
    headC = 'max-diff(%)'
    tab.column_append_by_diff_pct(headA, colA, std)
    tab.column_append_by_diff_pct(headB, colB, std)
    tab.column_append_by_max(headC, headA, headB)
    tab.columns_delete([headA, headB])
    tab.columns_trim(titles, rnd='1.')

#    texhead = r'''Mode  & \multicolumn{3}{c}{Yield} & max-diff \\
#    & ARGUS Low & Std  & ARGUS High & (\%)  '''
    texhead = r'''Mode  & \multicolumn{3}{c}{Yield} & max-diff \\
    & ARGUS Low & Std  & ARGUS High & (\%)  '''
    tab.output(tabname, texhead)
コード例 #2
0
ファイル: ths.py プロジェクト: zhixing1996/dhad
def singletag_data_yield_widede(opts, tabname):
    tab = THSTable()
    tabprefix = 'dir_818ipbv12'
    tab.column_append_from_dict('Mode', 'fname,fnamebar')     
    tab.column_append_from_files('Yield1(regular)', 'N1,N2',  fitbase,
                                 tabprefix, 'd', 's', 'txt', rnd='1.')
    tab.column_append_from_files('Yield2(widede)', 'N1,N2',  fitbase,
                                 tabprefix+'/widede', 'd', 's', 'txt', rnd='1.')
    tab.column_append_by_divide('Yield1/Yield2',  'Yield1(regular)',
                                'Yield2(widede)', 'Efcy', '.0001') 
    tab.column_append_from_files('eff1(regular)', 'N1,N2', fitbase,
                                 tabprefix, 's', 's', 'txt', rnd='1.')
    tab.column_append_from_files('eff2(widede)', 'N1,N2', fitbase,
                                 tabprefix+'/widede', 's', 's', 'txt', rnd='1.')
    tab.column_append_by_divide('eff1/eff2', 'eff1(regular)', 'eff2(widede)', 
                                'Efcy', '.0001') 
    tab.column_append_by_divide('Ratio', 'Yield1/Yield2', 'eff1/eff2', 
                                'Indp', '.001') 

    tab.columns_delete(['Yield1(regular)', 'Yield2(widede)',
                        'eff1(regular)', 'eff2(widede)'])
    
    texhead = r'''Mode	 & Yield1/Yield2  & eff1/eff2 & Ratio'''
    tab.output(tabname, texhead)