示例#1
0
def get_sample(params):
    """
    Returns a sample with uncorrelated cylinders and pyramids.
    """
    radius_a = params["radius_a"]
    radius_b = params["radius_b"]
    height = params["height"]

    m_vacuum = ba.HomogeneousMaterial("Vacuum", 0.0, 0.0)
    m_substrate = ba.HomogeneousMaterial("Substrate", 6e-6, 2e-8)
    m_particle = ba.HomogeneousMaterial("Particle", 6e-4, 2e-8)

    formfactor = ba.FormFactorHemiEllipsoid(radius_a, radius_b, height)
    particle = ba.Particle(m_particle, formfactor)

    layout = ba.ParticleLayout()
    layout.addParticle(particle)

    vacuum_layer = ba.Layer(m_vacuum)
    vacuum_layer.addLayout(layout)

    substrate_layer = ba.Layer(m_substrate)
    multi_layer = ba.MultiLayer()
    multi_layer.addLayer(vacuum_layer)
    multi_layer.addLayer(substrate_layer)
    return multi_layer
def get_sample(radius_a=4.0*nm, radius_b=4.0*nm, height=4.0*nm):
    """
    Returns a sample with uncorrelated cylinders and pyramids.
    """
    m_air = ba.HomogeneousMaterial("Air", 0.0, 0.0)
    m_substrate = ba.HomogeneousMaterial("Substrate", 6e-6, 2e-8)
    m_particle = ba.HomogeneousMaterial("Particle", 6e-4, 2e-8)

    formFactor = ba.FormFactorHemiEllipsoid(radius_a, radius_b, height)
    hemiEllipsoid = ba.Particle(m_particle, formFactor)

    particle_layout = ba.ParticleLayout()
    particle_layout.addParticle(hemiEllipsoid)

    air_layer = ba.Layer(m_air)
    air_layer.addLayout(particle_layout)

    substrate_layer = ba.Layer(m_substrate, 0)
    multi_layer = ba.MultiLayer()
    multi_layer.addLayer(air_layer)
    multi_layer.addLayer(substrate_layer)
    return multi_layer
phi_min, phi_max = -2.0, 2.0
alpha_min, alpha_max = 0.0, 2.0

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):
    """
示例#4
0
"""
Plot form factor.
"""
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 = 90 * i / (n - 1)
    title = r'$\omega=%d^\circ$' % omega
    ff = ba.FormFactorHemiEllipsoid(10 * nanometer, 3.8 * nanometer,
                                    3.2 * 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_HemiEllipsoid")