Skip to content

stb-translate

File Translator · menu code 3.1 · guide: 3.1 File Translator

usage: stb-translate [-h] [-if {cif,dftb,fdf,fhi,poscar,siesta,xsf,xyz}] -i IN_FILE
                     [-of {cif,dftb,fdf,fhi,lammps,poscar,xsf,xyz}] [-o OUT_FILE]
                     [--out-dir OUT_DIR] [--dry-run] [-cf {direct,cartesian}]
                     [--cif-symprec ANG]
                     [--lattice-vectors AX AY AZ BX BY BZ CX CY CZ] [--view]
                     [--view-image PATH] [-v] [--no-intro]

Structure file converter: reads one structure (or a glob of them) in one format and writes it in another, with a report of what was read and a check of what was written. Both formats are detected from the file names when -if/-of are omitted.

options:
  -h, --help            show this help message and exit
  -if {cif,dftb,fdf,fhi,poscar,siesta,xsf,xyz}, --in-format {cif,dftb,fdf,fhi,poscar,siesta,xsf,xyz}
                        Input format: poscar, cif, siesta [SIESTA STRUCT_OUT], xyz, fhi, dftb, xsf, fdf [SIESTA input]. Default: from --in-file's name (.vasp/POSCAR/CONTCAR, .cif, .STRUCT_OUT, .xyz, .in, .gen, .xsf, .fdf), per file in batch mode.
  -i IN_FILE, --in-file IN_FILE
                        Input file, or a glob pattern (e.g. '*.cif') for batch conversion.
  -of {cif,dftb,fdf,fhi,lammps,poscar,xsf,xyz}, --out-format {cif,dftb,fdf,fhi,lammps,poscar,xsf,xyz}
                        Output format: cif, xyz, poscar, fdf, dftb, xsf, fhi, lammps [LAMMPS data, atom_style atomic, metal units]. Default: from --out-file's name (.cif, .xyz, .fdf, .vasp/.poscar/POSCAR, .gen, .in, .xsf, .data/.lmp). Required in batch mode.
  -o OUT_FILE, --out-file OUT_FILE
                        Output file. Required unless --dry-run, or in batch mode (--out-dir instead).
  --out-dir OUT_DIR     Output directory in batch mode: each output is named after its input with the output format's extension.
  --dry-run             Read and report only (structure, symmetry, checks); write no structure file (the report and its references are always written).
  -cf {direct,cartesian}, --coord-format {direct,cartesian}
                        Coordinates of the output: direct (fractional) or cartesian. Default: the input's, or the output format's own.
  --cif-symprec ANG     CIF output only: tolerance with which the space group is found and written (default: 0.01 Ang). The atoms are moved onto their exact symmetric positions (by up to this much) and the asymmetric unit is written in the standard setting -- what a database or a paper expects. 0 writes P1: the cell and the positions exactly as read.
  --lattice-vectors AX AY AZ BX BY BZ CX CY CZ
                        The 3 lattice vectors (Cartesian, Ang), needed for an XYZ input, e.g. 5.43 0 0 0 5.43 0 0 0 5.43. Applied to every file in batch mode.
  --view                Open the structure in ASE's 3D viewer at the end (needs a display).
  --view-image PATH     Save a 3D snapshot to PATH (a directory in batch mode, one PNG per file). No display needed.
  -v, --version         show program's version number and exit
  --no-intro            Do not show the introduction

Example usage:
  stb-translate -i si.cif -o si.fdf                 # both formats from the names
  stb-translate -i POSCAR -o structure.xyz -cf cartesian
  stb-translate -i siesta.STRUCT_OUT -of cif -o relaxed.cif
  stb-translate -i '*.cif' -of fdf --out-dir fdf/   # batch
  stb-translate -i slab.fdf --dry-run                # report only