# the project directory wd = git + "/OSImageAnalysis/dtsa2/other-macros/testScripts" os.chdir(wd) pyrDir = wd + "/3_testCalDet Results/" spcDir = git + "/OSImageAnalysis/dtsa2/detectors/2-FEI Sirion" DataManager.clearSpectrumList() sDet = "Oxford p4 05eV 2K" det = findDetector(sDet) spcFil = spcDir + '/' + "Cu-15kV-P4-10-2K-250s.txt" spc = wrap(ept.SpectrumFile.open(spcFil)[0]) display(spc) print(spc.getChannelCount()) mat = jmg.matchDet(spc, det) cu = material("Cu", density=8.96) mat.setAsStandard(cu) display(mat) print(mat.getChannelCount()) sf = epq.SpectrumFitter8(det, cu, mat) # print(dir(sf)) rois = sf.getROIS() print(rois) # print(epq.FromSI.keV(rois.highEnergy()-rois.lowEnergy())/3.0) pr = mat.getProperties() # print(dir(pr)) props = pr.getDetector().getCalibration().getProperties()
pyrDir = wd + "/00_testDetQuant Results/" DataManager.clearSpectrumList() spcDir = git + "/OSImageAnalysis/dtsa2/spc/" sDet = "FEI FIB620 EDAX-RTEM" det = findDetector(sDet) pc = 1.0 wrkDist = 17.2 # mm vkV = [15] for e0 in vkV: cuFil = spcDir + "Cu-%g-1.spc" % e0 raw = readSpectrum(cuFil, i=0, det=None) print(raw.getChannelCount()) cuStdSpc = jmg.matchDet(raw, det) # try remap to see if it picks up calibration cuStdSpc = cuStdSpc.remap(det) cuStdSpc.setAsStandard(epq.Composition(epq.Element.Cu)) cuStdSpc.rename("CuStd") # set up the standard print(cuStdSpc.getChannelCount()) display(cuStdSpc) cuStd = {"Cu":cuStdSpc} cuFil = spcDir + "Cu-%g-2.spc" % e0 raw = readSpectrum(cuFil, i=0, det=None) print(raw.getChannelCount()) cuSpc = jmg.matchDet(raw, det) # try remap to see if it picks up calibration cuSpc = cuSpc.remap(det)