本文整理汇总了Python中pymontecarlo.options.options.Options.detectors['xray']方法的典型用法代码示例。如果您正苦于以下问题:Python Options.detectors['xray']方法的具体用法?Python Options.detectors['xray']怎么用?Python Options.detectors['xray']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymontecarlo.options.options.Options
的用法示例。
在下文中一共展示了Options.detectors['xray']方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testconvert4
# 需要导入模块: from pymontecarlo.options.options import Options [as 别名]
# 或者: from pymontecarlo.options.options.Options import detectors['xray'] [as 别名]
def testconvert4(self):
# Base options
ops = Options(name="Test")
ops.beam.energy = 100e3
ops.detectors['prz'] = PhiZDetector((0, 1), (2, 3), 1000)
ops.detectors['xray'] = PhotonIntensityDetector((0, 1), (2, 3))
ops.limits.add(ShowersLimit(5678))
# Convert
opss = self.converter.convert(ops)
# Test
self.assertEqual(1, len(opss))
self.assertEqual(2, len(opss[0].detectors))
self.assertEqual(7, len(opss[0].models))
# Test difference in elevation
ops.detectors['xray'] = PhotonIntensityDetector((0.5, 1), (2, 3))
opss = self.converter.convert(ops)
self.assertEqual(2, len(opss))
# Test difference in azimuth
ops.detectors['xray'] = PhotonIntensityDetector((0, 1), (2.5, 3))
opss = self.converter.convert(ops)
self.assertEqual(2, len(opss))
# Test difference in elevation (PhotonSpectrumDetector)
ops.detectors['xray'] = PhotonSpectrumDetector((0.5, 1), (2, 3), 1000, (0, 1234))
opss = self.converter.convert(ops)
self.assertEqual(2, len(opss))
示例2: testconvert6
# 需要导入模块: from pymontecarlo.options.options import Options [as 别名]
# 或者: from pymontecarlo.options.options.Options import detectors['xray'] [as 别名]
def testconvert6(self):
NEW_MODEL_TYPE = ModelType('new')
NEW_MODEL_TYPE.test = ('test',)
# Base options
ops = Options(name="Test")
ops.beam.energy_eV = 100e3
ops.detectors['xray'] = PhotonIntensityDetector((0, 1), (2, 3))
ops.models.add(NEW_MODEL_TYPE.test)
ops.limits.add(ShowersLimit(5678))
# Convert
opss = self.converter.convert(ops)
self.assertEqual(1, len(opss))
示例3: setUp
# 需要导入模块: from pymontecarlo.options.options import Options [as 别名]
# 或者: from pymontecarlo.options.options.Options import detectors['xray'] [as 别名]
def setUp(self):
TestCase.setUp(self)
self.outputdir = tempfile.mkdtemp()
self.workdir = tempfile.mkdtemp()
ops = Options('test')
ops.beam = PencilBeam(5e3)
ops.geometry.body.material = \
Material({6: 0.4, 13: 0.6}, absorption_energy_eV={ELECTRON: 234.0})
ops.detectors['xray'] = \
PhotonIntensityDetector.annular(d2r(40.0), d2r(5.0))
ops.limits.add(ShowersLimit(1))
self.ops = Converter().convert(ops)[0]
self.worker = Worker(program)