TOPAS LCCEM
Menus, snippets, CIF/checkCIF tools and INP-template customizations used at LCCEM (Laboratório de Cristalografia e Caracterização Estrutural de Materiais, UFABC, Brazil) with TOPAS-Academic in Visual Studio Code.
TOPAS LCCEM works on top of the TOPAS Editor extension by John Evans, which is installed automatically as a dependency.
Features
A TOPAS_LCCEM menu is added to the TOPAS Editor menus, organised by workflow:
| Menu |
Contents |
| 1. Rietveld or Pawley INP file |
New INP from a data file; instrument blocks for the Stoe STADI-P (Cu, Mo, Ag, transmission, Ge(111) monochromator, Mythen 1K); zero-error and sample-shift corrections; phases from CIF, str/ISODISTORT or by hand; Pawley phase; preferred orientation (March–Dollase, spherical harmonics) |
| 2. Peak Fitting |
Peak-fitting INP, STADI-P instrument parameters, xo_Is peak-fitting block |
| 3. Indexing |
Indexing template INP |
| 4. Anisotropic Broadening |
Anisotropic size (general, AnisoCS) and strain (spherical harmonics; Stephens model for tetragonal, monoclinic, hexagonal/trigonal, orthorhombic) |
| 5. LCCEM Validation |
Extract Rietveld Stats: builds <name>_complete.cif from the open .inp and its .out/.cif/.fcf (publication boilerplate, R-factors, cell, reflection list and, when TOPAS can be run, bonds/angles). Rietveld → CheckCIF Report: reveals that CIF in Explorer and opens checkCIF in the browser. |
The instrument snippets describe the LCCEM diffractometers; users of other instruments can use them as a starting point.
INP-template customizations
TOPAS LCCEM adjusts the text that TOPAS Editor writes into new INP files:
- new INP header with one R-factor per line,
macro ciffile { <name>.cif }, do_errors and no_LIMIT_warnings;
Out_pdCIF writes to the ciffile macro;
- phases imported from CIF get
Phase_Density_g_on_cm3(0) and a tidier layout;
- the default
TCHZ_Peak_Type line is inserted commented out (the instrument block defines the peak shape);
- background written one coefficient per line, without
Simple_Axial_Model.
These changes are made to TOPAS Editor's own dist/extension.js (the original is kept as extension.js.orig) and are re-applied automatically after every TOPAS Editor update. If a new TOPAS Editor version changes the relevant code, nothing is modified and a warning is shown.
Don't want them? Set topasLccem.applyEdits to false, or run TOPAS LCCEM: Disable edits and restore original TOPAS Editor files. The original TOPAS Editor files are restored and the menus keep working.
Requirements
- TOPAS-Academic (licence required) and the TOPAS Editor extension (installed automatically).
- Python 3 for the 5. LCCEM Validation menu only (python.org; tick "Add python.exe to PATH"). Only the standard library is used.
Getting started
- Install TOPAS LCCEM from the Extensions panel (this also installs TOPAS Editor).
- Complete the TOPAS Editor setup when asked (choose your TOPAS directory).
- When "TOPAS LCCEM: … Reload the window to use them." appears, click Reload now.
The LCCEM menus then appear together with the TOPAS Editor menus. If TOPAS Editor's own "menu setup" is run later, the LCCEM menus are restored automatically.
Commands
| Command |
What it does |
TOPAS LCCEM: Reapply edits and menus |
Re-applies the template customizations and the LCCEM menus |
TOPAS LCCEM: Disable edits and restore original TOPAS Editor files |
Sets topasLccem.applyEdits to false and restores TOPAS Editor's original files |
Settings
| Setting |
Default |
Description |
topasLccem.applyEdits |
true |
Apply the INP-template customizations to TOPAS Editor |
topasLccem.scriptsDir |
(empty) |
Folder with the LCCEM Python scripts; empty = use the copy bundled with the extension |
Troubleshooting
View → Output → TOPAS LCCEM shows what the extension did (edits applied or already present, menus updated, errors). Please include it when reporting a problem.
About
Developed at LCCEM, Federal University of ABC (UFABC), Brazil.
Contact: Fabio Furlan — lccem.ufabc@gmail.com
TOPAS Editor is developed by John Evans (Durham University); TOPAS-Academic by Alan Coelho. TOPAS LCCEM is an independent add-on and is not affiliated with either.
Released under the MIT License.