Calculation of structure factors
strufac.Rd
Calculates structure factors corresponding to one or more 1D Miller indices, given the atomic content of one unit cell. Anomalous scattering can be included using logical flag "anoflag" (default is FALSE). Crystal structures are always considered with no symmetry. Thus a 1D structure with the P-1 symmetry will have to be expanded first with function "expand_to_cell".
Arguments
- hidx
Real numeric. One or more 1D Miller indices.
- sdata
A named list, normally obtained through the use of functions
read_x
orstandardise_sdata
. The list names correspond to different object types:a. Real numeric. The size of the unit cell.
SG. Character string. Space group symbol; either "P1" or "P-1"
x0. Vector of real numerics indicating the expanded atomic positions in the unit cell.
Z. Vector of integers indicating the expanded atomic numbers for all atoms in the unit cell.
B. Vector of real numerics indicating the expanded B factors for all atoms in the unit cell.
occ. Vector of real numerics indicating the expanded occupancies for all atoms in the unit cell.
- anoflag
Logical variable. If TRUE it forces scattering factors to include anomalous contributions. As a consequence, Friedel's pairs will not be equal.
- aK
Real numeric. This is a fudge factor included to decrease the strength of the anomalous contributions. Without aK the strength is too high for 1D structures, compared to real 3D structures. So aK helps bringing down the anomalous contribution within the 5 met with large-size structures. The default value is aK=0.3 (anoK is included as internal data).
- lbda
Real numeric. This is the wavelength in angstroms. Its value is important in relation to anomalous scattering.
- k
A real number. It controls the standard deviation of the gaussian function describing the atom and, thus, the shape of the associated peak. The standard deviation sigma is given by:
sigma = k * sqrt(Z)
The default value is k=0.05 (ksigma is included as internal data).- f1f2out
Logical variable. This variable controls output of a small table of f' and f'' values for all chemical elements in the structure. Default is for the table to be printed.
Value
A named list with two vectors of real numbers, the structure factors amplitudes, Fmod, and phases, Fpha, corresponding to the Miller indices in input.
Examples
# First create the crystal structure (P1)
a <- 10
SG <- "P1"
x0 <- c(1,4,6.5)
Z <- c(8,26,6)
B <- c(18,20,17)
occ <- c(1,1,1)
sdata <- standardise_sdata(a,SG,x0,Z,B,occ)
lbda <- 1.7 # Close to Fe's absorption
# Miller indices (including DC (h=0) component)
hidx <- 0:10
# Now structure factors without anomalous contribution
ftmp <- strufac(hidx,sdata,lbda=lbda)
print(length(ftmp$Fmod)) # Includes DC component (h=0)
#> [1] 11
print(ftmp) # Amplitudes decrease with increasing
#> $Fmod
#> [1] 40.00000000 22.11435139 10.62662935 18.96067637 13.98228591 3.60862647
#> [7] 2.35915179 2.08280243 0.55065616 0.31633073 0.04479261
#>
#> $Fpha
#> [1] 0.00000 140.08040 -50.66525 69.10247 -158.39782 32.24970
#> [7] 177.61998 -103.04028 50.14049 -74.99236 0.00000
#>
# resolution (Miller indices)
# Now try with anomalous contributions
ftmp <- strufac(hidx,sdata,lbda=lbda,anoflag=TRUE)
#> Z f1 f2
#> 1 8 0.05830568 0.03963098
#> 2 26 -2.98134400 3.75151500
#> 3 6 0.02137232 0.01120651
print(ftmp) # DC component is not any longer real
#> $Fmod
#> [1] 39.1461236 21.1745424 10.2696423 18.0534594 12.8899111 3.7203348
#> [7] 2.6673438 0.9157309 0.9821109 1.6480042 1.4103363
#>
#> $Fpha
#> [1] 1.669817 142.917302 -42.935720 72.572799 -154.553723 54.947857
#> [7] -149.364548 -69.220701 -174.977867 -24.913067 126.481325
#>