1
2
3
4
5
6
7 from numpy import pi
8
9 '''
10 general born calculation class and function for operating on it
11
12 This module defines a class containing the basic componants of the born scattering intensity;
13 1) scattering from the diffraction off of a collection of ordered particles
14 2) scattering from the feature in a unit cell (contributing to the qz scattering)
15 3) scattering from layers under the features and the substrate
16
17 This module also includes the final treatment of these scattering contributers to
18 give a final density
19
20 '''
21
23 '''
24 This contains the substrate, feature, and lattice description
25
26 lattice_scattering
27 scattering from the scattering done by the ordered particles
28 feature_scattering
29 scattering done by individual features in a unit cell
30 substrate_scattering
31 scattering done by the substrate layers in a unit cell
32
33 '''
34 - def __init__(self,lattice_scattering = None,feature_scattering = None,substrate_scattering = None):
35 self.lattice_scattering = lattice_scattering
36 self.feature_scattering = feature_scattering
37 self.substrate_scattering = substrate_scattering
38
39
40
42 from numpy import sum,empty
43 total_form = empty([len(qz),len(qx),len(qy)],'D')
44 for i,qxi in enumerate(qx):
45 for j,qyj in enumerate(qy):
46 total_form[:,i,j] =(scatter_contrib.feature_scattering[:,i,j] + scatter_contrib.substrate_scattering[:,i,j])
47
48 return(sum(scatter_contrib.lattice_scattering,axis=2)**2 * abs(sum(total_form,axis=2))**2)
49