当前位置: 首页>>代码示例>>Python>>正文


Python Options.detectors["prz"]方法代码示例

本文整理汇总了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"]方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_detector_photon_depth

# 需要导入模块: from pymontecarlo.options.options import Options [as 别名]
# 或者: from pymontecarlo.options.options.Options import detectors["prz"] [as 别名]
    def test_detector_photon_depth(self):
        # Create
        ops = Options(name="test1")
        ops.beam.energy_eV = 20e3
        ops.detectors["prz"] = PhotonDepthDetector((radians(35), radians(45)), (0, radians(360.0)), 100)

        # Import
        resultscontainer = self.i.import_(ops, self.testdata)

        # Test
        self.assertEqual(1, len(resultscontainer))

        result = resultscontainer["prz"]

        self.assertTrue(result.exists("Cu La1", absorption=True))
        self.assertTrue(result.exists("Cu La1", absorption=False))
        self.assertFalse(result.exists("Cu Ka1", absorption=True))

        dist = result.get("Cu La1", absorption=False)
        self.assertAlmostEqual(-5.750000e-7, dist[2, 0], 4)
        self.assertAlmostEqual(4.737908e-6, dist[2, 1], 4)
        self.assertAlmostEqual(1.005021e-5, dist[2, 2], 4)

        dist = result.get("Cu La1", absorption=True)
        self.assertAlmostEqual(-5.150000e-7, dist[8, 0], 4)
        self.assertAlmostEqual(4.228566e-5, dist[8, 1], 4)
        self.assertAlmostEqual(1.268544e-4, dist[8, 2], 4)
开发者ID:pymontecarlo,项目名称:pymontecarlo-penelope,代码行数:29,代码来源:test_importer.py

示例2: testexport_different_opening

# 需要导入模块: from pymontecarlo.options.options import Options [as 别名]
# 或者: from pymontecarlo.options.options.Options import detectors["prz"] [as 别名]
    def testexport_different_opening(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.geometry.body.material = mat
        ops.limits.add(ShowersLimit(5678))
        ops.detectors["xrays"] = PhotonIntensityDetector((radians(30), radians(40)), (0, radians(360.0)))
        ops.detectors["prz"] = PhiZDetector((radians(30), radians(50)), (0, radians(360.0)), 750)

        # Test
        self.assertRaises(ExporterException, self.e.export_wxroptions, ops)
开发者ID:pymontecarlo,项目名称:pymontecarlo-winxray,代码行数:16,代码来源:test_exporter.py

示例3: testexport_substrate

# 需要导入模块: from pymontecarlo.options.options import Options [as 别名]
# 或者: from pymontecarlo.options.options.Options import detectors["prz"] [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["bse polar"] = BackscatteredElectronPolarAngularDetector(125)
        ops.detectors["xrays"] = PhotonIntensityDetector((radians(30), radians(40)), (0, radians(360.0)))
        ops.detectors["prz"] = PhiZDetector((radians(30), radians(40)), (0, radians(360.0)), 750)

        # Export to WinX-Ray options
        wxrops = self.e.export_wxroptions(ops)

        # Test
        self.assertAlmostEqual(1.234, wxrops.getIncidentEnergy_keV(), 4)
        self.assertAlmostEqual(25.0, wxrops.getBeamDiameter_nm(), 4)
        self.assertEqual(5678, wxrops.getNbElectron())

        zs, _wfs = wxrops.getElements()
        self.assertTrue(79 in zs)
        self.assertTrue(47 in zs)
        self.assertAlmostEqual(13.6007, wxrops.getMeanDensity_g_cm3(), 4)  # internally calculated by WinXray
        self.assertAlmostEqual(123, wxrops.getMinimumElectronEnergy_eV(), 4)

        self.assertTrue(wxrops.isComputeBSEDistribution())
        self.assertTrue(wxrops.isComputeBSEEnergy())
        self.assertEqual(123, wxrops.getNbBSEEnergy())
        self.assertTrue(wxrops.isComputeBSEAngular())
        self.assertEqual(125, wxrops.getNbBSEAngular())

        self.assertTrue(wxrops.isXrayCompute())
        self.assertTrue(wxrops.isXrayComputeCharacteristic())
        self.assertAlmostEqual(35.0, wxrops.getTOA_deg(), 4)
        self.assertAlmostEqual(55, wxrops.getAngleThetaDetector_deg(), 4)
        self.assertAlmostEqual(180.0, wxrops.getAnglePhiDetector_deg(), 4)
        self.assertEqual(750, wxrops.getNumberFilm())
开发者ID:pymontecarlo,项目名称:pymontecarlo-winxray,代码行数:43,代码来源:test_exporter.py

示例4: testexport_substrate

# 需要导入模块: from pymontecarlo.options.options import Options [as 别名]
# 或者: from pymontecarlo.options.options.Options import detectors["prz"] [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)
开发者ID:pymontecarlo,项目名称:pymontecarlo-casino2,代码行数:70,代码来源:test_exporter.py


注:本文中的pymontecarlo.options.options.Options.detectors["prz"]方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。