File: beta_rough.rst

package info (click to toggle)
genx 3.8.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 39,152 kB
  • sloc: python: 79,013; makefile: 153; sh: 92; xml: 7
file content (64 lines) | stat: -rw-r--r-- 2,186 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
.. _beta-rough-model:

********************
Beta Roughness Model
********************
This tutorial describes how to incorporate the general roughness model for crystal truncation rod data
after Robinson [ROB86]_.

To use this roughness model you will need the following:

1. Data file that includes L-value of nearest Bragg peak (LB) and distance in reciprocal lattice units between adjacent
   Bragg peaks (dL) for each data point. If dL is the same for all Bragg peaks on a given rod,
   you may use the same LB for all.
   ::

      # Sample data file with Bragg peak position and spacing
      # H	K	L	I	Ierr	LB	dL
      0	0	1.0	0	0	3	3
      0	0	1.1	0	0	3	3
      0	0	1.2	0	0	3	3
      0	0	1.3	0	0	3	3
      0	0	1.4	0	0	3	3
      0	0	1.5	0	0	3	3
      0	0	1.6	0	0	3	3

2. SXRD model script modified to include the beta parameter as a user variable, and
   roughness in the structure factor calculation. Add/replace the following code in the model script
   shown at :ref:`tutorial-sxrd`
   ::

      # 3.a Define beta for roughness model
      rgh=UserVars()
      rgh.new_var('beta', 0.0)


      # 9 Define the Sim function
      def Sim(data):
         I = []
         beta = rgh.beta
         #9.a loop through the data sets
         for data_set in data:
            # 9.b create all the h,k,l,LB,dL values for the rod (data_set)
            h = data_set.extra_data['h']
            k = data_set.extra_data['k']
            l = data_set.x
            LB = data_set.extra_data['LB']
            dL = data_set.extra_data['dL']
            # 9.c. calculate roughness using beta model
            rough = (1-beta)/((1-beta)**2 + 4*beta*np.sin(np.pi*(l - LB)/dL)**2)**0.5
            # 9.d. Calculate the structure factor
            f = rough*sample.calc_f(h, k, l)
            # 9.e Calculate |F|
            i = abs(f)**2
            # 9.f Append the calculated intensity to the list I
            I.append(i)
         return I


3. In your parameter grid, select an empty row, right click, and select :menuselection:`UserVars-->rgh.setBeta`

References
==========

.. [ROB86] ROBINSON, I., 1986. CRYSTAL TRUNCATION RODS AND SURFACE-ROUGHNESS. Physical Review B 33, 3830-3836.