Description Usage Arguments Value Examples
View source: R/reciprocal_space.R
Analytic Fourier transform of electron density corresponding to
an array of Ncell
unit cells calculated using numerical
integration with the trapezoid rule. The diffraction peaks' height is
proportional to the number of unit cells ( Ncell
). The
number of diffraction peaks included in the 1D diffraction pattern is
related to the maximum resolution D
provided in the input.
The number of grid points for both the simulated electron density and
the resulting diffraction pattern can also be provided as input. A
further input parameter is the radius of the beamstop disc to stop
diffraction close to the incoming beam (as the resulting intensity far
outweigh the rest of the diffracted intensities).
1  diffraction(sdata, D, Ncell = 10, N = 1000, n = 100, bstop = NULL)

sdata 
A named list, normally obtained through the use of
functions

D 
Real numeric. Maximum resolution in angstroms. 
Ncell 
Positive integer. It is the number of unit cells in
the 1D crystal. The default value is 
N 
Positive integer indicating the number of grid points for the
electron density. The default value is 
n 
Positive integer determining the reciprocal space grid. The
grid is made of 
bstop 
Real numeric. Is the radius of the backstop disc. Intensities
at points closer to the origin than 
A named list with two vectors of real numbers, the values of the
reciprocal space grid points (in 1/angstrom units) xstar
and the intensities Imod
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14  # Diffraction from just two unit cells of cyanate
sdata < load_structure("cyanate")
# Max resolution is 1 angstroms; no backstop
ltmp < diffraction(sdata,D=1,Ncell=1)
# Plot diffraction pattern
plot(ltmp$xstar,ltmp$Imod,type="l",
xlab=expression(paste("x"^"*")),ylab="Intensity")
# Diffraction from 20 unit cells with backstop of 20 angstroms diameter
ltmp < diffraction(sdata,D=1,bstop=10)
plot(ltmp$xstar,ltmp$Imod,type="l",
xlab=expression(paste("x"^"*")),ylab="Intensity")

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.