dp_demo {rgl.cry} | R Documentation |
Examples of using the cry and rgl packages together.
Description
Read a file in CIF formats, set and the parameters, calculates them, draws the reciprocal lattice map with a cell widget.
Usage
dp_demo(file = NULL, reso = 1.2, ews.r = 40, zoom = 0.5, xrd = FALSE)
Arguments
file |
Optional file in CIF formats. |
reso |
A real number. The highest data resolution, in angstroms. If the default value takes a long time to process displaying due to the large number of lattice points, you can expect to improve performance by increasing the value. |
ews.r |
Ewald sphere radius in angstrom^-1. |
zoom |
A positive value indicating the current scene magnification. |
xrd |
A logical value indicating whether to create an X-ray diffraction pattern simulation result file. |
Details
If no file argument is provided, and cry_demo()
has been opened without
paired dp_demo()
, the CIF parameters of already opened cry_demo()
will be
used.
Interactive rotation, zooming, and panning of structures are possible using
the 3D graphics library rgl
. When the drag originates near the window
edge (within 5%), perform a Z-axis rotation.
This function also performs powder diffraction simulation and saves the results to a file in the working directory. Currently, it doesn't account for atomic ionization and uses standard atomic scattering factors.
Value
An integer the device number of the currently window.
Examples
dp_demo()
dp_demo(system.file("orthorhombic_p.cif", package = "rgl.cry"))
dp_demo(system.file("orthorhombic_p.cif", package = "rgl.cry"), res = 2.0)
if (interactive()) {
dp_demo(file, zoom = 0.5)
dp_demo("https://www.crystallography.net/cod/foo.cif")
}