Beispiel #1
0
    def get_sample():
        # Defining Materials
        material_1 = ba.HomogeneousMaterial("Air", 0.0, 0.0)
        material_2 = ba.HomogeneousMaterial("Si", 5.73327e-06, 1.006366e-07)

        # Defining Layers
        layer_1 = ba.Layer(material_1)
        layer_2 = ba.Layer(material_2)

        # Defining Form Factors
        formFactor_1 = ba.FormFactorPrism6(159.0 * nm, 300.0 * nm)

        # Defining Particles
        particle_1 = ba.Particle(material_2, formFactor_1)
        particle_1_rotation = ba.RotationY(60.0 * deg)
        particle_1.setRotation(particle_1_rotation)
        particle_1_position = kvector_t(0.0 * nm, 0.0 * nm, 138 * nm)
        particle_1.setPosition(particle_1_position)

        # Defining composition of particles at specific positions
        z1 = j
        z2 = j + 120
        z3 = j + 240

        particleComposition_1 = ba.ParticleComposition()
        particleComposition_1.addParticle(particle_1)
        particleComposition_1_rotation = ba.RotationZ(z1 * deg)
        particleComposition_1.setRotation(particleComposition_1_rotation)
        particleComposition_2 = ba.ParticleComposition()
        particleComposition_2.addParticle(particle_1)
        particleComposition_2_rotation = ba.RotationZ(z2 * deg)
        particleComposition_2.setRotation(particleComposition_2_rotation)
        particleComposition_3 = ba.ParticleComposition()
        particleComposition_3.addParticle(particle_1)
        particleComposition_3_rotation = ba.RotationZ(z3 * deg)
        particleComposition_3.setRotation(particleComposition_3_rotation)

        # Defining Particle Layouts and adding Particles
        layout_1 = ba.ParticleLayout()
        layout_1.addParticle(particleComposition_1, 1.0)
        layout_1.addParticle(particleComposition_2, 1.0)
        layout_1.addParticle(particleComposition_3, 1.0)

        layout_1.setTotalParticleSurfaceDensity(0.001)

        # 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
formfactors = [
    ba.FormFactorAnisoPyramid(20.0, 16.0, 13.0, 60.0 * deg),
    ba.FormFactorBox(20.0, 16.0, 13.0),
    ba.FormFactorCantellatedCube(15.0, 6.0),
    ba.FormFactorCone(10.0, 13.0, 60.0 * deg),
    ba.FormFactorCone6(10.0, 13.0, 60.0 * deg),
    ba.FormFactorCuboctahedron(20.0, 13.0, 0.7, 60.0 * deg),
    ba.FormFactorCylinder(8.0, 16.0),
    ba.FormFactorDodecahedron(5.0),
    ba.FormFactorEllipsoidalCylinder(8.0, 13.0, 16.0),
    ba.FormFactorFullSphere(8.0),
    ba.FormFactorFullSpheroid(10.0, 13.0),
    ba.FormFactorHemiEllipsoid(10.0, 6.0, 8.0),
    ba.FormFactorIcosahedron(8.0),
    ba.FormFactorPrism3(10.0, 13.0),
    ba.FormFactorPrism6(5.0, 11.0),
    ba.FormFactorPyramid(18.0, 13.0, 60.0 * deg),
    ba.FormFactorCosineRippleBox(27.0, 20.0, 14.0),
    ba.FormFactorSawtoothRippleBox(36.0, 25.0, 14.0, 3.0),
    ba.FormFactorTetrahedron(15.0, 6.0, 60.0 * deg),
    ba.FormFactorTruncatedCube(15.0, 6.0),
    ba.FormFactorTruncatedSphere(5.0, 7.0, 0),
    ba.FormFactorTruncatedSpheroid(7.5, 9.0, 1.2, 0),
]


def get_sample(formfactor):
    """
    Returns a one-layer sample that contains particles with given form factor.
    """
    # defining materials
Beispiel #3
0
"""
Plot form factors.
"""
import bornagain as ba
from bornagain import nanometer, degree
import bornplot as bp

det = bp.Detector(200, 0, 5, 0, 5)
n = 4
results = []
for i in range(n):
    omega = 30 * i / (n - 1)
    title = r'$\omega=%d^\circ$' % omega
    ff = ba.FormFactorPrism6(5.7 * nanometer, 3 * nanometer)
    trafo = ba.RotationZ(omega * degree)
    data = bp.run_simulation(det, ff, trafo)
    results.append(bp.Result(i, data, title))

bp.make_plot(results, det, "ff_Prism6")
    def get_sample():
        # Defining Materials
        material_1 = ba.HomogeneousMaterial("example01_Air", 0.0, 0.0)
        material_2 = ba.HomogeneousMaterial("Si", 5.73327e-06, 1.006366e-07)

        # Defining Layers
        layer_1 = ba.Layer(material_1)
        layer_2 = ba.Layer(material_2)

        # Defining Form Factors
        formFactor_1 = ba.FormFactorCone6(159.0 * nm, 10.0 * nm, 78.0 * deg)
        formFactor_2 = ba.FormFactorCone6(159.0 * nm, 5.0 * nm, 66.0 * deg)
        formFactor_3 = ba.FormFactorPrism6(159.0 * nm, 300.0 * nm)

        particleComposition_11 = ba.ParticleComposition()

        for i in range(nslices):
            z = i * 15.0 * nm
            y = z + 15.0 * nm

            # Defining Particles
            particle_1 = ba.Particle(material_2, formFactor_1)
            particle_1_position = kvector_t(0.0 * nm, 0.0 * nm, z * nm)
            particle_1.setPosition(particle_1_position)

            particle_2 = ba.Particle(material_2, formFactor_2)
            particle_2_rotation = ba.RotationY(180.0 * deg)
            particle_2.setRotation(particle_2_rotation)
            particle_2_position = kvector_t(0.0 * nm, 0.0 * nm, y * nm)
            particle_2.setPosition(particle_2_position)

            particleComposition_11.addParticle(particle_1)
            particleComposition_11.addParticle(particle_2)

        particleComposition_11_rotation = ba.RotationZ(j * deg)
        particleComposition_11.setRotation(particleComposition_11_rotation)

        particle_3 = ba.Particle(material_2, formFactor_3)
        particle_3_rotation = ba.RotationY(30.0 * deg)
        particle_3.setRotation(particle_3_rotation)
        particle_3_position = kvector_t(0.0 * nm, 0.0 * nm, 79.5 * nm)
        particle_3.setPosition(particle_3_position)

        z1 = j
        z2 = j + 120
        z3 = j + 240

        particleComposition_1 = ba.ParticleComposition()
        particleComposition_1.addParticle(particle_3)
        particleComposition_1_rotation = ba.RotationZ(z1 * deg)
        particleComposition_1.setRotation(particleComposition_1_rotation)
        particleComposition_2 = ba.ParticleComposition()
        particleComposition_2.addParticle(particle_3)
        particleComposition_2_rotation = ba.RotationZ(z2 * deg)
        particleComposition_2.setRotation(particleComposition_2_rotation)
        particleComposition_3 = ba.ParticleComposition()
        particleComposition_3.addParticle(particle_3)
        particleComposition_3_rotation = ba.RotationZ(z3 * deg)
        particleComposition_3.setRotation(particleComposition_3_rotation)

        # Defining Particle Layouts and adding Particles
        layout_1 = ba.ParticleLayout()
        layout_1.addParticle(particleComposition_11, 0.7)
        layout_1.addParticle(particleComposition_1, 0.1)
        layout_1.addParticle(particleComposition_2, 0.1)
        layout_1.addParticle(particleComposition_3, 0.1)
        layout_1.setTotalParticleSurfaceDensity(0.001)

        # 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