本文整理汇总了Python中pymontecarlo.options.options.Options.detectors['prz']方法的典型用法代码示例。如果您正苦于以下问题:Python Options.detectors['prz']方法的具体用法?Python Options.detectors['prz']怎么用?Python Options.detectors['prz']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymontecarlo.options.options.Options
的用法示例。
在下文中一共展示了Options.detectors['prz']方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testconvert4
# 需要导入模块: from pymontecarlo.options.options import Options [as 别名]
# 或者: from pymontecarlo.options.options.Options import detectors['prz'] [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: testconvert7
# 需要导入模块: from pymontecarlo.options.options import Options [as 别名]
# 或者: from pymontecarlo.options.options.Options import detectors['prz'] [as 别名]
def testconvert7(self):
# Base options
ops = Options(name="Test")
ops.beam.energy_eV = 100e3
ops.detectors['prz'] = PhiZDetector((0, 1), (2, 3), 1000)
# Convert
opss = self.converter.convert(ops)
# No shower limit
self.assertEqual(0, len(opss))
示例3: test_photon_depth_detector
# 需要导入模块: from pymontecarlo.options.options import Options [as 别名]
# 或者: from pymontecarlo.options.options.Options import detectors['prz'] [as 别名]
def test_photon_depth_detector(self):
# Create
ops = Options(name='test1')
ops.beam.energy_eV = 30e3
ops.geometry.body.material = PenelopeMaterial.pure(29)
ops.detectors['prz'] = \
PhotonDepthDetector((radians(0), radians(90)), (0, radians(360.0)),
500, [Transition(29, siegbahn='Ka1')])
ops.limits.add(TimeLimit(100))
# Export
opss = self.c.convert(ops)
self.e.export(opss[0], self.tmpdir)
示例4: testconvert6
# 需要导入模块: from pymontecarlo.options.options import Options [as 别名]
# 或者: from pymontecarlo.options.options.Options import detectors['prz'] [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['prz'] = PhiZDetector((0, 1), (2, 3), 1000)
ops.models.add(NEW_MODEL_TYPE.test)
ops.limits.add(ShowersLimit(5678))
# Convert
opss = self.converter.convert(ops)
# Test
self.assertEqual(1, len(opss))
示例5: testexport
# 需要导入模块: from pymontecarlo.options.options import Options [as 别名]
# 或者: from pymontecarlo.options.options.Options import detectors['prz'] [as 别名]
def testexport(self):
# Create
ops = Options(name='test1')
ops.beam.energy_eV = 30e3
ops.geometry.body.material = PenelopeMaterial.pure(29)
ops.detectors['x-ray'] = \
PhotonIntensityDetector((radians(35), radians(45)), (0, radians(360.0)))
ops.detectors['spectrum'] = \
PhotonSpectrumDetector((radians(35), radians(45)), (0, radians(360.0)), 500, (0, 1000))
ops.detectors['prz'] = \
PhotonDepthDetector((radians(0), radians(90)), (0, radians(360.0)), 500)
ops.limits.add(TimeLimit(100))
ops.limits.add(UncertaintyLimit(Transition(29, siegbahn='Ka1'), 'x-ray', 0.05))
# Export
opss = self.c.convert(ops)
self.e.export(opss[0], self.tmpdir)