def get_sample(): """ Defines sample and returns it. Note that SLD-based materials are used. """ # creating materials m_ambient = ba.MaterialBySLD("Ambient", 0.0, 0.0) m_ti = ba.MaterialBySLD("Ti", -1.9493e-06, 0.0) m_ni = ba.MaterialBySLD("Ni", 9.4245e-06, 0.0) m_substrate = ba.MaterialBySLD("SiSubstrate", 2.0704e-06, 0.0) # creating layers ambient_layer = ba.Layer(m_ambient) ti_layer = ba.Layer(m_ti, 30 * angstrom) ni_layer = ba.Layer(m_ni, 70 * angstrom) substrate_layer = ba.Layer(m_substrate) # creating multilayer multi_layer = ba.MultiLayer() multi_layer.addLayer(ambient_layer) for i in range(10): multi_layer.addLayer(ti_layer) multi_layer.addLayer(ni_layer) multi_layer.addLayer(substrate_layer) return multi_layer
def get_sample(params): """ construct the sample with the given parameters """ magnetizationMagnitude = params["rhoM_Mafo"] * 1e-6 / RhoMconst angle = 0 magnetizationVector = ba.kvector_t( magnetizationMagnitude * numpy.sin(angle * deg), magnetizationMagnitude * numpy.cos(angle * deg), 0) mat_vacuum = ba.MaterialBySLD("Vacuum", 0.0, 0.0) mat_layer = ba.MaterialBySLD("(Mg,Al,Fe)3O4", params["rho_Mafo"] * 1e-6, 0, magnetizationVector) mat_substrate = ba.MaterialBySLD("MgAl2O4", *sldMao) ambient_layer = ba.Layer(mat_vacuum) layer = ba.Layer(mat_layer, params["t_Mafo"] * angstrom) substrate_layer = ba.Layer(mat_substrate) r_Mafo = ba.LayerRoughness() r_Mafo.setSigma(params["r_Mafo"] * angstrom) r_substrate = ba.LayerRoughness() r_substrate.setSigma(params["r_Mao"] * angstrom) multi_layer = ba.MultiLayer() multi_layer.addLayer(ambient_layer) multi_layer.addLayerWithTopRoughness(layer, r_Mafo) multi_layer.addLayerWithTopRoughness(substrate_layer, r_substrate) return multi_layer
def get_sample(slabs): """ Defines sample and returns it. Note that SLD-based materials are used. """ # creating materials multi_layer = ba.MultiLayer() ambient = ba.MaterialBySLD("ma", slabs[0, 1] * 1e-6, 0) layer = ba.Layer(ambient) multi_layer.addLayer(layer) for slab in slabs[1:-1]: material = ba.MaterialBySLD("stuff", slab[1] * 1e-6, slab[2] * 1e-6) layer = ba.Layer(material, slab[0] * angstrom) roughness = ba.LayerRoughness() roughness.setSigma(slab[3] * angstrom) multi_layer.addLayerWithTopRoughness(layer, roughness) substrate = ba.MaterialBySLD("msub", slabs[-1, 1] * 1e-6, 0) layer = ba.Layer(substrate) roughness = ba.LayerRoughness() roughness.setSigma(slabs[-1, 3] * angstrom) multi_layer.addLayerWithTopRoughness(layer, roughness) multi_layer.setRoughnessModel(ba.RoughnessModel.NEVOT_CROCE) return multi_layer
def get_sample(bilayers, interfacewidth, crosscorrlength, lattcorrlength): """ Returns a sample with two layers on a substrate, with correlated roughnesses. """ # defining materials m_ambience = ba.HomogeneousMaterial("ambience", 0.0, 0.0) m_Ni = ba.MaterialBySLD("Ni", -1.9493e-06, 0.0) m_Ti = ba.MaterialBySLD("Ti", 9.4245e-06, 0.0) m_substrate = ba.MaterialBySLD("Substrate", 2.0704e-06, 0.0) # defining layers l_ambience = ba.Layer(m_ambience) l_Ni = ba.Layer(m_Ni, 22 * angstrom) l_Ti = ba.Layer(m_Ti, 26 * angstrom) l_substrate = ba.Layer(m_substrate) roughness = ba.LayerRoughness() roughness.setSigma(interfacewidth * angstrom) roughness.setHurstParameter(0.8) roughness.setLatteralCorrLength(lattcorrlength * angstrom) my_sample = ba.MultiLayer() # adding layers my_sample.addLayer(l_ambience) n_repetitions = bilayers for i in range(n_repetitions): my_sample.addLayerWithTopRoughness(l_Ni, roughness) my_sample.addLayerWithTopRoughness(l_Ti, roughness) my_sample.addLayerWithTopRoughness(l_substrate, roughness) my_sample.setCrossCorrLength(crosscorrlength * angstrom) print(my_sample.treeToString()) return my_sample
def get_sample(): """ Defines sample and returns it """ # creating materials magnetizationMagnitude = 1e8 angle = 30 * deg magnetizationVector = ba.kvector_t( magnetizationMagnitude * numpy.sin(angle), magnetizationMagnitude * numpy.cos(angle), 0) m_ambient = ba.MaterialBySLD("Ambient", 0.0, 0.0) m_layer_mat = ba.MaterialBySLD("Layer", 1e-4, 1e-8, magnetizationVector) m_substrate = ba.MaterialBySLD("Substrate", 7e-5, 2e-6) # creating layers ambient_layer = ba.Layer(m_ambient) layer = ba.Layer(m_layer_mat, 10) substrate_layer = ba.Layer(m_substrate) # creating multilayer multi_layer = ba.MultiLayer() multi_layer.addLayer(ambient_layer) multi_layer.addLayer(layer) multi_layer.addLayer(substrate_layer) return multi_layer
def get_sample(*, magnetization=magnetizationVector): """ Define sample and returns it """ # create materials mat_vacuum = ba.MaterialBySLD("Vacuum", 0.0, 0.0) mat_Pd = ba.MaterialBySLD("Pd", *sldPd) mat_Fe = ba.MaterialBySLD("Fe", *sldFe, magnetizationVector) mat_substrate = ba.MaterialBySLD("MgO", *sldMgO) # create layers layer_vacuum = ba.Layer( mat_vacuum ) layer_Pd = ba.Layer( mat_Pd, 120 * angstrom ) layer_Fe = ba.Layer( mat_Fe, 1000 * angstrom ) layer_substrate = ba.Layer( mat_substrate ) roughness = ba.LayerRoughness() roughness.setSigma( 20 * angstrom) # create sample multi_layer = ba.MultiLayer() multi_layer.addLayer(layer_vacuum) multi_layer.addLayerWithTopRoughness(layer_Pd, roughness) multi_layer.addLayerWithTopRoughness(layer_Fe, roughness) multi_layer.addLayerWithTopRoughness(layer_substrate, roughness) return multi_layer
def get_sample(): """ Defines sample and returns it """ # creating materials m_ambient = ba.MaterialBySLD("Ambient", 0.0, 0.0) m_ti = ba.MaterialBySLD("Ti", -1.9493e-06, 0.0) m_ni = ba.MaterialBySLD("Ni", 9.4245e-06, 0.0) m_substrate = ba.MaterialBySLD("SiSubstrate", 2.0704e-06, 0.0) # creating layers ambient_layer = ba.Layer(m_ambient) ti_layer = ba.Layer(m_ti, 30 * angstrom) ni_layer = ba.Layer(m_ni, 70 * angstrom) substrate_layer = ba.Layer(m_substrate) # create roughness roughness = ba.LayerRoughness(5 * angstrom, 0.5, 10 * angstrom) # creating multilayer multi_layer = ba.MultiLayer() multi_layer.addLayer(ambient_layer) for i in range(4): multi_layer.addLayerWithTopRoughness(ti_layer, roughness) multi_layer.addLayerWithTopRoughness(ni_layer, roughness) multi_layer.addLayer(substrate_layer) return multi_layer
def get_sample(): """ Constructs a sample with one resonating Ti/Pt layer """ # define materials m_Si = ba.MaterialBySLD("Si", 2.07e-06, 2.38e-11) m_Ti = ba.MaterialBySLD("Ti", 2.8e-06, 5.75e-10) m_Pt = ba.MaterialBySLD("Pt", 6.36e-06, 1.9e-09) m_TiO2 = ba.MaterialBySLD("TiO2", 2.63e-06, 5.4e-10) m_D2O = ba.MaterialBySLD("D2O", 6.34e-06, 1.13e-13) # create layers l_Si = ba.Layer(m_Si) l_Ti = ba.Layer(m_Ti, 130.0 * angstrom) l_Pt = ba.Layer(m_Pt, 320.0 * angstrom) l_Ti_top = ba.Layer(m_Ti, 100.0 * angstrom) l_TiO2 = ba.Layer(m_TiO2, 30.0 * angstrom) l_D2O = ba.Layer(m_D2O) # construct sample sample = ba.MultiLayer() sample.addLayer(l_Si) # put your code here (1 line), take care of correct indents sample.addLayer(l_Ti) sample.addLayer(l_Pt) sample.addLayer(l_Ti_top) sample.addLayer(l_TiO2) sample.addLayer(l_D2O) return sample
def get_sample(radius=153.4, d=1000.0): # Defining Materials material_1 = ba.HomogeneousMaterial("Air", 0.0, 0.0) material_3 = ba.MaterialBySLD("Si", 2.0737e-06, -2.3758e-11) material_2 = ba.MaterialBySLD("Au", 4.6665e-06, -1.6205e-08) # Defining Layers layer_1 = ba.Layer(material_1) # Defining Form Factors formFactor = ba.FormFactorCone6(radius * ba.nm, 300.0 * ba.nm, 81.0 * ba.deg) # Defining Particles particle = ba.Particle(material_3, formFactor) interference = ba.InterferenceFunctionRadialParaCrystal( d * ba.nm, 2e3 * ba.nm) pdf = ba.FTDistribution1DGauss(250.0 * ba.nm) interference.setProbabilityDistribution(pdf) # Defining Particle Layouts and adding Particles layout_1 = ba.ParticleLayout() layout_1.addParticle(particle, 1.0) layout_1.setTotalParticleSurfaceDensity(0.01) layout_1.setInterferenceFunction(interference) # Adding layouts to layers layer_1.addLayout(layout_1) # Defining Multilayers multiLayer_1 = ba.MultiLayer() multiLayer_1.addLayer(layer_1) return multiLayer_1
def get_sample(params): # function which constructs the sample radius = params["radius"] height = params["height"] height_flattening = (params["height"] / params["radius"]) * params["height_flattening_ratio"] lattice_length = params["lattice_length"] damping_length = params["damping_length"] disorder_parameter = params["disorder_parameter"] # Defining materials: m_air = ba.MaterialBySLD("Air", 0.0, 0.0) m_Cu = ba.MaterialBySLD("Cu", 6.9508e-05, 5.142e-06) m_PEO = ba.MaterialBySLD("PEO", 1.0463e-05, 7.9515e-09) #m_SiO2 = ba.MaterialBySLD("SiO2", 1.8749e-05, 9.3923e-08) #m_Si = ba.MaterialBySLD("Si", 1.9893e-05, 1.795e-07) # Defining particles: tr_spheroid_ff = ba.FormFactorTruncatedSpheroid(radius, height, height_flattening) particle = ba.Particle(m_Cu, tr_spheroid_ff) # Defining interference function: interference_f = ba.InterferenceFunctionRadialParaCrystal( lattice_length, damping_length) omega = disorder_parameter * lattice_length pdf = ba.FTDistribution1DGauss(omega) interference_f.setProbabilityDistribution(pdf) # Defining layers: layout = ba.ParticleLayout() layout.addParticle(particle, 1.0) layout.setInterferenceFunction(interference_f) layout.setTotalParticleSurfaceDensity( 2 / (math.sqrt(3) * lattice_length * lattice_length)) air_layer = ba.Layer(m_air) air_layer.setNumberOfSlices(15) air_layer.addLayout(layout) PEO_layer = ba.Layer(m_PEO) #PEO_layer = ba.Layer(m_PEO, 90*nm) #Si_layer = ba.Layer(m_Si) #roughness = ba.LayerRoughness() #roughness.setSigma(10.0*nm) #roughness.setHurstParameter(1.0) #roughness.setLatteralCorrLength(1.0e-5*nm) # Assembling the multilayer: multi_layer = ba.MultiLayer() multi_layer.addLayer(air_layer) multi_layer.addLayer(PEO_layer) #multi_layer.addLayerWithTopRoughness(PEO_layer, roughness) #multi_layer.addLayer(Si_layer) return multi_layer
def get_sample(): # Defining Materials material_1 = ba.HomogeneousMaterial("Air", 0.0, 0.0) material_2 = ba.MaterialBySLD("Au", 4.6665e-06, -1.6205e-08) material_3 = ba.MaterialBySLD("Si", 2.0737e-06, -2.3758e-11) # Defining Layers layer_1 = ba.Layer(material_1) layer_2 = ba.Layer(material_3) formFactor_1 = ba.FormFactorCone6(159.0 * nm, 640.0 * nm, 86.0 * deg) formFactor_2 = ba.FormFactorCone6(157.0 * nm, 640.0 * nm, 86.0 * deg) formFactor_3 = ba.FormFactorTruncatedSphere(115.0 * nm, 160.0 * nm, 0.0 * nm) particle_1 = ba.Particle(material_2, formFactor_1) particle_2 = ba.Particle(material_3, formFactor_2) particle_3 = ba.Particle(material_2, formFactor_3) particle_3_position = kvector_t(0.0 * nm, 0.0 * nm, 640.0 * nm) particle_3.setPosition(particle_3_position) # Defining Core Shell Particles particleCoreShell_1 = ba.ParticleCoreShell(particle_2, particle_1) particleCoreShell_1_rotation = ba.RotationZ(0 * deg) particleCoreShell_1.setRotation(particleCoreShell_1_rotation) # Defining composition of particles at specific positions particleComposition_1 = ba.ParticleComposition() particleComposition_1.addParticle(particleCoreShell_1) particleComposition_1.addParticle(particle_3) particleComposition_1_rotation = ba.RotationX(0.0 * deg) particleComposition_1.setRotation(particleComposition_1_rotation) # Defining Interference Functions interference_1 = ba.InterferenceFunction2DLattice( 1500.0 * nm, 1500.0 * nm, 120.0 * deg, i * deg) interference_1_pdf = ba.FTDecayFunction2DCauchy( 1000.0 * nm, 1000.0 * nm, 0.0 * deg) interference_1.setDecayFunction(interference_1_pdf) interference_1.setPositionVariance(500.0 * nm2) # Defining Particle Layouts and adding Particles layout_1 = ba.ParticleLayout() layout_1.addParticle(particleComposition_1, 1.0) layout_1.setInterferenceFunction(interference_1) layout_1.setTotalParticleSurfaceDensity(0.000001) # Adding layouts to layers layer_1.addLayout(layout_1) # Defining Multilayers multiLayer_1 = ba.MultiLayer() multiLayer_1.addLayer(layer_1) multiLayer_1.addLayer(layer_2) return multiLayer_1
def get_sample(): # Defining Materials material_1 = ba.HomogeneousMaterial("Air", 0.0, 0.0) material_2 = ba.MaterialBySLD("Au", 4.6665e-06, -1.6205e-08) material_3 = ba.MaterialBySLD("Si", 2.0737e-06, -2.3758e-11) material_4 = ba.MaterialBySLD("Fe", 7.9486e-06, -5.9880e-10) # Defining Layers layer_1 = ba.Layer(material_1) layer_2 = ba.Layer(material_3) formFactor_1 = ba.FormFactorCone6(85 * nm, 385.0 * nm, 86.0 * deg) formFactor_2 = ba.FormFactorCone6(84 * nm, 385.0 * nm, 86.0 * deg) formFactor_3 = ba.FormFactorTruncatedSphere(68.0 * nm, 95.0 * nm, 0.0 * nm) particle_1 = ba.Particle(material_4, formFactor_1) particle_2 = ba.Particle(material_3, formFactor_2) particle_3 = ba.Particle(material_2, formFactor_3) particle_3_position = kvector_t(0.0 * nm, 0.0 * nm, 385.0 * nm) particle_3.setPosition(particle_3_position) # Defining Core Shell Particles particleCoreShell_1 = ba.ParticleCoreShell(particle_2, particle_1) particleCoreShell_1_rotation = ba.RotationZ(i * deg) particleCoreShell_1.setRotation(particleCoreShell_1_rotation) # Defining composition of particles at specific positions particleComposition_1 = ba.ParticleComposition() particleComposition_1.addParticle(particleCoreShell_1) particleComposition_1.addParticle(particle_3) particleComposition_1_rotation = ba.RotationX(0.0 * deg) particleComposition_1.setRotation(particleComposition_1_rotation) # Defining Particle Layouts and adding Particles layout_1 = ba.ParticleLayout() layout_1.addParticle(particleComposition_1, 1.0) layout_1.setTotalParticleSurfaceDensity(0.01) # Adding layouts to layers layer_1.addLayout(layout_1) # Defining Multilayers multiLayer_1 = ba.MultiLayer() multiLayer_1.addLayer(layer_1) multiLayer_1.addLayer(layer_2) return multiLayer_1
def get_iron_oxide(wavelength): oxide = pt.formula("Fe2O3") dens = 5.24 rho, mu = pt.xray_sld(oxide, density=dens, wavelength=wavelength / angstrom) return ba.MaterialBySLD("Fe203", rho * 1e-6, mu * 1e-6)
def get_si(wavelength): si = pt.formula("Si") dens = pt.Si.density rho, mu = pt.xray_sld(si, density=pt.Si.density, wavelength=wavelength / angstrom) return ba.MaterialBySLD("si", rho * 1e-6, mu * 1e-6)
def get_sample(): """ Returns a sample """ # defining materials m_si = ba.MaterialBySLD("Si", sld_Si, sld_Si_im) m_d2o = ba.MaterialBySLD("D2O", sld_D2O, sld_D2O_im) m_polymer = ba.MaterialBySLD("Polymer", sld_polymer, sld_polymer_im) # particle layout microgel_layout = ba.ParticleLayout() # weights for components w_particles = 0.005 w_oz = 0.5 w_db = 1.0 - w_oz - w_particles # fluctuation component ff_oz = ba.FormFactorOrnsteinZernike(1000, 10.0 * nm, 5.0 * nm) particle_oz = ba.Particle(m_polymer, ff_oz) microgel_layout.addParticle(particle_oz, w_oz) # Debye-Buche component ff_db = ba.FormFactorDebyeBueche(1000, 20.0 * nm) particle_db = ba.Particle(m_polymer, ff_db) microgel_layout.addParticle(particle_db, w_db) # collection of particles radius = 100.0 * nm ff = ba.FormFactorTruncatedSphere(radius=radius, height=radius) particle = ba.Particle(m_polymer, ff) particle.setPosition(ba.kvector_t(0.0, 0.0, -1.0 * radius)) microgel_layout.addParticle(particle, w_particles) # no interference function interference = ba.InterferenceFunctionNone() microgel_layout.setInterferenceFunction(interference) microgel_layout.setTotalParticleSurfaceDensity(1e-6) d2o_layer = ba.Layer(m_d2o) d2o_layer.addLayout(microgel_layout) si_layer = ba.Layer(m_si) multi_layer = ba.MultiLayer() multi_layer.addLayer(si_layer) multi_layer.addLayer(d2o_layer) return multi_layer
def add_slices(multilayer): dz = h / nslices zvals = np.linspace(0, h, nslices, endpoint=False) + 0.5 * dz for z in zvals: sld = get_sld(z) material = ba.MaterialBySLD("Polymer_{:.1f}".format(z), sld, 0.0) layer = ba.Layer(material, dz) multilayer.addLayer(layer)
def get_si(self, wavelength): si = pt.formula("Si") dens = pt.Si.density rho, mu = pt.xray_sld(si, density=pt.Si.density, wavelength=wavelength / angstrom) rho *= 1e-6 mu *= 1e-6 print("MaterialLibrary > wavelength:{0} formula:{1} density:{2} rho:{3} mu:{4}".format(wavelength, si, dens, rho, mu)) return ba.MaterialBySLD("si", rho, mu)
def get_sample(): # defining materials m_vacuum = ba.MaterialBySLD("Vacuum", 0.0, 0.0) m_ni = ba.MaterialBySLD("Ni", ni_sld_real, 0.0) m_ti = ba.MaterialBySLD("Ti", ti_sld_real, 0.0) m_substrate = ba.MaterialBySLD("SiSubstrate", si_sld_real, 0.0) vacuum_layer = ba.Layer(m_vacuum) ni_layer = ba.Layer(m_ni, d_ni) ti_layer = ba.Layer(m_ti, d_ti) substrate_layer = ba.Layer(m_substrate) multi_layer = ba.MultiLayer() multi_layer.addLayer(vacuum_layer) for i in range(n_repetitions): multi_layer.addLayer(ti_layer) multi_layer.addLayer(ni_layer) multi_layer.addLayer(substrate_layer) return multi_layer
def get_iron_oxide(self, wavelength): oxide = pt.formula("Fe2O3") dens = 5.24 rho, mu = pt.xray_sld(oxide, density=dens, wavelength=wavelength / angstrom) rho *= 1e-6 mu *= 1e-6 print("MaterialLibrary > wavelength:{0} formula:{1} density:{2} rho:{3} mu:{4}".format(wavelength, oxide, dens, rho, mu)) return ba.MaterialBySLD("Fe203", rho, mu)
def get_sample(): # defining materials m_air = ba.MaterialBySLD("Air", 0.0, 0.0) m_ni = ba.MaterialBySLD("Ni", density_ni * bc_ni, 0.0) m_ti = ba.MaterialBySLD("Ti", density_ti * bc_ti, 0.0) m_substrate = ba.MaterialBySLD("SiSubstrate", density_si * bc_si, 0.0) air_layer = ba.Layer(m_air) ni_layer = ba.Layer(m_ni, d_ni) ti_layer = ba.Layer(m_ti, d_ti) substrate_layer = ba.Layer(m_substrate) multi_layer = ba.MultiLayer() multi_layer.addLayer(air_layer) for i in range(n_repetitions): multi_layer.addLayer(ti_layer) multi_layer.addLayer(ni_layer) multi_layer.addLayer(substrate_layer) return multi_layer
def get_sample(): # Defining Materials m_Si = ba.MaterialBySLD("Si", sld_Si, 0.0) m_Polymer = ba.MaterialBySLD("Polymer-0", sld_polymer, 0.0) m_D2O = ba.MaterialBySLD("D2O", sld_D2O, 0.0) # Defining Layers layer_si = ba.Layer(m_Si) layer_polymer = ba.Layer(m_Polymer, 2.0 * nm) layer_d2o = ba.Layer(m_D2O) # Defining Multilayers multiLayer = ba.MultiLayer() multiLayer.addLayer(layer_si) multiLayer.addLayer(layer_polymer) add_slices(multiLayer) multiLayer.addLayer(layer_d2o) return multiLayer
def get_sample(): # defining materials m_air = ba.MaterialBySLD() m_ni = ba.MaterialBySLD("Ni", ni_sld_real, 0.0) m_ti = ba.MaterialBySLD("Ti", ti_sld_real, 0.0) m_substrate = ba.MaterialBySLD("SiSubstrate", si_sld_real, 0.0) # air layer and substrate form multi layer air_layer = ba.Layer(m_air) ni_layer = ba.Layer(m_ni, d_ni) ti_layer = ba.Layer(m_ti, d_ti) substrate_layer = ba.Layer(m_substrate) multi_layer = ba.MultiLayer() multi_layer.addLayer(air_layer) for i in range(n_repetitions): multi_layer.addLayer(ti_layer) multi_layer.addLayer(ni_layer) multi_layer.addLayer(substrate_layer) return multi_layer
def get_sample(): # defining materials # this example implies beam divergence in the wavelength, # thus MaterialBySLD must be used to provide correct result m_air = ba.MaterialBySLD("Air", 0.0, 0.0) m_ni = ba.MaterialBySLD("Ni", ni_sld_real, 0.0) m_ti = ba.MaterialBySLD("Ti", ti_sld_real, 0.0) m_substrate = ba.MaterialBySLD("SiSubstrate", si_sld_real, 0.0) air_layer = ba.Layer(m_air) ni_layer = ba.Layer(m_ni, d_ni) ti_layer = ba.Layer(m_ti, d_ti) substrate_layer = ba.Layer(m_substrate) multi_layer = ba.MultiLayer() multi_layer.addLayer(air_layer) for i in range(n_repetitions): multi_layer.addLayer(ti_layer) multi_layer.addLayer(ni_layer) multi_layer.addLayer(substrate_layer) return multi_layer
def get_sample(): # Defining Materials material_1 = ba.HomogeneousMaterial("Air", 0.0, 0.0) material_2 = ba.MaterialBySLD("Au", 4.6665e-06, -1.6205e-08) material_3 = ba.MaterialBySLD("Si", 2.0737e-06, -2.3758e-11) # Defining Layers layer_1 = ba.Layer(material_1) layer_2 = ba.Layer(material_3) # Defining Form Factors formFactor_1 = ba.FormFactorCone6(90.0 * nm, 270.0 * nm, 75.0 * deg) formFactor_2 = ba.FormFactorCone6(88.0 * nm, 270.0 * nm, 75.0 * deg) # Defining Particles particle_1 = ba.Particle(material_2, formFactor_1) particle_2 = ba.Particle(material_3, formFactor_2) # Defining Core Shell Particles particleCoreShell_1 = ba.ParticleCoreShell(particle_2, particle_1) particleCoreShell_1_rotation = ba.RotationZ(i * deg) particleCoreShell_1.setRotation(particleCoreShell_1_rotation) # Defining Particle Layouts and adding Particles layout_1 = ba.ParticleLayout() layout_1.addParticle(particleCoreShell_1, 1.0) layout_1.setTotalParticleSurfaceDensity(0.0001) # Defining Roughness Parameters # layerRoughness_1 = ba.LayerRoughness(1.0, 0.3, 5.0*nm) # Adding layouts to layers layer_1.addLayout(layout_1) # Defining Multilayers multiLayer_1 = ba.MultiLayer() multiLayer_1.addLayer(layer_1) multiLayer_1.addLayer(layer_2) # multiLayer_1.addLayerWithTopRoughness(layer_2, layerRoughness_1) return multiLayer_1
def get_sample(): """ Defines sample and returns it """ # creating materials m_ambient = ba.MaterialBySLD("Ambient", 0.0, 0.0) m_ti = ba.MaterialBySLD("Ti", -1.9493e-06, 0.0) m_ni = ba.MaterialBySLD("Ni", 9.4245e-06, 0.0) m_particle = ba.MaterialBySLD("Particle", 5e-6, 0.0) m_substrate = ba.MaterialBySLD("SiSubstrate", 2.0704e-06, 0.0) # creating layers ambient_layer = ba.Layer(m_ambient) ti_layer = ba.Layer(m_ti, 30 * angstrom) ni_layer = ba.Layer(m_ni, 70 * angstrom) substrate_layer = ba.Layer(m_substrate) # create roughness roughness = ba.LayerRoughness(5 * angstrom, 0.5, 10 * angstrom) # create particle layout ff = ba.FormFactorCone(5 * nm, 10 * nm, 75 * deg) particle = ba.Particle(m_particle, ff) layout = ba.ParticleLayout() layout.addParticle(particle) iff = ba.InterferenceFunction2DLattice.createSquare(10 * nm, 0) layout.setInterferenceFunction(iff) ambient_layer.addLayout(layout) ambient_layer.setNumberOfSlices(20) # creating multilayer multi_layer = ba.MultiLayer() multi_layer.addLayer(ambient_layer) for i in range(2): multi_layer.addLayerWithTopRoughness(ti_layer, roughness) multi_layer.addLayerWithTopRoughness(ni_layer, roughness) multi_layer.addLayer(substrate_layer) return multi_layer
def get_sample(params): # Defining Materials material_1 = ba.MaterialBySLD("Air", 0.0, 0.0) material_2 = ba.MaterialBySLD("AgNano", params["Ag_dens_f"] * 1.322e-06, params["Ag_dens_f"] * 4.85e-07) material_3 = ba.MaterialBySLD("SiO2", params["SiO_dens_f"] * 3.681e-06, params["SiO_dens_f"] * 5.43e-07) material_4 = ba.MaterialBySLD("Si", 2.074e-06, 6.3e-08) # Defining Layers layer_1 = ba.Layer(material_1) layer_2 = ba.Layer(material_2, params["Ag_thick"]) layer_3 = ba.Layer(material_3, params["SiO_thick"]) layer_4 = ba.Layer(material_4) # Defining Multilayers multiLayer_1 = ba.MultiLayer() multiLayer_1.addLayer(layer_1) multiLayer_1.addLayer(layer_2) multiLayer_1.addLayer(layer_3) multiLayer_1.addLayer(layer_4) return multiLayer_1
def get_sample(params): """ Creates a sample and returns it :param params: a dictionary of optimization parameters :return: the sample defined """ # substrate (Si) si_sld_real = 2.0704e-06 # \AA^{-2} density_si = 0.0499 / ba.angstrom**3 # Si atomic number density # layers' parameters n_repetitions = 10 # Ni ni_sld_real = 9.4245e-06 # \AA^{-2} ni_thickness = 70 * ba.angstrom # Ti ti_sld_real = -1.9493e-06 # \AA^{-2} ti_thickness = params["ti_thickness"] # defining materials m_vacuum = ba.MaterialBySLD() m_ni = ba.MaterialBySLD("Ni", ni_sld_real, 0.0) m_ti = ba.MaterialBySLD("Ti", ti_sld_real, 0.0) m_substrate = ba.MaterialBySLD("SiSubstrate", si_sld_real, 0.0) # vacuum layer and substrate form multi layer vacuum_layer = ba.Layer(m_vacuum) ni_layer = ba.Layer(m_ni, ni_thickness) ti_layer = ba.Layer(m_ti, ti_thickness) substrate_layer = ba.Layer(m_substrate) multi_layer = ba.MultiLayer() multi_layer.addLayer(vacuum_layer) for i in range(n_repetitions): multi_layer.addLayer(ti_layer) multi_layer.addLayer(ni_layer) multi_layer.addLayer(substrate_layer) return multi_layer
def get_sample(): """ Defines sample and returns it """ # creating materials m_ambient = ba.MaterialBySLD("Ambient", 0.0, 0.0) m_layer_mat = ba.MaterialBySLD("Layer", 1e-4, 1e-8, ba.kvector_t(0.0, 1e8, 0.0)) m_substrate = ba.MaterialBySLD("Substrate", 7e-5, 2e-6) # creating layers ambient_layer = ba.Layer(m_ambient) layer = ba.Layer(m_layer_mat, 10) substrate_layer = ba.Layer(m_substrate) # creating multilayer multi_layer = ba.MultiLayer() multi_layer.addLayer(ambient_layer) multi_layer.addLayer(layer) multi_layer.addLayer(substrate_layer) return multi_layer
def get_sample(): """ Returns a sample """ # defining materials m_si = ba.MaterialBySLD("Si", sld_Si, sld_Si_im) m_d2o = ba.MaterialBySLD("D2O", sld_D2O, sld_D2O_im) m_core = ba.MaterialBySLD("Me3O5:D2O2", 2.0 * 1.0e-06, 0.0) m_shell = ba.MaterialBySLD("Me3O5:D2O", 3.9 * 1.0e-06, 0.0) # layer with particles # calculate average SLD Vcore = vol(core_radius, core_height) Vshell = vol(radius, height) - Vcore f_d2o = 0.7 f_core = (1.0 - f_d2o) / (1 + Vshell / Vcore) f_shell = (1.0 - f_d2o) / (1 + Vcore / Vshell) sld_mix = f_d2o * sld_D2O + f_shell * 3.9 * 1.0e-06 + f_core * 2.0 * 1.0e-06 m_mix = ba.MaterialBySLD("mix", sld_mix, 0.0) # fluctuation component ff_microgel = FormFactorMicrogel(b, xi, xiz) microgel = ba.Particle(m_core, ff_microgel) microgel_layout = ba.ParticleLayout() microgel_layout.addParticle(microgel, 1.0) # collection of particles ff = ba.FormFactorTruncatedSphere(radius=radius, height=height) ff_core = ba.FormFactorTruncatedSphere(radius=core_radius, height=core_height) transform = ba.RotationY(180.0 * deg) shell_particle = ba.Particle(m_shell, ff) core_particle = ba.Particle(m_core, ff_core) core_position = ba.kvector_t(0.0, 0.0, 0.0) particle = ba.ParticleCoreShell(shell_particle, core_particle, core_position) particle.setPosition(ba.kvector_t(0.0, 0.0, 0.0)) particle.setRotation(transform) nparticles = 2 # the larger is this number, the more slow will be the simulation. 10 is usually enough sigma = 0.2 * radius gauss_distr = ba.DistributionGaussian(radius, sigma) sigma_factor = 2.0 par_distr = ba.ParameterDistribution( "/ParticleCoreShell/Particle1/TruncatedSphere/Radius", gauss_distr, nparticles, sigma_factor, ba.RealLimits.lowerLimited(core_radius + 1.0)) par_distr.linkParameter( "/ParticleCoreShell/Particle1/TruncatedSphere/Height") par_distr.linkParameter( "/ParticleCoreShell/Particle0/TruncatedSphere/Height") par_distr.linkParameter( "/ParticleCoreShell/Particle0/TruncatedSphere/Radius") part_coll = ba.ParticleDistribution(particle, par_distr) microgel_layout.addParticle(part_coll, 1.2e-05) # interference can be neglected interference = ba.InterferenceFunctionNone() microgel_layout.setInterferenceFunction(interference) # describe layer roughness roughness = ba.LayerRoughness() roughness.setSigma(1.2 * ba.nm) roughness.setHurstParameter(0.8) roughness.setLatteralCorrLength(570.0 * ba.nm) # create layers d2o_layer = ba.Layer(m_d2o) mix_layer = ba.Layer(m_mix, 2.0 * height) mix_layer.addLayout(microgel_layout) si_layer = ba.Layer(m_si) multi_layer = ba.MultiLayer() multi_layer.addLayer(si_layer) multi_layer.addLayer(mix_layer) multi_layer.addLayerWithTopRoughness(d2o_layer, roughness) return multi_layer
def get_air(self, wavelength): return ba.MaterialBySLD("air", 0.0, 0.0)