本文整理汇总了Python中pymontecarlo.options.options.Options.detectors["te"]方法的典型用法代码示例。如果您正苦于以下问题:Python Options.detectors["te"]方法的具体用法?Python Options.detectors["te"]怎么用?Python Options.detectors["te"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymontecarlo.options.options.Options
的用法示例。
在下文中一共展示了Options.detectors["te"]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testexport_substrate
# 需要导入模块: from pymontecarlo.options.options import Options [as 别名]
# 或者: from pymontecarlo.options.options.Options import detectors["te"] [as 别名]
def testexport_substrate(self):
# Create options
mat = Material({79: 0.5, 47: 0.5}, "Mat1", absorption_energy_eV={ELECTRON: 123.0})
ops = Options()
ops.beam.energy_eV = 1234
ops.beam.diameter_m = 25e-9
ops.beam.origin_m = (100e-9, 0, 1)
ops.geometry.body.material = mat
ops.limits.add(ShowersLimit(5678))
ops.detectors["bse"] = BackscatteredElectronEnergyDetector(123, (0, 567))
ops.detectors["te"] = TransmittedElectronEnergyDetector(124, (1, 568))
ops.detectors["bse polar"] = BackscatteredElectronPolarAngularDetector(125)
ops.detectors["xrays"] = PhotonIntensityDetector((radians(30), radians(40)), (0, radians(360.0)))
ops.detectors["prz"] = PhotonDepthDetector((radians(30), radians(40)), (0, radians(360.0)), 750)
ops.detectors["bseradial"] = BackscatteredElectronRadialDetector(126)
ops.detectors["trajs"] = TrajectoryDetector()
# Export to CAS
casfile = self.e.export_cas(ops)
# Test
simdata = casfile.getOptionSimulationData()
simops = simdata.getSimulationOptions()
regionops = simdata.getRegionOptions()
self.assertAlmostEqual(1.234, simops.getIncidentEnergy_keV(0), 4)
self.assertAlmostEqual(34.93392125, simops.Beam_Diameter, 4) # FWHM
self.assertAlmostEqual(100.0, simops._positionStart_nm, 4)
self.assertEqual(1, regionops.getNumberRegions())
region = regionops.getRegion(0)
elements = list(map(attrgetter("Z"), region.getElements()))
self.assertAlmostEqual(mat.density_kg_m3 / 1000.0, region.Rho, 4)
self.assertEqual("Mat1", region.Name)
self.assertEqual(2, len(elements))
self.assertTrue(79 in elements)
self.assertTrue(47 in elements)
self.assertAlmostEqual(0.123, simops.Eminimum, 3)
self.assertEqual(5678, simops.getNumberElectrons())
self.assertTrue(simops.FDenr)
self.assertFalse(simops.FDenrLog)
self.assertEqual(123, simops.NbPointDENR)
self.assertAlmostEqual(0.0, simops.DenrMin, 3)
self.assertAlmostEqual(0.567, simops.DenrMax, 3)
self.assertTrue(simops.FDent)
self.assertFalse(simops.FDentLog)
self.assertEqual(124, simops.NbPointDENT)
self.assertAlmostEqual(0.001, simops.DentMin, 3)
self.assertAlmostEqual(0.568, simops.DentMax, 3)
self.assertTrue(simops.FDbang)
self.assertFalse(simops.FDbangLog)
self.assertEqual(125, simops.NbPointDBANG)
self.assertAlmostEqual(-90.0, simops.DbangMin, 4)
self.assertAlmostEqual(90.0, simops.DbangMax, 4)
self.assertTrue(simops.FDrsr)
self.assertFalse(simops.FDrsrLog)
self.assertEqual(126, simops.NbPointDRSR)
self.assertTrue(simops.Memory_Keep)
self.assertEqual(5678, simops.Electron_Display)
self.assertTrue(simops.FEmissionRX)