Commit 7cffc9b2 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

Merge branch 'ex2' into 'develop'

Examples; round parameters, etc

See merge request !10
parents 6a6a3f87 8cb37c04
Pipeline #33418 passed with stage
in 19 minutes and 17 seconds
File mode changed from 100644 to 100755
......@@ -44,12 +44,10 @@ class SampleBuilder:
# defining materials
m_vacuum = ba.HomogeneousMaterial("Vacuum", 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)
m_Si = ba.HomogeneousMaterial("Si", 5.7816e-6, 1.0229e-7)
m_Ag = ba.HomogeneousMaterial("Ag", 2.2475e-5, 1.6152e-6)
m_PTFE = ba.HomogeneousMaterial("PTFE", 5.20509e-6, 1.9694e-8)
m_HMDSO = ba.HomogeneousMaterial("HMDSO", 2.0888e-6, 1.3261e-8)
# collection of particles with size distribution
nparticles = 20
......@@ -69,7 +67,7 @@ class SampleBuilder:
interference = ba.InterferenceFunctionRadialParaCrystal(
self.distance, 1e6*ba.nm)
interference.setKappa(self.kappa)
interference.setDomainSize(20000)
interference.setDomainSize(2e4*nm)
pdf = ba.FTDistribution1DGauss(self.disorder)
interference.setProbabilityDistribution(pdf)
......
......@@ -35,7 +35,6 @@ def get_sample():
layout.addParticle(particle_1, 0.8)
layout.addParticle(particle_2, 0.2)
layout.setInterferenceFunction(iff)
layout.setWeight(1)
layout.setTotalParticleSurfaceDensity(0.01)
# Define layers
......
......@@ -37,12 +37,10 @@ def get_sample():
layout_1 = ba.ParticleLayout()
layout_1.addParticle(particle_1, 0.8)
layout_1.setInterferenceFunction(iff_1)
layout_1.setWeight(1)
layout_1.setTotalParticleSurfaceDensity(0.01)
layout_2 = ba.ParticleLayout()
layout_2.addParticle(particle_2, 0.2)
layout_2.setInterferenceFunction(iff_2)
layout_2.setWeight(1)
layout_2.setTotalParticleSurfaceDensity(0.01)
# Define layers
......
......@@ -36,7 +36,6 @@ def get_sample():
layout.addParticle(particle_1, 0.8)
layout.addParticle(particle_2, 0.2)
layout.setInterferenceFunction(iff)
layout.setWeight(1)
layout.setTotalParticleSurfaceDensity(0.01)
# Define layers
......
......@@ -24,8 +24,7 @@ def get_sample():
# Define particle layouts
layout = ba.ParticleLayout()
layout.addParticle(particle, 1)
layout.setWeight(1)
layout.addParticle(particle)
layout.setTotalParticleSurfaceDensity(0.01)
# Define layers
......
......@@ -32,9 +32,8 @@ def get_sample():
# Define particle layouts
layout = ba.ParticleLayout()
layout.addParticle(particle, 1)
layout.addParticle(particle)
layout.setInterferenceFunction(iff)
layout.setWeight(1)
layout.setTotalParticleSurfaceDensity(0.015625)
# Define layers
......
......@@ -30,8 +30,7 @@ def get_sample():
# Define particle layouts
layout = ba.ParticleLayout()
layout.addParticle(particle, 1)
layout.setWeight(1)
layout.addParticle(particle)
layout.setTotalParticleSurfaceDensity(0.01)
# Define layers
......
......@@ -24,8 +24,7 @@ def get_sample():
# Define particle layouts
layout = ba.ParticleLayout()
layout.addParticle(particle, 1)
layout.setWeight(1)
layout.addParticle(particle)
layout.setTotalParticleSurfaceDensity(0.01)
# Define layers
......@@ -42,7 +41,7 @@ def get_sample():
def get_simulation(sample):
beam = ba.Beam(1000000, 0.1*nm, ba.Direction(0.2*deg, 0))
beam = ba.Beam(1e6, 0.1*nm, ba.Direction(0.2*deg, 0))
detector = ba.SphericalDetector(100, 2*deg, 1*deg, 1*deg)
simulation = ba.GISASSimulation(beam, sample, detector)
background = ba.ConstantBackground(1.0e+03)
......
......@@ -32,9 +32,8 @@ def get_sample():
# Define particle layouts
layout = ba.ParticleLayout()
layout.addParticle(particle_3, 1)
layout.addParticle(particle_3)
layout.setInterferenceFunction(iff)
layout.setWeight(1)
layout.setTotalParticleSurfaceDensity(0.01)
# Define layers
......
......@@ -44,7 +44,7 @@ def get_sample():
def get_simulation(sample):
beam = ba.Beam(500000000000, 0.1*nm, ba.Direction(0.2*deg, 0))
beam = ba.Beam(5e11, 0.1*nm, ba.Direction(0.2*deg, 0))
detector = ba.SphericalDetector(200, 1*deg, 0, 0.5*deg)
simulation = ba.GISASSimulation(beam, sample, detector)
return simulation
......
......@@ -33,9 +33,8 @@ def get_sample():
# Define particle layouts
layout = ba.ParticleLayout()
layout.addParticle(particle, 1)
layout.addParticle(particle)
layout.setInterferenceFunction(iff)
layout.setWeight(1)
layout.setTotalParticleSurfaceDensity(0.0001)
# Define layers
......
......@@ -32,7 +32,6 @@ def get_sample():
layout.addParticle(particle_1, 0.5)
layout.addParticle(particle_2, 0.5)
layout.setInterferenceFunction(iff)
layout.setWeight(1)
layout.setTotalParticleSurfaceDensity(0.01)
# Define layers
......
File mode changed from 100644 to 100755
......@@ -30,8 +30,7 @@ def get_sample():
# Define particle layouts
layout = ba.ParticleLayout()
layout.addParticle(particle_distrib, 1)
layout.setWeight(1)
layout.addParticle(particle_distrib)
layout.setTotalParticleSurfaceDensity(0.01)
# Define layers
......
......@@ -24,8 +24,7 @@ def get_sample():
# Define particle layouts
layout = ba.ParticleLayout()
layout.addParticle(particle, 1)
layout.setWeight(1)
layout.addParticle(particle)
layout.setTotalParticleSurfaceDensity(0.01)
# Define layers
......
......@@ -33,9 +33,8 @@ def get_sample():
# Define particle layouts
layout = ba.ParticleLayout()
layout.addParticle(particle, 1)
layout.addParticle(particle)
layout.setInterferenceFunction(iff)
layout.setWeight(1)
layout.setTotalParticleSurfaceDensity(0.01)
# Define layers
......
......@@ -28,12 +28,12 @@ def get_sample():
particle_2.setPosition(particle_2_position)
# Define composition of particles at specific positions
particle_3 = ba.ParticleComposition()
particle_3.addParticle(particle_1)
particle_3.addParticle(particle_2)
basis = ba.ParticleComposition()
basis.addParticle(particle_1)
basis.addParticle(particle_2)
# Define 2D lattices
lattice = ba.BasicLattice2D(20*nm, 20*nm, 120*deg, 0)
lattice = ba.HexagonalLattice2D(20*nm, 0)
# Define interference functions
iff = ba.InterferenceFunction2DLattice(lattice)
......@@ -42,9 +42,8 @@ def get_sample():
# Define particle layouts
layout = ba.ParticleLayout()
layout.addParticle(particle_3, 1)
layout.addParticle(basis)
layout.setInterferenceFunction(iff)
layout.setWeight(1)
layout.setTotalParticleSurfaceDensity(0.00288675134595)
# Define layers
......
......@@ -29,9 +29,8 @@ def get_sample():
# Define particle layouts
layout = ba.ParticleLayout()
layout.addParticle(particle, 1)
layout.addParticle(particle)
layout.setInterferenceFunction(iff)
layout.setWeight(1)
layout.setTotalParticleSurfaceDensity(0.01)
# Define layers
......
......@@ -5,6 +5,8 @@
import bornagain as ba
from bornagain import deg, nm, kvector_t
r = 3*nm # particle radius
a = 25*nm # lattice constant
def get_sample():
"""
......@@ -17,23 +19,19 @@ def get_sample():
material_Substrate = ba.HomogeneousMaterial("Substrate", 6e-06, 2e-08)
material_Vacuum = ba.HomogeneousMaterial("Vacuum", 0, 0)
# Define form factors
ff_1 = ba.FormFactorCylinder(3*nm, 3*nm)
ff_2 = ba.FormFactorCylinder(3*nm, 3*nm)
# Define particles
particle_1 = ba.Particle(material_Particle, ff_1)
particle_2 = ba.Particle(material_Particle, ff_2)
particle_2_position = kvector_t(12.5*nm, 12.5*nm, 0)
particle_2.setPosition(particle_2_position)
ff = ba.FormFactorCylinder(r, r)
particle_1 = ba.Particle(material_Particle, ff)
particle_2 = ba.Particle(material_Particle, ff)
particle_2.setPosition(kvector_t(a/2, a/2, 0))
# Define composition of particles at specific positions
particle_3 = ba.ParticleComposition()
particle_3.addParticle(particle_1)
particle_3.addParticle(particle_2)
basis = ba.ParticleComposition()
basis.addParticle(particle_1)
basis.addParticle(particle_2)
# Define 2D lattices
lattice = ba.BasicLattice2D(25*nm, 25*nm, 90*deg, 0)
lattice = ba.SquareLattice2D(a, 0*deg)
# Define interference functions
iff = ba.InterferenceFunction2DLattice(lattice)
......@@ -42,9 +40,8 @@ def get_sample():
# Define particle layouts
layout = ba.ParticleLayout()
layout.addParticle(particle_3, 1)
layout.addParticle(basis)
layout.setInterferenceFunction(iff)
layout.setWeight(1)
layout.setTotalParticleSurfaceDensity(0.0016)
# Define layers
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment