stb-xrdrank¶
Stage 2 - Analysis of the 5.6 Structure Solution (XRD) workflow · menu code 5.6.2
usage: stb-xrdrank [-h] [--input-dir INPUT_DIR] --experimental PATH
[--raw-experimental] [--wavelength WAVELENGTH]
[--two-theta-range MIN MAX] [--top TOP] [-o OUTPUT]
[--save-gnuplot] [--view] [-v] [--no-intro]
Ranks candidate structures by similarity to an experimental XRD pattern (Stage 2 - Analysis).
Part of the Structure Solution (XRD) workflow: reads every candidate structure
in --input-dir (default 'xrd_search', stb-xrdsearch's own default output
folder -- one candidate per subfolder, picking up a relaxed '*.STRUCT_OUT'
over the raw 'structure.fdf' if you've already run SIESTA there), simulates
each one's powder XRD pattern, and ranks them by similarity to an
experimental pattern -- a fast pre-screen for which candidate space group/
arrangement is most likely correct. Run it once on the raw candidates to
prioritize which to relax with real DFT, then again on the relaxed results
to confirm. Each comparison takes 10s of seconds (pyxtal's Similarity() has
no faster mode), so this can take a while for a large --input-dir.
options:
-h, --help show this help message and exit
--input-dir INPUT_DIR
Folder of candidate structures, one per subfolder (e.g. written by stb-xrdsearch as '<subfolder>/structure.fdf') -- defaults to 'xrd_search', stb-xrdsearch's own default --output-dir, so Stage 2 runs against Stage 1's output with no extra flag in the common case. If a subfolder also has a '*.STRUCT_OUT' file (from running SIESTA there), the relaxed structure is used instead of the raw one. Flat .fdf files directly in --input-dir are also accepted.
--experimental PATH Experimental XRD pattern: a plain text file with two columns (2theta intensity), whitespace- or comma-separated, '#' comments and blank lines allowed. If the file looks like a sparse list of discrete peaks (e.g. a literature peak table, or stb-xrd's own stick-pattern output) rather than a continuous scan, it is automatically Gaussian-broadened before comparing -- see --raw-experimental.
--raw-experimental Never auto-broaden a peak-list-looking --experimental file -- compare it exactly as read. Off by default (auto-detection normally handles this correctly; matches stb-xrd's own --compare-to flag of the same name).
--wavelength WAVELENGTH
X-ray source: a known name (CuKa, CuKa1, MoKa, CrKa, FeKa, CoKa, AgKa, ...) or a wavelength in Ang as a plain number (default: CuKa, 1.54184 Ang).
--two-theta-range MIN MAX
2-theta range in degrees to compute (default: 0 90).
--top TOP Only show/plot the N best-matching candidates (default: show all). The full ranking is always written to --output regardless.
-o OUTPUT, --output OUTPUT
Output ranking table file name (default: xrd_rank.txt). Always lists every candidate, regardless of --top. Gnuplot files (--save-gnuplot) are written alongside it (the report and its references file go to the current folder), in the same directory.
--save-gnuplot Also write the ranking as a gnuplot bar chart (xrd_rank.dat + xrd_rank.gplot) and the best candidate's simulated-vs-experimental pattern overlay (xrd_rank_top_sim.dat/xrd_rank_top_exp.dat + xrd_rank_overlay.gplot), all under a 'plot/' subfolder alongside --output. Off by default.
--view Show an interactive matplotlib preview (ranking bar chart + best candidate's simulated-vs-experimental overlay, one figure) before finishing. Off by default.
-v, --version show program's version number and exit
--no-intro Do not show the introduction
Usage examples:
stb-xrdrank --experimental measured.dat
stb-xrdrank --input-dir candidates --experimental measured.dat \
--wavelength MoKa --top 5
stb-xrdrank --experimental measured.dat --save-gnuplot --view