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 crystal.print_values(angle, Energy)
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() crystal.calc_g0_gH(Energy) #thBragg= float(Sub.calc_Bragg_angle(Energy).subs(Sub.structure.subs).evalf()) thBragg=Sub.thetaBragg angle=pl.linspace(0.9975, 1.0008,501)*thBragg #XRl = layer1.calc_reflection_amplitude(angle, Energy) #XRs = Sub.calc_reflection_amplitude(angle, Energy) # XT = layer1.calc_transmission_amplitude(angle, Energy) XR=crystal.calc_reflectivity(angle, Energy) crystal.print_values(angle, Energy) #pl.plot(data[:,0], data[:,1]) # pl.plot(angle-thBragg,abs(XT)**2)