本文整理汇总了Python中Direct.DirectEnergyConversion.DirectEnergyConversion.get_abs_normalization_factor方法的典型用法代码示例。如果您正苦于以下问题:Python DirectEnergyConversion.get_abs_normalization_factor方法的具体用法?Python DirectEnergyConversion.get_abs_normalization_factor怎么用?Python DirectEnergyConversion.get_abs_normalization_factor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Direct.DirectEnergyConversion.DirectEnergyConversion
的用法示例。
在下文中一共展示了DirectEnergyConversion.get_abs_normalization_factor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_abs_normalization_factor
# 需要导入模块: from Direct.DirectEnergyConversion import DirectEnergyConversion [as 别名]
# 或者: from Direct.DirectEnergyConversion.DirectEnergyConversion import get_abs_normalization_factor [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)