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

use std_samples.cylinders in basic GISAS example

parent 0e497c78
No related branches found
No related tags found
1 merge request!729Doc: use std_samples
...@@ -8,31 +8,8 @@ from bornagain import deg, nm ...@@ -8,31 +8,8 @@ from bornagain import deg, nm
def get_sample(): def get_sample():
# Define materials from bornagain import std_samples
material_Particle = ba.HomogeneousMaterial("Particle", 6e-4, 2e-08) return std_samples.cylinders()
material_Substrate = ba.HomogeneousMaterial("Substrate", 6e-6, 2e-08)
material_Vacuum = ba.HomogeneousMaterial("Vacuum", 0, 0)
# Define particles
ff = ba.FormFactorCylinder(5*nm, 5*nm)
particle = ba.Particle(material_Particle, ff)
# Define particle layouts
layout = ba.ParticleLayout()
layout.addParticle(particle)
layout.setTotalParticleSurfaceDensity(0.01)
# Define layers
layer_1 = ba.Layer(material_Vacuum)
layer_1.addLayout(layout)
layer_2 = ba.Layer(material_Substrate)
# Define sample
sample = ba.MultiLayer()
sample.addLayer(layer_1)
sample.addLayer(layer_2)
return sample
def get_simulation(sample): def get_simulation(sample):
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
BornAgain collection of standard sample. BornAgain collection of standard sample.
""" """
import bornagain as ba import bornagain as ba
from bornagain import deg, angstrom from bornagain import deg, nm
def alternating_layers(): def alternating_layers():
""" """
Consists of 20 alternating Ti and Ni layers. Returns multilayer sample consisting of 20 alternating Ti and Ni layers.
""" """
# Define materials # Define materials
...@@ -17,8 +17,8 @@ def alternating_layers(): ...@@ -17,8 +17,8 @@ def alternating_layers():
# Define layers # Define layers
ambient_layer = ba.Layer(m_ambient) ambient_layer = ba.Layer(m_ambient)
ti_layer = ba.Layer(m_ti, 30*angstrom) ti_layer = ba.Layer(m_ti, 3*nm)
ni_layer = ba.Layer(m_ni, 70*angstrom) ni_layer = ba.Layer(m_ni, 7*nm)
substrate_layer = ba.Layer(m_substrate) substrate_layer = ba.Layer(m_substrate)
# Define sample # Define sample
...@@ -30,3 +30,34 @@ def alternating_layers(): ...@@ -30,3 +30,34 @@ def alternating_layers():
sample.addLayer(substrate_layer) sample.addLayer(substrate_layer)
return sample return sample
def cylinders():
"""
Returns sample consisting of dilute cylinders on substrate.
"""
# Define materials
material_Particle = ba.HomogeneousMaterial("Particle", 6e-4, 2e-08)
material_Substrate = ba.HomogeneousMaterial("Substrate", 6e-6, 2e-08)
material_Vacuum = ba.HomogeneousMaterial("Vacuum", 0, 0)
# Define particles
ff = ba.FormFactorCylinder(5*nm, 5*nm)
particle = ba.Particle(material_Particle, ff)
# Define particle layouts
layout = ba.ParticleLayout()
layout.addParticle(particle)
layout.setTotalParticleSurfaceDensity(0.01)
# Define layers
layer_1 = ba.Layer(material_Vacuum)
layer_1.addLayout(layout)
layer_2 = ba.Layer(material_Substrate)
# Define sample
sample = ba.MultiLayer()
sample.addLayer(layer_1)
sample.addLayer(layer_2)
return sample
...@@ -5292,7 +5292,7 @@ SWIG_AsVal_std_complex_Sl_double_Sg_ (PyObject *o, std::complex<double>* val) ...@@ -5292,7 +5292,7 @@ SWIG_AsVal_std_complex_Sl_double_Sg_ (PyObject *o, std::complex<double>* val)
   
   
SWIGINTERNINLINE PyObject* SWIGINTERNINLINE PyObject*
SWIG_From_std_complex_Sl_double_Sg_ (/*@SWIG:/usr/local/share/swig/4.0.2/typemaps/swigmacros.swg,104,%ifcplusplus@*/ SWIG_From_std_complex_Sl_double_Sg_ (/*@SWIG:/usr/share/swig4.0/typemaps/swigmacros.swg,104,%ifcplusplus@*/
   
const std::complex<double>& const std::complex<double>&
   
...@@ -21,7 +21,7 @@ we consider a dilute random assembly of monodisperse cylindrical disks on a subs ...@@ -21,7 +21,7 @@ we consider a dilute random assembly of monodisperse cylindrical disks on a subs
{{< highlightfile file="Examples/scatter2d/Cylinders.py" >}} {{< highlightfile file="Examples/scatter2d/Cylinders.py" >}}
<p> <p>
### Explanation ### TODO MOVE Explanation
The ***Define materials*** stance defines three materials in terms The ***Define materials*** stance defines three materials in terms
of their refractive index. of their refractive index.
......
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