Skip to content
Snippets Groups Projects
Commit 299228cb authored by Celine Durniak's avatar Celine Durniak
Browse files

Renaming of Python example HexagonalLatticesWithBasis

parent 39ce4858
No related branches found
No related tags found
No related merge requests found
""" """
Spheres at hex lattice Spheres on two hexagonal close packed layers
""" """
import numpy import numpy
import matplotlib import matplotlib
...@@ -12,7 +12,7 @@ alpha_min, alpha_max = 0.0, 1.0 ...@@ -12,7 +12,7 @@ alpha_min, alpha_max = 0.0, 1.0
def get_sample(): def get_sample():
""" """
Build and return the sample representing spheres at hex 2D lattice Build and return the sample representing spheres on two hexagonal close packed layers
""" """
m_air = HomogeneousMaterial("Air", 0.0, 0.0) m_air = HomogeneousMaterial("Air", 0.0, 0.0)
m_substrate = HomogeneousMaterial("Substrate", 6e-6, 2e-8) m_substrate = HomogeneousMaterial("Substrate", 6e-6, 2e-8)
...@@ -23,24 +23,12 @@ def get_sample(): ...@@ -23,24 +23,12 @@ def get_sample():
sphere = Particle(m_particle, sphere_ff) sphere = Particle(m_particle, sphere_ff)
particle_layout = ParticleLayout() particle_layout = ParticleLayout()
# pos0 = kvector_t(0.0, 0.0, 0.0)
# pos1 = kvector_t(radius, radius, radius + numpy.sqrt(3)*radius)
# # pos1 = kvector_t(0.0, 0.0, radius)
# particle_layout.addParticleInfo(PositionParticleInfo(sphere, pos0, 1.0))
# info1 = PositionParticleInfo(sphere, pos1, 1.0)
# # # info1.setDepth(numpy.sqrt(3)*radius)
# particle_layout.addParticleInfo(info1)
pos0 = kvector_t(0.0, 0.0, 0.0) pos0 = kvector_t(0.0, 0.0, 0.0)
# pos1 = kvector_t(0.0, 0.0, radius)
pos1 = kvector_t(radius, radius, numpy.sqrt(3.0)*radius) pos1 = kvector_t(radius, radius, numpy.sqrt(3.0)*radius)
basis = LatticeBasis() basis = LatticeBasis()
basis.addParticle(sphere, [pos0, pos1]) basis.addParticle(sphere, [pos0, pos1])
particle_layout.addParticle(basis) particle_layout.addParticle(basis)
interference = InterferenceFunction2DLattice.createHexagonal(radius*2.0) interference = InterferenceFunction2DLattice.createHexagonal(radius*2.0)
pdf = FTDistribution2DCauchy(10*nanometer, 10*nanometer) pdf = FTDistribution2DCauchy(10*nanometer, 10*nanometer)
interference.setProbabilityDistribution(pdf) interference.setProbabilityDistribution(pdf)
......
...@@ -86,6 +86,7 @@ def run_simulation(): ...@@ -86,6 +86,7 @@ def run_simulation():
pylab.subplot(2, 2, nplot) pylab.subplot(2, 2, nplot)
pylab.ylim(ymax=50.0, ymin=1e-06) pylab.ylim(ymax=50.0, ymin=1e-06)
pylab.xlabel(r'$\alpha_f$ (rad)', fontsize=16)
pylab.semilogy(alpha_angles, R) pylab.semilogy(alpha_angles, R)
pylab.semilogy(alpha_angles, T) pylab.semilogy(alpha_angles, T)
pylab.legend(['|R| layer #'+str(layer_index), '|T| layer #'+str(layer_index)], loc='upper right') pylab.legend(['|R| layer #'+str(layer_index), '|T| layer #'+str(layer_index)], loc='upper right')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment