def calcModel(self): sld = [ self.params['sldSubstrate'].value, self.params['sldLayer'].value, 0 ] sub_thickness = 10 + 2.5 * max(self.params["roughnessSubstrate"].value, self.params["roughnessLayer"].value) thickness = [sub_thickness, self.params['thickness'].value, 0] roughness = [ self.params["roughnessSubstrate"].value, self.params["roughnessLayer"].value, 0 ] Ilayer = algorithms.parrat(self.q, sld, roughness, thickness) Isubstrate = algorithms.parrat(self.q, [self.params['sldSubstrate'].value, 0], [self.params['roughnessSubstrate'], 0], [0, 0]) self.z = np.linspace( -sub_thickness, (1.1 * self.params['thickness'].value + sub_thickness), 100) self.I = self.params["i0"] * ( self.params['coverage'] * Ilayer + (1 - self.params['coverage']) * Isubstrate) + self.params["bg"] self.sld = algorithms.roughsld_thick_layers(self.z, sld, roughness, thickness).real
def calcModel(self): a = self.params['a'].value d = self.params['d'].value pDens = self.params["packingDensity"].value sldSub = self.params['sldSubstrate'].value sldShell = self.params['sldShell'].value sldCore = self.params['sldCore'].value coverage = self.params['coverage'].value roughSub = self.params['roughnessSubstrate'].value roughLayer = roughSub + self.params["roughnessPlus1"].value sld = np.array([ sldSub, pDens * sldShell, pDens * sldCore, pDens * sldShell, 0, ]) thickness = [2 * a, d, a, d, 2 * a] roughness = [roughSub, roughLayer, roughLayer, roughLayer, roughLayer] z = -thickness[0] + np.sum(thickness) Isubstrate = algorithms.parrat(self.q, [sldSub, 0], [roughSub, roughSub], [2 * a, 2 * a]) IparticleLayer = algorithms.parrat(self.q, sld, roughness, thickness) self.z = np.linspace(-thickness[0], z, 300) self.I = self.params["i0"] * ( coverage * IparticleLayer + (1 - coverage) * Isubstrate) + self.params["bg"] self.sld = algorithms.roughsld_thick_layers(self.z, sld, roughness, thickness).real
def calcMagneticModel(self): a = self.params['a'].value pDens = self.params["packingDensity"].value thicknessShellLower = self.params['thicknessShellLower'].value thicknessShellTop = self.params['thicknessShellTop'].value sldShellLower = self.params['sldShellLower'].value sldShellTop = self.params['sldShellTop'].value sldSub = self.params['sldSubstrate'].value sldCore = self.params['sldCore'].value coverage = self.params['coverage'].value roughSub = self.params['roughnessSubstrate'].value roughNC_Shell = roughSub + self.params["roughnessCubeShell"].value roughShell_Air = roughSub + self.params["roughnessShellAir"].value sub_thickness = 10 + 2.5 * max(roughSub, roughNC_Shell, roughShell_Air) sld = np.array([ sldSub, sldShellLower, pDens * sldCore, sldShellTop, 0, ]) sldMag = np.array([ 0, 0, pDens * self.params['magSldCore'].value, 0, 0, ]) thickness = [ sub_thickness, thicknessShellLower, a, thicknessShellTop, 0 ] roughness = [roughSub, roughNC_Shell, roughNC_Shell, roughShell_Air, 0] Isubstrate = algorithms.parrat(self.q, [sldSub, 0], [roughSub, 0], [sub_thickness, 0]) IparticleLayer = algorithms.parrat( self.q, sld + self.params['polarization'] * sldMag, roughness, thickness) self.z = np.linspace(-thickness[0], -thickness[0] + np.sum(thickness) + sub_thickness, 300) self.I = self.params["i0"] * ( coverage * IparticleLayer + (1 - coverage) * Isubstrate) + self.params["bg"] self.sld = algorithms.roughsld_thick_layers(self.z, sld, roughness, thickness).real self.sldMag = algorithms.roughsld_thick_layers(self.z, sldMag, roughness, thickness).real
def calcModel(self): a = self.params['a'].value pDens = self.params["packingDensity"].value thicknessSpacer = self.params['thicknessSpacer'].value thicknessShellLower = self.params['thicknessShellLower'].value thicknessShellTop = self.params['thicknessShellTop'].value sldShellLower = self.params['sldShellLower'].value sldShellTop = self.params['sldShellTop'].value sldSub = self.params['sldSubstrate'].value sldSpacer = self.params['sldSpacer'].value sldCore = self.params['sldCore'].value coverage = self.params['coverage'].value roughSub = self.params['roughnessSubstrate'].value roughSpacer = self.params['roughnessSpacer'].value roughNC_Shell1 = self.params["roughnessShellCube"].value roughNC_Shell2 = self.params["roughnessCubeShell"].value if thicknessShellTop > 0: roughShell_Air = self.params["roughnessShellAir"].value else: roughShell_Air = roughNC_Shell2 sub_thickness = 10 + 2.5 * max(roughSub, roughNC_Shell2, roughShell_Air) sld = np.array([ sldSub, sldSpacer, sldShellLower, pDens * sldCore, sldShellTop, 0, ]) roughness = [ roughSub, roughSpacer, roughNC_Shell1, roughNC_Shell2, roughShell_Air, 0 ] Isubstrate = algorithms.parrat(self.q, [sldSub, 0], [roughSub, 0], [sub_thickness, 0]) thickness = [ sub_thickness, thicknessSpacer, thicknessShellLower, a, thicknessShellTop, 0 ] self.z = np.linspace(-thickness[0], -thickness[0] + np.sum(thickness) + sub_thickness, 300) IparticleLayer = algorithms.parrat(self.q, sld, roughness, thickness) self.sld = algorithms.roughsld_thick_layers(self.z, sld, roughness, thickness).real self.I = self.params["i0"] * ( coverage * IparticleLayer + (1 - coverage) * Isubstrate) + self.params["bg"]
def calcModel(self): if (self.z is not None): sphere_shifts = [self.params["layerDistance1"].value,\ self.params["layerDistance2"].value,\ self.params["layerDistance3"].value,\ self.params["layerDistance4"].value,\ self.params["layerDistance5"].value,\ self.params["layerDistance6"].value] packing_densities = [self.params["packingDensity1"].value, self.params["packingDensity2"].value, self.params["packingDensity3"].value, self.params["packingDensity4"].value, self.params["packingDensity5"].value, self.params["packingDensity6"].value] sld = nanospheres.sphere_cs_overlapping_stacked( self.z, sphere_shifts, packing_densities, self.params['r'].value, self.params['d'].value, self.params['sldCore'].value, self.params['sldShell'].value, self.params['sldSubstrate'].value, self.params['sldBackground'].value) roughness = self.params["roughness"]*np.ones(len(sld)) positiveValues = self.z > 0 roughness[positiveValues] = self.params["roughnessIncrease"]*self.z[positiveValues] thickness = (self.z[1] - self.z[0])*np.ones(len(sld)) self.I = self.params["i0"] * algorithms.parrat(self.q, sld, roughness, thickness) + self.params["bg"] self.sld = algorithms.roughsld_thick_layers(self.z, sld, roughness, thickness).real
def calcModel(self): if (self.z is not None): sphere_shifts = [self.params["layerDistance"].value ] * self.params['nPeriods'] packing_densities = [self.params["packingDensity"].value ] * self.params['nPeriods'] sld = nanospheres.cmplx_sphere_cs_overlapping_stacked_with_spacer( self.z, sphere_shifts, packing_densities, self.params['r'].value, self.params['sigR'].value, self.params['d'].value, self.params['reSldCore'].value + 1j * self.params['imSldCore'].value, self.params['reSldShell'].value + 1j * self.params['imSldShell'].value, self.params['reSldSubstrate'].value + 1j * self.params['imSldSubstrate'].value, self.params['reSldBackground'].value + 1j * self.params['imSldBackground'].value) roughness = self.params["roughness"] * np.ones(len(sld)) thickness = (self.z[1] - self.z[0]) * np.ones(len(sld)) self.I = self.params["i0"] * algorithms.parrat( self.q, sld, roughness, thickness) + self.params["bg"] self.sld = algorithms.roughsld_thick_layers( self.z, sld, roughness, thickness).real
def calcModel(self): if (self.z is not None): roughness = self.params["roughness"] + self.z * self.params[ "roughnessSlope"] + self.z**2 * self.params["roughnessParab"] sld = nanospheres.sphere_csstacked_parabolic_with_spacer( self.z, self.params['layerDistance'].value, self.params['layerDistanceSlope'].value, self.params['layerDistanceParab'].value, self.params['packingDensity'].value, self.params['packingDensitySlope'].value, self.params['packingDensityParab'].value, self.params['r'].value, self.params['d'].value, self.params['dSpacer'].value, self.params['sldCore'].value, self.params['sldShell'].value, self.params['sldSubstrate'].value, self.params['sldSpacer'].value, self.params['sldBackground'].value, int(self.params['nPeriods'].value)) thickness = (self.z[1] - self.z[0]) * np.ones(len(sld)) self.I = self.params["i0"] * algorithms.parrat( self.q, sld, roughness, thickness) + self.params["bg"] self.sld = algorithms.roughsld_thick_layers( self.z, sld, roughness, thickness).real
def calcModel(self): if (self.z is not None): sphere_shifts = [self.params["layerDistance1"].value,\ self.params["layerDistance2"].value,\ self.params["layerDistance3"].value,\ self.params["layerDistance4"].value,\ self.params["layerDistance5"].value,\ self.params["layerDistance6"].value] packing_densities = [self.params["packingDensity1"].value, self.params["packingDensity2"].value, self.params["packingDensity3"].value, self.params["packingDensity4"].value, self.params["packingDensity5"].value, self.params["packingDensity6"].value] sld = nanospheres.sphere_css_overlapping_stacked_with_spacer( self.z, sphere_shifts, packing_densities, self.params['r'].value, self.params['dShell'].value, self.params['dSurfactant'].value, self.params['dSpacer'].value, (self.params['reSldCore'].value + 1j*self.params['imSldCore'].value), (self.params['reSldShell'].value + 1j*self.params['imSldShell'].value), (self.params['reSldSurfactant'].value + 1j*self.params['imSldSurfactant'].value), (self.params['reSldSubstrate'].value + 1j*self.params['imSldSubstrate'].value), (self.params['reSldSpacer'].value + 1j*self.params['imSldSpacer'].value), (self.params['reSldBackground'].value + 1j*self.params['imSldBackground'].value)) # roughness = self.params["roughness"]*np.ones(len(sld)) thickness = (self.z[1] - self.z[0])*np.ones(len(sld)) roughness = self.params["roughness"].value + self.z * self.params["roughnessSlope"].value self.I = self.params["i0"] * algorithms.parrat(self.q, sld, roughness, thickness) + self.params["bg"] self.sld = algorithms.roughsld_thick_layers(self.z, sld, roughness, thickness).real
def calcModel(self): a = self.params['a'].value pDens1 = self.params["packingDensity1"].value pDens2 = self.params["packingDensity2"].value sldSub = self.params['sldSubstrate'].value sldShellLower = self.params['sldShellLower'].value sldShellTop = self.params['sldShellTop'].value sldCore = self.params['sldCore'].value sldSpacer = self.params['sldSpacer'].value sldPMMA = self.params['sldPMMA'].value roughSub = self.params['roughnessSubstrate'].value roughnessSpacer = self.params['roughnessSpacer'].value roughnessShellCube1 = self.params['roughnessShellCube1'].value roughnessCubeShell1 = self.params['roughnessCubeShell1'].value roughnessShellPMMA = self.params['roughnessShellPMMA'].value roughnessPMMAShell = self.params['roughnessPMMAShell'].value roughnessShellCube2 = self.params['roughnessShellCube2'].value roughnessCubeShell2 = self.params['roughnessCubeShell2'].value roughnessShellAir = self.params['roughnessShellAir'].value thicknessSpacer = self.params['thicknessSpacer'].value thicknessShell1Lower = self.params['thicknessShell1Lower'].value thicknessShell1Top = self.params['thicknessShell1Top'].value thicknessPMMA = self.params['thicknessPMMA'].value thicknessShell2Lower = self.params['thicknessShell2Lower'].value thicknessShell2Top = self.params['thicknessShell2Top'].value sld = np.array([ sldSub, sldSpacer, pDens1 * sldShellLower, pDens1 * sldCore, pDens1 * sldShellTop, sldPMMA, pDens2 * sldShellLower, pDens2 * sldCore, pDens2 * sldShellTop, 0, ]) thickness = [ 2 * a, thicknessSpacer, thicknessShell1Lower, a, thicknessShell1Top, thicknessPMMA, thicknessShell2Lower, a, thicknessShell2Top, 2 * a ] roughness = [ roughSub, roughnessSpacer, roughnessShellCube1, roughnessCubeShell1, roughnessShellPMMA, roughnessPMMAShell, roughnessShellCube2, roughnessCubeShell2, roughnessShellAir, roughnessShellAir ] IparticleLayer = algorithms.parrat(self.q, sld, roughness, thickness) z = -thickness[0] + np.sum(thickness) self.z = np.linspace(-thickness[0], z, 300) self.I = self.params["i0"] * IparticleLayer + self.params["bg"] self.sld = algorithms.roughsld_thick_layers(self.z, sld, roughness, thickness).real
def calcMagneticModel(self): if (self.z is not None): sphere_shifts = [self.params["layerDistance1"].value,\ self.params["layerDistance2"].value,\ self.params["layerDistance3"].value,\ self.params["layerDistance4"].value,\ self.params["layerDistance5"].value,\ self.params["layerDistance6"].value] packing_densities = [self.params["packingDensity1"].value, self.params["packingDensity2"].value, self.params["packingDensity3"].value, self.params["packingDensity4"].value, self.params["packingDensity5"].value, self.params["packingDensity6"].value] magPacking_densities = [self.params['magDensity1'].value*self.params["packingDensity1"].value, self.params['magDensity2'].value*self.params["packingDensity2"].value, self.params['magDensity3'].value*self.params["packingDensity3"].value, self.params['magDensity4'].value*self.params["packingDensity4"].value, self.params['magDensity5'].value*self.params["packingDensity5"].value, self.params['magDensity6'].value*self.params["packingDensity6"].value] sld = nanospheres.sphere_css_overlapping_stacked_with_spacer( self.z, sphere_shifts, packing_densities, self.params['r'].value, self.params['dShell'].value, self.params['dSurfactant'].value, self.params['dSpacer'].value, self.params['sldCore'].value, self.params['sldShell'].value, self.params['sldSurfactant'].value, self.params['sldSubstrate'].value, self.params['sldSpacer'].value, self.params['sldBackground'].value) sldMag = nanospheres.sphere_css_overlapping_stacked_with_spacer( self.z, sphere_shifts, magPacking_densities, self.params['r'].value, self.params['dShell'].value, self.params['dSurfactant'].value, self.params['dSpacer'].value, self.params['magSldCore'].value, self.params['magSldShell'].value, 0, 0, 0, 0) polarization = self.params['polarization'] P = self.params['polarizationEfficiency'] thickness = (self.z[1] - self.z[0])*np.ones(len(sld)) roughness = self.params["roughness"].value + self.z * self.params["roughnessSlope"].value Rplus = algorithms.parrat(self.q, sld + sldMag, roughness, thickness) Rminus = algorithms.parrat(self.q, sld - sldMag, roughness, thickness) cosGamma = np.cos(self.params['gamma']*np.pi/180) self.I = self.params["i0"] * 0.5 * (Rplus * ( 1 + polarization*P*cosGamma) + Rminus * ( 1 - polarization*P*cosGamma ) ) + self.params["bg"] self.sld = algorithms.roughsld_thick_layers(self.z, sld, roughness, thickness).real self.sldMag = algorithms.roughsld_thick_layers(self.z, sldMag, roughness, thickness).real
def calcModel(self): sld = [self.params['sldSubstrate'].value, 0] thickness = [10 + 2.5 * self.params["roughness"].value, 0] roughness = [ self.params["roughness"].value, self.params["roughness"].value, ] Ilayer = algorithms.parrat(self.q, sld, roughness, thickness) self.z = np.linspace(-10 - 2.5 * self.params["roughness"].value, (10 + 2.5 * self.params["roughness"].value), 100) self.I = self.params["i0"] * Ilayer + self.params["bg"] self.sld = algorithms.roughsld_thick_layers(self.z, sld, roughness, thickness).real
def calcModel(self): a = self.params['a'].value sigA = self.params['sigA'].value pDens = self.params["packingDensity"].value thicknessSpacer = self.params['thicknessSpacer'].value thicknessShellLower = self.params['thicknessShellLower'].value thicknessShellTop = self.params['thicknessShellTop'].value reSldShellLower = self.params['reSldShellLower'].value reSldShellTop = self.params['reSldShellTop'].value reSldSub = self.params['reSldSubstrate'].value reSldSpacer = self.params['reSldSpacer'].value reSldCore = self.params['reSldCore'].value imSldShellLower = self.params['imSldShellLower'].value imSldShellTop = self.params['imSldShellTop'].value imSldSub = self.params['imSldSubstrate'].value imSldSpacer = self.params['imSldSpacer'].value imSldCore = self.params['imSldCore'].value coverage = self.params['coverage'].value roughSub = self.params['roughnessSubstrate'].value roughSpacer = self.params['roughnessSpacer'].value roughNC_Shell1 = self.params["roughnessShellCube"].value roughNC_Shell2 = self.params["roughnessCubeShell"].value if thicknessShellTop > 0: roughShell_Air = self.params["roughnessShellAir"].value else: roughShell_Air = roughNC_Shell2 sub_thickness = 10 + 2.5 * max(roughSub, roughNC_Shell2, roughShell_Air) sld = np.array([ (reSldSub - 1j * imSldSub), (reSldSpacer - 1j * imSldSpacer), (reSldShellLower - 1j * imSldShellLower), pDens * (reSldCore - 1j * imSldCore), (reSldShellTop - 1j * imSldShellTop), 0, ]) roughness = [ roughSub, roughSpacer, roughNC_Shell1, roughNC_Shell2, roughShell_Air, 0 ] Isubstrate = algorithms.parrat(self.q, [reSldSub - 1j * imSldSub, 0], [roughSub, 0], [sub_thickness, 0]) thickness = [ sub_thickness, thicknessSpacer, thicknessShellLower, a, thicknessShellTop, 0 ] self.z = np.linspace(-thickness[0], -thickness[0] + np.sum(thickness) + sub_thickness, 300) IparticleLayer = algorithms.parrat(self.q, sld, roughness, thickness) self.sld = algorithms.roughsld_thick_layers(self.z, sld, roughness, thickness).real if sigA > 0: x_herm, w_herm = hermgauss(int(self.params['orderHermite'])) w_sum = 0 a_vals = a * np.exp(np.sqrt(2) * x_herm * sigA) IparticleLayer = np.zeros(len(self.q)) rough_sld = np.zeros(len(self.z)) for i, w_i in enumerate(w_herm): thickness = [ sub_thickness, thicknessSpacer, thicknessShellLower, a_vals[i], thicknessShellTop, 0 ] IparticleLayer += w_i * algorithms.parrat( self.q, sld, roughness, thickness) rough_sld += w_i * algorithms.roughsld_thick_layers( self.z, sld, roughness, thickness).real w_sum += w_i IparticleLayer /= w_sum self.sld = rough_sld / w_sum self.I = self.params["i0"] * ( coverage * IparticleLayer + (1 - coverage) * Isubstrate) + self.params["bg"]
def calcModel(self): a = self.params['a'].value sigA = self.params['sigA'].value pDens1 = self.params["packingDensity1"].value pDens2 = self.params["packingDensity2"].value thicknessPMMA = self.params['thicknessPMMA'].value thicknessSpacer = self.params['thicknessSpacer'].value thicknessShell1Lower = self.params['thicknessShell1Lower'].value thicknessShell1Top = self.params['thicknessShell1Top'].value thicknessShell2Lower = self.params['thicknessShell2Lower'].value thicknessShell2Top = self.params['thicknessShell2Top'].value reSldShellLower = self.params['reSldShellLower'].value reSldShellTop = self.params['reSldShellTop'].value reSldSub = self.params['reSldSubstrate'].value reSldSpacer = self.params['reSldSpacer'].value reSldCore = self.params['reSldCore'].value reSldPMMA = self.params['reSldPMMA'].value imSldShellLower = self.params['imSldShellLower'].value imSldShellTop = self.params['imSldShellTop'].value imSldSub = self.params['imSldSubstrate'].value imSldSpacer = self.params['imSldSpacer'].value imSldCore = self.params['imSldCore'].value imSldPMMA = self.params['imSldPMMA'].value coverage = self.params['coverage'].value roughSub = self.params['roughnessSubstrate'].value roughSpacer = self.params['roughnessSpacer'].value roughNC1_Shell1 = self.params["roughnessShellCube1"].value roughNC1_Shell2 = self.params["roughnessCubeShell1"].value roughShell_PMMA = self.params["roughnessShellPMMA"].value roughNC2_Shell1 = self.params["roughnessShellCube2"].value roughNC2_Shell2 = self.params["roughnessCubeShell2"].value roughnessPMMA = self.params['roughnessPMMA'].value if thicknessShell2Top > 0: roughShell_Air = self.params["roughnessShellAir"].value else: roughShell_Air = roughNC2_Shell2 sub_thickness = 10 + 2.5 * max(roughSub, roughNC2_Shell2, roughShell_Air) sld = np.array([ (reSldSub - 1j * imSldSub), (reSldSpacer - 1j * imSldSpacer), (reSldShellLower - 1j * imSldShellLower), pDens1 * (reSldCore - 1j * imSldCore), (reSldShellTop - 1j * imSldShellTop), (reSldPMMA - 1j * imSldPMMA), (reSldShellLower - 1j * imSldShellLower), pDens2 * (reSldCore - 1j * imSldCore), (reSldShellTop - 1j * imSldShellTop), 0, ]) roughness = [ roughSub, roughSpacer, roughNC1_Shell1, roughNC1_Shell2, roughShell_PMMA, roughnessPMMA, roughNC2_Shell1, roughNC2_Shell2, roughShell_Air, 0 ] Isubstrate = algorithms.parrat(self.q, [reSldSub - 1j * imSldSub, 0], [roughSub, 0], [sub_thickness, 0]) thickness = [ sub_thickness, thicknessSpacer, thicknessShell1Lower, a, thicknessShell1Top, thicknessPMMA, thicknessShell2Lower, a, thicknessShell2Top, 0 ] self.z = np.linspace(-thickness[0], -thickness[0] + np.sum(thickness) + sub_thickness, 300) IparticleLayer = algorithms.parrat(self.q, sld, roughness, thickness) self.sld = algorithms.roughsld_thick_layers(self.z, sld, roughness, thickness).real self.I = self.params["i0"] * ( coverage * IparticleLayer + (1 - coverage) * Isubstrate) + self.params["bg"]
def calcMagneticModel(self): a = self.params['a'].value d = self.params['d'].value pDens1 = self.params["packingDensity1"].value pDens2 = self.params["packingDensity2"].value sldSub = self.params['sldSubstrate'].value sldShell = self.params['sldShell'].value sldCore = self.params['sldCore'].value sldSpacer = self.params['sldSpacer'].value magSldCore = self.params['magSldCore'].value coverage = self.params['coverage'].value roughSub = self.params['roughnessSubstrate'].value roughLayer1 = roughSub + self.params["roughnessPlus1"].value roughLayer2 = roughLayer1 + self.params["roughnessPlus2"].value spacerThickness = self.params['spacerThickness'].value sld = np.array([ sldSub, pDens1 * sldShell, pDens1 * sldCore, pDens1 * sldShell, sldSpacer, pDens2 * sldShell, pDens2 * sldCore, pDens2 * sldShell, 0, ]) sldMag = np.array([ 0, 0, pDens1 * magSldCore, 0, 0, 0, pDens2 * magSldCore, 0, 0, ]) thickness = [2 * a, d, a, d, spacerThickness, d, a, d, 2 * a] roughness = [ roughSub, roughLayer1, roughLayer1, roughLayer1, roughLayer1, roughLayer2, roughLayer2, roughLayer2, roughLayer2 ] IparticleLayer = algorithms.parrat( self.q, sld + self.params['polarization'] * sldMag, roughness, thickness) Isubstrate = algorithms.parrat(self.q, [sldSub, 0], [roughSub, roughSub], [2 * a, 2 * a]) z = -thickness[0] + np.sum(thickness) self.z = np.linspace(-thickness[0], z, 300) self.I = self.params["i0"] * ( self.params['coverage'] * IparticleLayer + (1 - self.params['coverage']) * Isubstrate) + self.params["bg"] self.sld = algorithms.roughsld_thick_layers(self.z, sld, roughness, thickness).real self.sldMag = algorithms.roughsld_thick_layers(self.z, sldMag, roughness, thickness).real