def multilayer(self): """ Constructs the sample from current parameter values. """ # defining materials m_air = ba.HomogeneousMaterial("Air", 0.0, 0.0) m_Si = ba.HomogeneousMaterial("Si", 5.78164736e-6, 1.02294578e-7) m_Ag = ba.HomogeneousMaterial("Ag", 2.24749529E-5, 1.61528396E-6) m_PTFE = ba.HomogeneousMaterial("PTFE", 5.20508729E-6, 1.96944292E-8) m_HMDSO = ba.HomogeneousMaterial("HMDSO", 2.0888308E-6, 1.32605651E-8) # collection of particles with size distribution nparticles = 20 nfwhm = 2.0 sphere_ff = ba.FormFactorFullSphere(self.radius) sphere = ba.Particle(m_Ag, sphere_ff) position = ba.kvector_t(0 * ba.nm, 0 * ba.nm, -1.0 * self.hmdso_thickness) sphere.setPosition(position) ln_distr = ba.DistributionLogNormal(self.radius, self.sigma) par_distr = ba.ParameterDistribution( "/Particle/FullSphere/Radius", ln_distr, nparticles, nfwhm, ba.RealLimits.limited(0.0, self.hmdso_thickness / 2.0)) part_coll = ba.ParticleDistribution(sphere, par_distr) # interference function interference = ba.InterferenceFunctionRadialParaCrystal( self.distance, 1e6 * ba.nm) interference.setKappa(self.kappa) interference.setDomainSize(20000.0) pdf = ba.FTDistribution1DGauss(self.disorder) interference.setProbabilityDistribution(pdf) # assembling particle layout layout = ba.ParticleLayout() layout.addParticle(part_coll, 1.0) layout.setInterferenceFunction(interference) layout.setTotalParticleSurfaceDensity(1) # roughness r_ptfe = ba.LayerRoughness(2.3 * ba.nm, 0.3, 5.0 * ba.nm) r_hmdso = ba.LayerRoughness(1.1 * ba.nm, 0.3, 5.0 * ba.nm) # layers air_layer = ba.Layer(m_air) hmdso_layer = ba.Layer(m_HMDSO, self.hmdso_thickness) hmdso_layer.addLayout(layout) ptfe_layer = ba.Layer(m_PTFE, self.ptfe_thickness) substrate_layer = ba.Layer(m_Si) # assembling multilayer multi_layer = ba.MultiLayer() multi_layer.addLayer(air_layer) multi_layer.addLayerWithTopRoughness(hmdso_layer, r_hmdso) multi_layer.addLayerWithTopRoughness(ptfe_layer, r_ptfe) multi_layer.addLayer(substrate_layer) return multi_layer
def get_simulation(): """ Returns a GISAXS simulation with beam (+ divergence) and detector defined. """ simulation = ba.GISASSimulation() simulation.setDetectorParameters(100, 0.0 * deg, 2.0 * deg, 100, 0.0 * deg, 2.0 * deg) simulation.setBeamParameters(1.0 * angstrom, 0.2 * deg, 0.0 * deg) wavelength_distr = ba.DistributionLogNormal(1.0 * angstrom, 0.1) alpha_distr = ba.DistributionGaussian(0.2 * deg, 0.1 * deg) phi_distr = ba.DistributionGaussian(0.0 * deg, 0.1 * deg) simulation.addParameterDistribution("*/Beam/Wavelength", wavelength_distr, 5) simulation.addParameterDistribution("*/Beam/InclinationAngle", alpha_distr, 5) simulation.addParameterDistribution("*/Beam/AzimuthalAngle", phi_distr, 5) return simulation