#data = pl.loadtxt("test2.dat") #data[:,0] = pl.radians(data[:,0]) #pl.ion() R = 0, 0, 2 thickness = 8000 Energy = 10000 #struct = pyasf.unit_cell("1011169") struct = pyasf.unit_cell("1011117") #MgO Sub = reflectivity.Substrate(struct) v_par = sp.Matrix([1, 0, 0]) v_perp = sp.Matrix([0, 0, 1]) Sub.calc_orientation(v_par, v_perp) layer1 = reflectivity.Epitaxial_Layer(struct, thickness) layer1.calc_orientation(v_par, v_perp) layer2 = reflectivity.Epitaxial_Layer(struct, 15000) layer2.calc_orientation(v_par, v_perp) layer3 = reflectivity.Epitaxial_Layer(struct, 30000) layer3.calc_orientation(v_par, v_perp) crystal = reflectivity.Sample(Sub, layer1, layer2, layer3) crystal.set_Miller(R) crystal.calc_g0_gH(Energy) thBragg = float( layer1.calc_Bragg_angle(Energy).subs(layer1.structure.subs).evalf()) angle = pl.linspace(0.9995, 1.0005, 501) * thBragg crystal.calc_reflectivity(angle, Energy) layer1.calc_amplitudes(angle, Energy) layer2.calc_amplitudes(angle, Energy)
data = pl.loadtxt("test6.dat") data[:, 0] = pl.radians(data[:, 0]) #pl.ion() R = 1, 1, 3 thickness = 1000 Energy = 10000 #struct = pyasf.unit_cell("1011117") struct = pyasf.unit_cell("cif/MgO_52026.cif") #MgO Sub = reflectivity.Substrate(struct) v_par = sp.Matrix([1, -1, 0]) v_perp = sp.Matrix([1, 1, 0]) Sub.calc_orientation(v_par, v_perp) layer1 = reflectivity.Epitaxial_Layer(struct, thickness) layer1.calc_orientation(v_par, v_perp) crystal = reflectivity.Sample(Sub, layer1) crystal.set_Miller(R) crystal.calc_g0_gH(Energy) thBragg = float( layer1.calc_Bragg_angle(Energy).subs(layer1.structure.subs).evalf()) angle = pl.linspace(0.995, 1.005, 501) * thBragg crystal.calc_reflectivity(angle, Energy) layer1.calc_amplitudes(angle, Energy) Sub.calc_amplitudes(angle, Energy) XRl = layer1.XR XRs = Sub.XR XT = layer1.XT
import pylab as pl import numpy as np R = 0,0,4 thickness=np.array([3, 1.5, 1, 0.5])*1e4 strain=np.array([20, 15, 10, 5])*1e-4 Energy=8048 structsub = pyasf.unit_cell("9008845") #GaAs Sub=reflectivity.Substrate(structsub) Layers=[] for i in range(4): layer=reflectivity.Epitaxial_Layer(pyasf.unit_cell("9008845"), thickness[i]) Layers.append(layer) Layers[i].structure.subs[Layers[i].structure.a]*=(1+strain[i]) psi=0 v_perp=sp.Matrix([0,0,1]) Sub.calc_orientation_from_angle(psi, v_perp) for i in range(4): Layers[i].calc_orientation_from_angle(psi, v_perp) crystal=reflectivity.Sample(Sub, *Layers) crystal.set_Miller(R) #crystal.calc_layer_Miller()