DataManager.clearSpectrumList() # define materials b = material("B", density=2.37) bn = material("BN", density=2.1) aln = material("AlN", density=3.26) xrts = [] trs = mc3.suggestTransitions(bn, e0) for tr in trs: xrts.append(tr) # def simulateBulkStandard(mat, name, det, e0, lt, pc, withPoisson=True, nTraj=100, sf=True, bf=True, xtraParams={}): spc_b = jm3.simBulkStd(b, det, e0, nTraj, 100, 1.0, False) spc_b.display() spc_b.rename("B-5kV") spc_b.setAsStandard(b) fi = datDir + "/spc_b.msa" print(fi) if (bSaveSpc): spc_b.save(fi) spc_bn = jm3.simBulkStd(bn, det, e0, nTraj, 100, 1.0, False) spc_bn.display() spc_bn.rename("BN-5kV") fi = datDir + "/spc_bn.msa" print(fi) if (bSaveSpc): spc_bn.save(fi)
p = material("P", density=1.88) s = material("S", density=2.0) si = material("Si", density=2.32) cu = material("Cu", density=8.96) mo = material("Mo", density=10.2) co = material("Co", density=8.86) pb = material("Pb", density=11.34) fe = material("Fe", density=7.874) xrts = [] trs = mc3.suggestTransitions(srm1155, e0) for tr in trs: xrts.append(tr) srm1155_spc = jm3.simBulkStd(srm1155, det, e0, nTraj, lt, pc, True) srm1155_spc.setAsStandard(srm1155) srm1155_spc.display() srm1155_spc.save(srm1555_path) """ si_spc = jm3.simBulkStd(si, det, e0, nTraj, lt, pc, True) si_spc.display() caf2_spc = jm3.simBulkStd(caf2, det, e0, nTraj, lt, pc, True) caf2_spc.display() fe_spc = jm3.simBulkStd(fe, det, e0, nTraj, lt, pc, True) fe_spc.display() ti_spc = jm3.simBulkStd(ti, det, e0, nTraj, lt, pc, True)
si = material("Si", density=2.32) caf2 = material("CaF2", density=3.18) fe = material("Fe", density=7.874) ti = material("Ti", density=4.506) zn = material("Zn", density=7.14) baf2 = material("BaF2", density=4.89) al2o3 = material("Al2O3", density=3.95) xrts = [] trs = mc3.suggestTransitions(k309, e0) for tr in trs: xrts.append(tr) k309_spc = jm3.simBulkStd(k309, det, e0, nTraj, lt, pc, True) k309_spc.display() si_spc = jm3.simBulkStd(si, det, e0, nTraj, lt, pc, True) si_spc.display() caf2_spc = jm3.simBulkStd(caf2, det, e0, nTraj, lt, pc, True) caf2_spc.display() fe_spc = jm3.simBulkStd(fe, det, e0, nTraj, lt, pc, True) fe_spc.display() ti_spc = jm3.simBulkStd(ti, det, e0, nTraj, lt, pc, True) ti_spc.display() zn_spc = jm3.simBulkStd(zn, det, e0, nTraj, lt, pc, True)
start = time.time() DataManager.clearSpectrumList() c = material("C", density=2.266) fe = material("Fe", density=7.874) # only get FeL at 7 kV trs = [epq.XRayTransitionSet(epq.Element.C, epq.XRayTransitionSet.K_FAMILY), epq.XRayTransitionSet(epq.Element.Fe, epq.XRayTransitionSet.L_FAMILY)] # First simulate the standards startCycle = time.time() c_std_spc = jm3.simBulkStd(c, det, e0, nTraj, lt=lt, pc=pc) display(c_std_spc) sName = "%s-std-%g-kV-%g-traj" % ("C", e0, nTraj) fi = datDir + "/" fi += sName fi += ".msa" if bSaveSpc == True: c_std_spc.save(fi) endCycle = time.time() delta = (endCycle-startCycle)/60 tod = datetime.datetime.now().time() msg = "C std required %.3f min %s" % (delta, tod) print msg startCycle = time.time() fe_std_spc = jm3.simBulkStd(fe, det, e0, nTraj, lt=lt, pc=pc)
DataManager.clearSpectrumList() c = material("C", density=2.266) fe = material("Fe", density=7.86) fe3c = material("Fe3C", density=4.93) # only get FeL at 7 kV trs = [ epq.XRayTransitionSet(epq.Element.C, epq.XRayTransitionSet.K_FAMILY), epq.XRayTransitionSet(epq.Element.Fe, epq.XRayTransitionSet.L_FAMILY) ] # First simulate the standards # Start with C startCycle = time.time() c_std_spc = jm3.simBulkStd(c, det, e0, nTraj, lt=lt, pc=pc) display(c_std_spc) sName = "%s-std-%g-kV-%g-traj" % ("C", e0, nTraj) fi = basePath + "/" fi += sName fi += ".msa" if bSaveSpc == True: c_std_spc.save(fi) endCycle = time.time() delta = (endCycle - startCycle) / 60 tod = datetime.datetime.now().time() msg = "C std required %.3f min %s" % (delta, tod) print msg startCycle = time.time() fe_std_spc = jm3.simBulkStd(fe, det, e0, nTraj, lt=lt, pc=pc)
si = material("Si", density=2.3290) k227 = epq.Material( epq.Composition([epq.Element.O, epq.Element.Si, epq.Element.Pb], [0.1640, 0.0934, 0.7246]), epq.ToSI.gPerCC(4.0)) k227.setName("k227") # Start with k227 xrts = [] trs = mc3.suggestTransitions(k227, e0) for tr in trs: xrts.append(tr) print(trs) spc_k227 = jm3.simBulkStd(k227, det, e0, nTraj, 100, 1.0, False) spc_k227.display() spc_k227.rename("k227-5kV") spc_k227.setAsStandard(k227) fi = datDir + "/spc_k227.msa" print(fi) if (bSaveSpc): spc_k227.save(fi) # Next Si xrts = [] trs = mc3.suggestTransitions(si, e0) for tr in trs: xrts.append(tr) print(trs)