本文整理匯總了Python中tools.DHadTable.column_append_by_diff_sigma_pct方法的典型用法代碼示例。如果您正苦於以下問題:Python DHadTable.column_append_by_diff_sigma_pct方法的具體用法?Python DHadTable.column_append_by_diff_sigma_pct怎麽用?Python DHadTable.column_append_by_diff_sigma_pct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類tools.DHadTable
的用法示例。
在下文中一共展示了DHadTable.column_append_by_diff_sigma_pct方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: ratios_signal
# 需要導入模塊: from tools import DHadTable [as 別名]
# 或者: from tools.DHadTable import column_append_by_diff_sigma_pct [as 別名]
def ratios_signal(args):
if args[0] == '537ipb/281ipb' and args[1] == '537ipbv2/281ipb':
tabfilename1 = 'compare_yields_signal_divide_537ipb_9.03_regular12.txt'
title1 = args[0]
headname1 = title1
tabfilename2 = 'compare_yields_signal_divide_537ipbv2_9.03_regular12.txt'
title2 = args[1]
headname2 = title2
else:
raise NameError(args)
tabfile1 = os.path.join(attr.tabpath, tabfilename1)
tabfile2 = os.path.join(attr.tabpath, tabfilename2)
if opts.set and opts.set == 'info':
print 'here'
tab = DHadTable()
tab.column_append_from_tab_file('Mode', tabfile1, 'Mode')
tab.column_append_from_tab_file(title1, tabfile1, headname1)
tab.column_append_from_tab_file(title2, tabfile2, headname2)
tab.column_append_by_diff_sigma_pct('diff(%)', title2, title1)
tab.output(_tabname)
示例2: yields
# 需要導入模塊: from tools import DHadTable [as 別名]
# 或者: from tools.DHadTable import column_append_by_diff_sigma_pct [as 別名]
def yields(opts, tabname, args):
if args[0] not in ['signal', 'data'] :
raise NameError(args)
rnd='.01'
err_type=None
diff = 'pct'
sign = 1
if opts.set:
for li in opts.set.split(':'):
name = li.split('=')[0]
value = li.split('=')[1]
sys.stdout.write('Set %s = %s \n' % (name, value))
if name == 'diff':
diff = value
if name == 'err_type':
err_type = value
if name == 'sign':
sign = value
variable = 'yields'
dt_type = args[0]
tag = args[1]
label_A = args[2]
label_B = args[3]
fitbase = attr.fitbase
sys.stdout.write('dhad.tab : Compare %s between %s and %s:\n' %(
variable, label_A, label_B ))
tab = DHadTable()
namestyle = 'fname,fnamebar'
tab.column_append_from_dict('Mode', namestyle)
tab.column_append_from_files(label_A, 'N1,N2', fitbase, 'dir_%s' %label_A,
dt_type, tag ,'txt', rnd='1.')
tab.column_append_from_files(label_B, 'N1,N2', fitbase, 'dir_%s' %label_B,
dt_type, tag ,'txt', rnd='1.')
if sign == '0':
tab.rows_join_by_average(rnd='1.')
if diff == 'pct':
tab.column_append_by_diff_pct(
'diff(%)', label_B,label_A, rnd=rnd, err_type=err_type)
elif diff == 'sigma_pct':
tab.column_append_by_diff_sigma_pct('diff(%)', label_B,label_A, rnd=rnd)
elif diff == 'sigma2_pct':
tab.column_append_by_diff_sigma2_pct('diff(%)', label_B,label_A, rnd=rnd)
elif diff == 'ratio':
tab.column_append_by_divide(
'ratio', label_B,label_A, rnd=rnd, err_type='Indp')
else:
raise NameError(diff)
tab.output(tabname, test=opts.test)
示例3: compare_yields_data_signal_divide_537ipb
# 需要導入模塊: from tools import DHadTable [as 別名]
# 或者: from tools.DHadTable import column_append_by_diff_sigma_pct [as 別名]
def compare_yields_data_signal_divide_537ipb(args):
sys.stdout.write('dhad.table: Creating %s ...\n' % _tabname)
tabpath1 = os.path.join(
attr.base, '7.06', 'tab')
tabfile1 = os.path.join(
tabpath1, 'compare_yields_data_divide_281ipb_537ipb.txt')
tabfile2 = os.path.join(
attr.tabpath, 'compare_yields_signal_divide_537ipb_9.03_regular12.txt')
tab = DHadTable()
tab.column_append_from_tab_file('Mode', tabfile1, 'Mode')
tab.column_append_from_tab_file('Data', tabfile1, '537ipb/281ipb')
tab.column_append_from_tab_file('Signal', tabfile2, '537ipb/281ipb')
tab.column_append_by_diff_sigma_pct('diff(%)', 'Signal', 'Data')
tab.output(_tabname)
示例4: evtfile
# 需要導入模塊: from tools import DHadTable [as 別名]
# 或者: from tools.DHadTable import column_append_by_diff_sigma_pct [as 別名]
def evtfile(args):
if args[0] not in ['signal', 'data'] :
raise NameError(args)
variable = 'yields'
dt_type = args[0]
tag = args[1]
evt_A = args[2]
evt_B = args[3]
label_A, evtbase_A, prefix_A = tools.parse_evtname(opts, evt_A)
label_B, evtbase_B, prefix_B = tools.parse_evtname(opts, evt_B)
filelist_A = tools.set_file_list(evtbase_A, prefix_A, dt_type, tag, 'evt')
filelist_B = tools.set_file_list(evtbase_B, prefix_B, dt_type, tag, 'evt')
zipped = zip(filelist_A, filelist_B)
for f in zipped:
fa = f[0]
fb = f[1]
diff = tools.diff(fa, fb)
print diff
sys.exit()
sys.stdout.write('dhad.tab : Compare %s between %s and %s:' %(
variable, tab_A, tab_B ))
tab = DHadTable()
namestyle = 'fname,fnamebar'
tab.column_append_from_dict('Mode', namestyle)
tab.column_append_from_files(label_A, 'N1,N2', fitbase_A, prefix_A,
dt_type, tag ,'txt', rnd='1.')
tab.column_append_from_files(label_B, 'N1,N2', fitbase_B, prefix_B,
dt_type, tag ,'txt', rnd='1.')
tab.column_append_by_diff_sigma_pct('diff(%)', label_B,label_A, rnd=rnd)
tab.output(_tabname)