Skip to content
Snippets Groups Projects
Commit 40559ab6 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

repair known_slicing test: rm non-scattering simulation; print infos

parent c2a67a84
No related branches found
No related tags found
1 merge request!1223meanRelativeDifference now detects empty data fields
Pipeline #84272 passed
......@@ -42,12 +42,12 @@ def get_sample(particle_to_air=None, particle_to_substrate=None):
class SlicedSpheresTest(unittest.TestCase):
def testSphericalCupOnTopOfSubstrate(self):
"""
print("""
Simulation #1: truncated sphere on top of substrate.
Simulation #2: sphere crossing the interface.
Both particles are made of same material as substrate.
Same scattering expected from both sample models.
"""
""", flush=True)
# truncated sphere (dz removed from bottom) on top of substrate
truncatedSphere = ba.Particle(matSubstrate,
......@@ -62,10 +62,10 @@ class SlicedSpheresTest(unittest.TestCase):
self.assertLess(diff, 1e-15)
def testSphericalLacuneInSubstrate(self):
"""
print("""
Similar to previous. Truncated sphere and sphere are made of vacuum material.
From scattering point of view, both cases should look like an vacuum lacune in substrate.
"""
""", flush=True)
# Sphere truncated from top. Intended to go below interface.
truncatedSphere = ba.Particle(matVacuum,
......@@ -81,10 +81,10 @@ class SlicedSpheresTest(unittest.TestCase):
self.assertLess(diff, 1e-15)
def testSpheresCrossingInterface(self):
"""
print("""
Same particle in same position, but attached to two different layers.
Of course, results shall be identical.
"""
""", flush=True)
# Sphere intended for vacuum layer and crossing interface
sphere1 = ba.Particle(matParticle, ba.Sphere(R))
......@@ -139,12 +139,12 @@ class SlicedSpheresTest(unittest.TestCase):
return result
def testCompound(self):
"""
print("""
Compares two simulation intended to provide identical results.
Simulation #1: spherical particle on top of substrate
Simulation #2: spherical compound on top of substrate, where
top and bottom are made of same material.
"""
""", flush=True)
sphere = ba.Particle(matParticle, ba.Sphere(R))
compound = self.get_compound(matParticle, matParticle)
......@@ -154,11 +154,11 @@ class SlicedSpheresTest(unittest.TestCase):
self.assertLess(diff, 2e-14)
def testCompoundBuilds(self):
"""
print("""
Compares two simulation intended to provide identical results.
Simulation #1: spherical particle compound on top of substrate
Simulation #2: same, but made using rotation
"""
""", flush=True)
compound1 = self.get_compound(matParticle, matSubstrate)
compound2 = self.get_compound_v2(matParticle, matSubstrate)
......@@ -167,30 +167,14 @@ class SlicedSpheresTest(unittest.TestCase):
get_sample(compound2))
self.assertLess(diff, 1e-14)
def testInvisibleCompound(self):
"""
Compares two simulation intended to provide identical results.
Simulation #1: no particles at all
Simulation #2: spherical compound on top of substrate crossing the interface
Bottom part of compound is made of substrate material, top part from
vacuum layer material.
"""
compound = self.get_compound(matVacuum, matSubstrate)
compound.translate(0, 0, -dz)
diff = infrastruct.diff_MiniGISAS(get_sample(),
get_sample(compound))
self.assertLess(diff, 1e-14)
def testSlicedCompound(self):
"""
print("""
Compares two simulation intended to provide identical results.
Simulation #1: spherical particle on top of substrate.
Simulation #2: spherical compound on top of substrate,
where top and bottom are made of same material.
Both particles are inserted in vacuum layer with shift to go below interface
"""
""", flush=True)
shift = 3.0
......@@ -205,13 +189,13 @@ class SlicedSpheresTest(unittest.TestCase):
self.assertLess(diff, 1e-14)
def testSphericalCupOnTopOfSubstrate(self):
"""
print("""
Compares two simulation intended to provide identical results.
Simulation #1: truncated sphere on top of substrate.
Simulation #2: spherical particle compound crossing the interface.
Bottom part of compound is made from substrate material.
both cases should look like a truncated sphere on top of substrate.
"""
""", flush=True)
# truncated sphere on top of substrate with height 16nm
truncatedSphere = ba.Particle(matParticle,
......
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