| Title: | 'cry' and 'rgl' — Applications in Crystallography |
| Version: | 0.1.1 |
| Description: | Visualizing crystal structures and selected area electron diffraction (SAED) patterns. It provides functions cry_demo() and dp_demo() to load a file in 'CIF' (Crystallographic Information Framework) formats and display crystal structures and electron diffraction patterns. The function dp_demo() also performs simple simulation of powder X-ray diffraction (PXRD) patterns, and the results can be saved to a file in the working directory. The package has been tested on several platforms, including Linux on 'Crostini' with a Core™ m3-8100Y Chromebook, I found that even on this low-powered platform, the performance was acceptable. T. Hanashima (2001)https://www2.kek.jp/imss/pf/tools/sasaki/sinram/sinram.html Todd Helmenstine (2019)https://sciencenotes.org/molecule-atom-colors-cpk-colors/ Wikipedia contributors (2023)https://en.wikipedia.org/w/index.php?title=Atomic_radius&oldid=1179864711. |
| License: | GPL-2 |GPL-3 [expanded from: GPL (≥ 2)] |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.1 |
| Imports: | cry, pracma, rgl, utils |
| Collate: | 'zzz.R' 'cry_demo.R' 'dp_demo.R' 'getCIF.R' 'align.R''select.R' 'rgl.cry-package.R' |
| Suggests: | knitr, rmarkdown, spelling, testthat (≥ 3.0.0) |
| Config/testthat/edition: | 3 |
| URL: | https://github.com/SaitouToshihide/rgl.cry/,https://saitoutoshihide.github.io/rgl.cry/ |
| Language: | en-US |
| NeedsCompilation: | no |
| Packaged: | 2024-06-13 15:39:12 UTC; saitoutoshihide |
| Author: | Toshihide Saitou [aut, cre, cph] |
| Maintainer: | Toshihide Saitou <saitou.toshihide@gmail.com> |
| Depends: | R (≥ 3.5.0) |
| Repository: | CRAN |
| Date/Publication: | 2024-06-13 15:50:05 UTC |
rgl.cry: 'cry' and 'rgl' — Applications in Crystallography
Description
Visualizing crystal structures and selected area electron diffraction (SAED) patterns. It provides functions cry_demo() and dp_demo() to load a file in 'CIF' (Crystallographic Information Framework) formats and display crystal structures and electron diffraction patterns. The function dp_demo() also performs simple simulation of powder X-ray diffraction (PXRD) patterns, and the results can be saved to a file in the working directory. The package has been tested on several platforms, including Linux on 'Crostini' with a Core™ m3-8100Y Chromebook, I found that even on this low-powered platform, the performance was acceptable. T. Hanashima (2001)https://www2.kek.jp/imss/pf/tools/sasaki/sinram/sinram.html Todd Helmenstine (2019)https://sciencenotes.org/molecule-atom-colors-cpk-colors/ Wikipedia contributors (2023)https://en.wikipedia.org/w/index.php?title=Atomic_radius&oldid=1179864711.
Author(s)
Maintainer: Toshihide Saitousaitou.toshihide@gmail.com [copyright holder]
See Also
Useful links:
Align crystal and diffraction pattern
Description
Align crystal and diffraction pattern and displayed.
Usage
align(ax, dev = NULL, verbose = TRUE)Arguments
ax | An axis to align |
dev | RGL device to apply. Defaults to current device. |
verbose | logical: Should the report be suppressed? |
Details
There is no z-axis alignment support because the visualization was createdwith the analogy of selected area electron diffraction (SAED) on transmissionelectron microscope (TEM) which typically have up to two axes. However youcan rotate around the z-axis by the drag originates near the window edge.
Value
No return value, called for side effects.
Examples
if (interactive()) { align("a") align("rb") align("1 1 0") align("60 -30") align(dev = 123, "a")}Examples of using the cry and rgl packages together.
Description
Read a file in CIF formats, set the parameters, calculates them, and drawsthe crystal structure with an axis widget.
Usage
cry_demo(file = NULL, rf = 1, type = "b", zoom = 1)Arguments
file | Optional file in CIF formats. The file can also be specified byURL. |
rf | A positive value indicating the scale factor of atom radius. |
type | A style of atom displaying such like ball, fill and ball-stickbut ball-stick is not implemented. |
zoom | A positive value indicating the current scene magnification. |
Details
If no file argument is provided, anddp_demo() has been opened withoutpairedcry_demo(), the CIF parameters of already openeddp_demo() will beused.
Value
An integer the device number of the currently window.
Examples
cry_demo()cry_demo(system.file("orthorhombic_p.cif", package = "rgl.cry"))if (interactive()) { cry_demo(file, type = "fill", zoom = 0.5) cry_demo("https://www.crystallography.net/cod/foo.cif")}Examples of using the cry and rgl packages together.
Description
Read a file in CIF formats, set and the parameters, calculates them, drawsthe 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 thedefault value takes a long time to process displaying due to the large numberof lattice points, you can expect to improve performance by increasing thevalue. |
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 diffractionpattern simulation result file. |
Details
If no file argument is provided, andcry_demo() has been opened withoutpaireddp_demo(), the CIF parameters of already openedcry_demo() will beused.
Interactive rotation, zooming, and panning of structures are possible usingthe 3D graphics libraryrgl. When the drag originates near the windowedge (within 5%), perform a Z-axis rotation.
This function also performs powder diffraction simulation and saves theresults to a file in the working directory. Currently, it doesn't accountfor 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")}Examples of using the cry and rgl packages together.
Description
Output a lCIF.
Usage
getCIF(dev = NULL)Arguments
dev | The device that is used to extract the lCIF. The default iscurrent device. |
Value
A named list, the same as that of 'cry::readCIF.'
Examples
getCIF()Select atoms or reciprocal lattice points.
Description
Select one or more atoms or reciprocal lattice points in the window. Thelabels and Miller indices of the selected atoms or lattice points will bedisplayed.
Usage
select(dev = NULL, verbose = TRUE)Arguments
dev | RGL device to apply. Defaults to current device. |
verbose | logical: Should the report be suppressed? |
Details
Selecting atoms or lattice points in the window will include allz-coordinates. If you do not want to include all z-coordinates, you willneed to modify the code.
Value
List of Miller indices or element labels.
Examples
if (interactive()) { select() select(dev = 123)}