diff --git a/Examples/scatter2d/HollowSpheres.py b/Examples/scatter2d/HollowSpheres.py new file mode 100755 index 0000000000000000000000000000000000000000..0b82366f67f8c0e3eb67178340e0acf7c71ae6a1 --- /dev/null +++ b/Examples/scatter2d/HollowSpheres.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 +""" +SAS by hollow spheres +""" +import bornagain as ba +from bornagain import ba_plot as bp, deg, nm, std_simulations + + +def get_sample(): + # Define materials + material_Particle = ba.RefractiveMaterial("Particle", 6e-05, 2e-08) + material_Vacuum = ba.RefractiveMaterial("Vacuum", 0, 0) + + # Define particle + ff = ba.HollowSphere(4*nm, 1*nm) + particle = ba.Particle(material_Particle, ff) + + # Define particle layouts + layout = ba.ParticleLayout() + layout.addParticle(particle) + layout.setTotalParticleSurfaceDensity(0.01) + + # Define layers + layer = ba.Layer(material_Vacuum) + layer.addLayout(layout) + + # Define sample + sample = ba.MultiLayer() + sample.addLayer(layer) + + return sample + + +if __name__ == '__main__': + bp.parse_args(sim_n=200) + sample = get_sample() + simulation = std_simulations.sas(sample, bp.simargs['n']) + result = simulation.simulate() + bp.plot_simulation_result(result) diff --git a/Tests/Examples/CMakeLists.txt b/Tests/Examples/CMakeLists.txt index 75860fb4861161d44de710348f0310ae48eccbe7..4af3181bcd04ddcd96da073bf86fe0016f0e62dd 100644 --- a/Tests/Examples/CMakeLists.txt +++ b/Tests/Examples/CMakeLists.txt @@ -149,6 +149,7 @@ test_example(scatter2d/DetectorResolutionFunction 2e-10) test_example(scatter2d/DodecahedraSAS 2e-10) test_example(scatter2d/HalfSpheresInAverageTopLayer 2e-10) test_example(scatter2d/HexagonalLatticesWithBasis 2e-10) +test_example(scatter2d/HollowSpheres 2e-10) test_example(scatter2d/Interference1DLattice 1.5) test_example(scatter2d/Interference1DRadialParacrystal 2e-10) test_example(scatter2d/Interference2DCenteredSquareLattice 2e-10) diff --git a/Tests/ReferenceData/ExamplesMini/scatter2d/HollowSpheres.int.gz b/Tests/ReferenceData/ExamplesMini/scatter2d/HollowSpheres.int.gz new file mode 100644 index 0000000000000000000000000000000000000000..5f47f1a94bf27d8dbf50bf2f16eb8bc8cd75b1de Binary files /dev/null and b/Tests/ReferenceData/ExamplesMini/scatter2d/HollowSpheres.int.gz differ