本文整理匯總了Python中Direct.DirectEnergyConversion.DirectEnergyConversion.wb_run方法的典型用法代碼示例。如果您正苦於以下問題:Python DirectEnergyConversion.wb_run方法的具體用法?Python DirectEnergyConversion.wb_run怎麽用?Python DirectEnergyConversion.wb_run使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Direct.DirectEnergyConversion.DirectEnergyConversion
的用法示例。
在下文中一共展示了DirectEnergyConversion.wb_run方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_get_abs_normalization_factor
# 需要導入模塊: from Direct.DirectEnergyConversion import DirectEnergyConversion [as 別名]
# 或者: from Direct.DirectEnergyConversion.DirectEnergyConversion import wb_run [as 別名]
def test_get_abs_normalization_factor(self) :
mono_ws = CreateSampleWorkspace(NumBanks=1, BankPixelWidth=4, NumEvents=10000,XUnit='DeltaE',XMin=-5,XMax=15,BinWidth=0.1,function='Flat background')
LoadInstrument(mono_ws,InstrumentName='MARI', RewriteSpectraMap=True)
tReducer = DirectEnergyConversion(mono_ws.getInstrument())
tReducer.prop_man.incident_energy = 5.
tReducer.prop_man.monovan_integr_range=[-10,10]
tReducer.wb_run = mono_ws
(nf1,nf2,nf3,nf4) = tReducer.get_abs_normalization_factor(PropertyManager.wb_run,5.)
self.assertAlmostEqual(nf1,0.58561121802167193,7)
self.assertAlmostEqual(nf1,nf2)
self.assertAlmostEqual(nf2,nf3)
self.assertAlmostEqual(nf3,nf4)
# check warning. WB spectra with 0 signal indicate troubles.
mono_ws = CreateSampleWorkspace(NumBanks=1, BankPixelWidth=4, NumEvents=10000,XUnit='DeltaE',XMin=-5,XMax=15,BinWidth=0.1,function='Flat background')
LoadInstrument(mono_ws,InstrumentName='MARI', RewriteSpectraMap=True)
sig = mono_ws.dataY(0)
sig[:]=0
tReducer.wb_run = mono_ws
(nf1,nf2,nf3,nf4) = tReducer.get_abs_normalization_factor(PropertyManager.wb_run,5.)
self.assertAlmostEqual(nf1,0.585611218022,7)
self.assertAlmostEqual(nf1,nf2)
self.assertAlmostEqual(nf2,nf3)
self.assertAlmostEqual(nf3,nf4)