Exercise 1: Set up GALAXI instrument

Beam parameters

Pay attention, that Wavelength must be given in nm. Thus, $\lambda = 0.134$ nm.

Detector parameters

Considering pixel size 0.172 mm, calculate the detector size:


In [1]:
width = 981 * 0.172
print("Width = ", width, " mm")


Width =  168.732  mm

In [2]:
height = 1043 * 0.172
print("Height = ", height, " mm")


Height =  179.396  mm

Positions


In [3]:
u0 = 600 * 0.172
print ("u0 = ", round(u0, 2), " mm")


u0 =  103.2  mm

In [4]:
v0 = 350 * 0.172
print("v0 = ", round(v0, 2), " mm")


v0 =  60.2  mm

Optional: beam divergency

Beam divergency should be specified in degrees. Thus, first we need to convert units:


In [8]:
import numpy as np
angle_fwhm = np.degrees(0.3e-3)
print("Angular divergency = ", round(angle_fwhm, 3), " degrees")


Angular divergency =  0.017  degrees

$\sigma=\frac{\text{FWHM}}{2\sqrt{2\log 2}}$


In [11]:
divider = 2*np.sqrt(2*np.log(2))  # approximately equal to 2.355
sigma = angle_fwhm/divider
print("sigma = ", round(sigma,3))


sigma =  0.007

Finally, beam divergency settings will look as follows

The distribution widget should show the following plot

Optional: detector resolution

GALAXI detector pixel has size 0.172 mm. Thus for FWHM equal to the pixel size,


In [12]:
sigma = 0.172/2.355
print("SigmaX = SigmaY = ", round(sigma, 3))


SigmaX = SigmaY =  0.073

Finally, the resolution function is defined as

In this exercise we have defined the same resolution width in both directions. However, for some instruments the resolution in $X$ and $Y$ directions may be different.

Exercise 2: Si Nano dots on Si substrate

Construct the sample

  1. Drag on the left side and drop in the sample design area the Multi layer object.
  2. Drag 2 layers and drop them on the Multilayer.
  3. Drag and drop the Basic particle layout object. Connect it to the upper layer.
  4. Drag and drop Box particle. Connect it to the Particle layout.

Set the materials

  1. Click on the bottom layer to select it. On the right panel click on the Material to start the Material editor widget.

  1. Create new material Si with $\delta=5.78\cdot 10^{-6}$ and $\beta=1.02\cdot 10^{-7}$. For this exercise we use Refractive index based material. More about material kinds in BornAgain in later tutorials.

  2. After you've selected substrate material to be Si, click on the Particle ans set it's material to Si too.

  1. Finally, set the particle length to 30 nm, width to 20 nm and height to 10 nm.

Exercise 3

  1. Click Run Simulation button in Simulation view. After the simulation has finished, BornAgain should automaticaly switch to Job view screen. Click Properties on the top panel. Change Axes Units from mm to q-space. Change the Min value of the y-axis to 0. Click Save button on the top panel to save the plot as .png file. The result should look like shown below.

In [13]:
from IPython.display import Image
imgfile = "img/sim1.png"
Image(url=imgfile)


Out[13]:
  1. Click Fourier button on the top panel. The Fourier transform should look as shown below.

In [17]:
fftfile = "img/sim1_fft.png"
Image(url=fftfile)


Out[17]:
  1. Switch to Projections view in the top right corner.

Choose the horizontal line on the right panel to create a horizontal projection. Position it at $Q_z=0.4$. Click to the floppy disk to save projection to a text file. The result should look as shown below.


In [18]:
%matplotlib inline

In [33]:
import numpy as np
import matplotlib.pyplot as plt

projfile = "data/proj2.txt"
data = np.loadtxt(projfile)
plt.semilogy(data[:,0], data[:,1], color='k')
plt.xlabel(r'$Q_y$ (nm$^{-1}$)')
plt.ylabel('Intensity (a. u.)')
plt.title(r"Horizontal slice at $Q_z=0.4$ nm$^{-1}$");


  1. Choose the vertical line on the right panel to create a vertical projection. Position it at $Q_y=0$. Click to the floppy disk to save projection to a text file. The result should look as shown below.

In [34]:
projfile = "data/proj1.txt"
data = np.loadtxt(projfile)
plt.semilogy(data[:,0], data[:,1], color='r')
plt.xlabel(r'$Q_z$ (nm$^{-1}$)')
plt.ylabel('Intensity (a. u.)')
plt.title(r"Vertical slice at $Q_y=0$ nm$^{-1}$")
plt.xlim(0.0, 2.3);


  1. Switch to the Real Time Activity in the right bottom corner. Vary the sample parameters.


In [ ]: