Esempio n. 1
0
 def __init__(self, composition, density, thickness=1):
     self.composition = composition  # ex) SiO2
     self.density = density  # in g/cm^3
     self.thickness = thickness  # in cm
     self.la = 1.0  #absoprtion length in cm
     self.trans = 0.5  # transmission.
     self.absrp = 0.5  # absorption
     self.delta = 0.1  # index of refraction, real part
     self.beta = 0.1  # index of refraction, imaginary part
     temp = f1f2.get_ChemName(composition)
     AtomList = temp[0]
     AtomIndex = temp[1]
     AtomWeight = 0
     for (ii, atom) in enumerate(AtomList):
         AtWt = f1f2.AtSym2AtWt(atom)
         index = AtomIndex[ii]
         AtomWeight = AtomWeight + index * AtWt
     NumberDensity = density * Nav / AtomWeight
     self.NumDen = NumberDensity  # number of molecules per cm^3
     self.AtWt = AtomWeight  # weight per mole
Esempio n. 2
0
 def __init__(self, composition, density, thickness=1):
     self.composition=composition        # ex) SiO2
     self.density=density              # in g/cm^3
     self.thickness=thickness            # in cm
     self.la=1.0                         #absoprtion length in cm
     self.trans=0.5                      # transmission.
     self.absrp=0.5                 # absorption
     self.delta=0.1                  # index of refraction, real part
     self.beta=0.1                   # index of refraction, imaginary part
     temp=f1f2.get_ChemName(composition)
     AtomList=temp[0]
     AtomIndex=temp[1]
     AtomWeight=0
     for (ii, atom) in enumerate(AtomList):
         AtWt=f1f2.AtSym2AtWt(atom)
         index=AtomIndex[ii]
         AtomWeight = AtomWeight + index*AtWt
     NumberDensity=density*Nav/AtomWeight
     self.NumDen=NumberDensity       # number of molecules per cm^3
     self.AtWt=AtomWeight            # weight per mole
Esempio n. 3
0
 def __init__(self, composition1='Si', density1=2.33, thickness1=0.1, \
                    composition2='Si', density2=2.33, thickness2=0.1, angle0=45.0, option='surface'):
     self.composition1 = composition1  # ex) Fe2O3
     out = f1f2.get_ChemName(composition1)  # output from get_ChemName
     self.ElemList1 = out[
         0]  # list of elments in matrix: 'Fe', 'O' for Fe2O3
     self.ElemInd1 = out[1]  # list of index: 2, 3 for Fe2O3
     self.ElemFrt1 = out[2]  # list of fraction: 0.4, 0.6 for Fe2O3
     self.density1 = density1  # in g/cm^3
     self.thickness1 = thickness1  # top layer thickness in cm
     self.composition2 = composition2
     out = f1f2.get_ChemName(composition2)
     self.ElemList2 = out[0]  # for the bottom substrate
     self.ElemInd2 = out[1]
     self.ElemFrt2 = out[2]
     self.density2 = density2
     self.thickness2 = thickness2  # bottom layer thickness in cm
     self.angle = angle0 * math.pi / 180.  # in radian, incident beam angle, surface normal =pi/2
     self.option = option  # option for fluorescing element location, surface/top/bottom
     self.la1 = 1.0  # absoprtion length in cm
     self.delta1 = 0.1  # index of refraction, real part correction
     self.beta1 = 0.1  # index of refraction, imaginary part
     self.Nat1 = 1.0  # atomic number density of the Fe2O3, 1e22 Fe2O3 atoms /cm^3
     self.la2 = 1.0
     self.delta2 = 0.1
     self.beta2 = 0.1
     self.Nat2 = 1.0  # atomic number density of the first element, 1e22 Fe2O3 atoms/cm^3
     self.scale = 1.0  # weighted average over the depth range: sum of (trans*factors)
     self.scale1 = 1.0  # sum of (trans*1.0) this is for substrate element in top layer
     self.scale2 = 1.0  # sum of (trans*thickness2/thickness1) for substrate element in bottom layer
     self.ElemListFY = []  # fluorescing element
     self.ElemFrtFY = []  # fraction for fluorescing element
     self.Nat1 = 1  # atomic number density in atoms/cc, for example # of Fe2O3/cm^3 for Fe2O3 substrate
     self.Nat2 = 1  # atomic number density in atoms/cc
     substrate1_material = Material(composition1, density1)
     AtNumDen1 = substrate1_material.NumDen  #  substrate1
     substrate2_material = Material(composition2, density2)
     AtNumDen2 = substrate2_material.NumDen  #  substrate2, fixed 8/12/10
     self.Nat1 = AtNumDen1
     self.Nat2 = AtNumDen2
     self.txt = ''
     text1 = 'substrate1:%6.3e %s/cm^3' % (AtNumDen1, composition1)
     #print(text1)
     text2 = 'substrate2:%6.3e %s/cm^3' % (AtNumDen2, composition2)
     self.txt = text1 + '  ' + text2
     print(self.txt)
     # atom.conc is normalized to the number density of substrate1 molecule
     for (ii, item) in enumerate(self.ElemList1):
         if f1f2.AtSym2AtNum(item) >= 12:  # ignore elements below Mg
             #atom=ElemFY(item, self.ElemFrt1[ii], 'substrate1')
             atom = ElemFY(item, self.ElemInd1[ii], 'substrate1')
             # eg. for Fe2O3, Fe concentration is 2 (=2 x Fe2O3 number density)
             self.ElemListFY.append(atom)
     for (ii, item) in enumerate(self.ElemList2):
         if f1f2.AtSym2AtNum(item) >= 12:  # ignore elements below Mg
             #atom=ElemFY(item, self.ElemFrt2[ii], 'substrate2')
             atom = ElemFY(item, self.ElemInd2[ii] * AtNumDen2 / AtNumDen1,
                           'substrate2')
             self.ElemListFY.append(atom)
     numLayer = 100  # each layer is sliced into 100 sublayers.
     self.depths = []  # depth values for calculation
     for ii in range(numLayer):
         step = 1.0 / numLayer
         self.depths.append(step * ii * self.thickness1)
     for ii in range(numLayer):
         step = 1.0 / numLayer
         self.depths.append(step * ii * self.thickness2 + self.thickness1)
     self.factors = []  # 1 or pre if element present at each depth
     pre = self.thickness2 / self.thickness1  # prefactor, if two layers have different thickness
     if self.option == 'surface':  # fluorescecing atoms present in only on the surface
         for ii in range(len(self.depths)):
             if ii == 0:
                 self.factors.append(1.0)
             else:
                 self.factors.append(0.0)
     if self.option == 'all':  # fluorescecing atoms present throughout
         for ii in range(len(self.depths)):
             if self.depths[ii] < self.thickness1:
                 self.factors.append(1.0)
             else:
                 self.factors.append(pre)
     if self.option == 'top':  # fluorescecing atoms present only in the top layer
         for ii in range(len(self.depths)):
             if self.depths[ii] < self.thickness1:
                 self.factors.append(1.0)
             else:
                 self.factors.append(0.0)
     if self.option == 'bottom':  # fluorescecing atoms present only in the bottom layer
         for ii in range(len(self.depths)):
             if self.depths[ii] < self.thickness1:
                 self.factors.append(0.0)
             else:
                 self.factors.append(pre)
     # note: fluorescing substrate atoms present throughout regardless of the option.
     self.trans = []  # transmission to surface for emitted fluorescence
     self.absrp = []  # absorption until surface for emitted fluorescence
     self.inten0 = []  # incident x-ray intensity at each depth
     for ii in range(len(self.depths)):
         self.trans.append(0.5)
         self.absrp.append(0.5)
         self.inten0.append(0.5)
Esempio n. 4
0
 def __init__(self, composition1='Si', density1=2.33, thickness1=0.1, \
                    composition2='Si', density2=2.33, thickness2=0.1, angle0=45.0, option='surface'):
     self.composition1 = composition1     # ex) Fe2O3
     out=f1f2.get_ChemName(composition1)       # output from get_ChemName
     self.ElemList1 = out[0]              # list of elments in matrix: 'Fe', 'O' for Fe2O3
     self.ElemInd1 = out[1]               # list of index: 2, 3 for Fe2O3
     self.ElemFrt1 = out[2]               # list of fraction: 0.4, 0.6 for Fe2O3
     self.density1 = density1             # in g/cm^3
     self.thickness1 = thickness1         # top layer thickness in cm
     self.composition2 = composition2
     out=f1f2.get_ChemName(composition2)
     self.ElemList2 = out[0]              # for the bottom substrate     
     self.ElemInd2 = out[1]               
     self.ElemFrt2 = out[2]               
     self.density2 = density2             
     self.thickness2 = thickness2         # bottom layer thickness in cm
     self.angle = angle0*math.pi/180.     # in radian, incident beam angle, surface normal =pi/2
     self.option = option                 # option for fluorescing element location, surface/top/bottom
     self.la1 = 1.0                       # absoprtion length in cm
     self.delta1 = 0.1                    # index of refraction, real part correction
     self.beta1 = 0.1                     # index of refraction, imaginary part
     self.Nat1 = 1.0                      # atomic number density of the Fe2O3, 1e22 Fe2O3 atoms /cm^3
     self.la2 = 1.0                       
     self.delta2 = 0.1                    
     self.beta2 = 0.1                     
     self.Nat2 = 1.0                     # atomic number density of the first element, 1e22 Fe2O3 atoms/cm^3
     self.scale = 1.0                    # weighted average over the depth range: sum of (trans*factors)
     self.scale1 = 1.0                   # sum of (trans*1.0) this is for substrate element in top layer
     self.scale2 = 1.0                   # sum of (trans*thickness2/thickness1) for substrate element in bottom layer
     self.ElemListFY =[]                 # fluorescing element
     self.ElemFrtFY =[]                  # fraction for fluorescing element
     self.Nat1=1                  # atomic number density in atoms/cc, for example # of Fe2O3/cm^3 for Fe2O3 substrate
     self.Nat2=1                  # atomic number density in atoms/cc
     substrate1_material = Material(composition1, density1)
     AtNumDen1 = substrate1_material.NumDen      #  substrate1
     substrate2_material = Material(composition2, density2)
     AtNumDen2 = substrate2_material.NumDen      #  substrate2, fixed 8/12/10
     self.Nat1=AtNumDen1
     self.Nat2=AtNumDen2
     self.txt=''
     text1='substrate1:%6.3e %s/cm^3' % (AtNumDen1, composition1)
     #print(text1)
     text2='substrate2:%6.3e %s/cm^3' % (AtNumDen2, composition2)
     self.txt=text1+'  '+text2
     print(self.txt)
     # atom.conc is normalized to the number density of substrate1 molecule
     for (ii, item) in enumerate(self.ElemList1):
         if f1f2.AtSym2AtNum(item)>=12:       # ignore elements below Mg
             #atom=ElemFY(item, self.ElemFrt1[ii], 'substrate1')
             atom=ElemFY(item, self.ElemInd1[ii], 'substrate1')
             # eg. for Fe2O3, Fe concentration is 2 (=2 x Fe2O3 number density)
             self.ElemListFY.append(atom)
     for (ii, item) in enumerate(self.ElemList2):
         if f1f2.AtSym2AtNum(item)>=12:       # ignore elements below Mg
             #atom=ElemFY(item, self.ElemFrt2[ii], 'substrate2')
             atom=ElemFY(item, self.ElemInd2[ii]*AtNumDen2/AtNumDen1, 'substrate2')
             self.ElemListFY.append(atom)
     numLayer=100                        # each layer is sliced into 100 sublayers.
     self.depths=[]                      # depth values for calculation
     for ii in range(numLayer):
         step=1.0/numLayer
         self.depths.append(step*ii*self.thickness1)
     for ii in range(numLayer):
         step=1.0/numLayer
         self.depths.append(step*ii*self.thickness2+self.thickness1)
     self.factors=[]                     # 1 or pre if element present at each depth
     pre=self.thickness2/self.thickness1 # prefactor, if two layers have different thickness
     if self.option=='surface':          # fluorescecing atoms present in only on the surface
         for ii in range(len(self.depths)):
             if ii==0:
                 self.factors.append(1.0)
             else:
                 self.factors.append(0.0)
     if self.option=='all':              # fluorescecing atoms present throughout 
         for ii in range(len(self.depths)):
             if self.depths[ii]<self.thickness1:
                 self.factors.append(1.0)
             else:
                 self.factors.append(pre)
     if self.option=='top':              # fluorescecing atoms present only in the top layer
         for ii in range(len(self.depths)):
             if self.depths[ii]<self.thickness1:
                 self.factors.append(1.0)
             else:
                 self.factors.append(0.0)                    
     if self.option=='bottom':           # fluorescecing atoms present only in the bottom layer
         for ii in range(len(self.depths)):
             if self.depths[ii]<self.thickness1:
                 self.factors.append(0.0)
             else:
                 self.factors.append(pre)
     # note: fluorescing substrate atoms present throughout regardless of the option.
     self.trans=[]                       # transmission to surface for emitted fluorescence 
     self.absrp=[]                       # absorption until surface for emitted fluorescence
     self.inten0=[]                      # incident x-ray intensity at each depth
     for ii in range(len(self.depths)):
         self.trans.append(0.5)
         self.absrp.append(0.5)
         self.inten0.append(0.5)