diffraction {crone} | R Documentation |
Simulation of 1D diffraction pattern
Description
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).
Usage
diffraction(sdata, D, Ncell = 10, N = 1000, n = 100, bstop = NULL)
Arguments
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 |
Value
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
.
Examples
# 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")