Script Catalog

The Script Catalog is a reference page for every script that comes with Imago. The first section groups them by the task you are doing, so that you can find the right tool without knowing its name. The second lists every script alphabetically with a one-line description, which the site search also indexes. Every script prints its own options with --help, and its page here explains them.

Scripts by task

Obtaining a structure

Script Purpose
cod_fish.py Search the Crystallography Open Database by composition and download CIF files by pinned revision.
cif2skl.py Convert a CIF to a skeleton, preserving the space group.
pdb2skl.py, xyz2skl.py, vasp2skl.py, struct2skl.py, dump2skl.py Convert PDB, XYZ, VASP, Imago structure.dat and LAMMPS dump files to skeletons.
skl2pdb.py, skl2vasp.py, skl2isaacs.py Export a skeleton to PDB, VASP POSCAR or ISAACS input.
mod_struct.py Supercells, translations, rotations, surfaces, vacuum, cutting, perturbation.
viewCell.py 3D view of the cell, the Brillouin zone and the k-points.

Preparing and running a calculation

Script Purpose
makeinput.py Expand a skeleton into the engine’s input set and a batch script.
imago.py Run the SCF and any post-SCF property calculation.
tidy_scratch.py Reclaim the scratch space finished runs leave behind.

Post-processing

Each run of Imago generates several output files for each type of calculation. Some are directly plottable; others must be processed first into figures, or into formats that external tools read. In most cases plotgraph.py is sufficient to plot a result: it handles general x-y data, densities of states, optical spectra and band structures, and is the default for all of them. If your data do not fit those categories, or the script fails on them, look at the other scripts below.

Script Accepted inputs Generated outputs Description
plotgraph.py Plottable files from Imago or any post-processing script A matplotlib, plotly or veusz script, run for you Plots general, DOS, optical and band-structure data with control over subplots, stacking, axes and curve styling.
makePDOS.py Raw PDOS file and a control file PDOS.plot Combines the per-atom or per-type partial DOS into the curves you ask for, for plotgraph.
makeSYBD.py SYBD input, output and raw eigenvalue files gs_sybd-fb.plot Merges a band-structure run’s files into one plot file with high-symmetry labels. Run automatically by imago.py.
makeBOND.py Bond order raw file Files for openDX, Paraview, VisIt, Origin Scatter data, structural models, bond profiles and meshes from bond orders and Q*.
processPOPTC.py Raw partial epsilon-2 file Raw partial optical files readable by makePDOS Runs imagoKKc on each partial pair for partial epsilon-1, ELF, refractive index, reflectivity and absorption.
makeFittedRhoV.py SCF potential, structure.dat and the potential database Profiles along each axis and openDX volumes Evaluates the fitted charge density and potential on a 3D mesh.
pot2plot.py SCF potential and structure.dat Per-element plottable files The Gaussian coefficients and the evaluated potential of every potential type.
bond_analysis.py A skeleton One file per analysis mode Geometric bond lengths, angles, coordination, Q^n, rings, and model files, with no calculation needed.
plot_deadmd.py The data files of a DEAD-MD run PNG plots Fitness, energy, density and composition versus generation.

Building and curating the databases

Script Purpose
unpackImagoDB.py Unpack the shipped databases after installing.
makeBDB.py, makePotDB.py, makeSGDB.py, runIsoAtoms.py Rebuild the basis, potential, space-group and isolated-atom databases.
build_initial_potentials.py, expand_manifest.py, makegroups.py The initial-potential database from a curated set of reference solids.
guidance_harvest.py, guidance_promote.py The historical guidance database that predicts k-point densities.
cluster_probe.py Write a starter cluster-dispatch settings file.

Amorphous models by molecular dynamics

Script Purpose
condense.py Generate the LAMMPS inputs for a reactive condensation of precursor molecules.
make_reactions.py Build the bond/react templates for one pair of molecules.
deadmd.py, deadmd_validity.py, pdf_neutron.py The genetic-algorithm search over condensation parameters, its validity gate, and the pair distribution function it scores against.
porosity.py, element_pct.py Porosity and composition of a model.

Relativistic basis sets and developer tools

Script Purpose
graspElems.py, org_radwavefn.py, make_veusz_graph.py, interFit.py Run Grasp2K, read and plot its orbitals, and fit them to Gaussians.
osrecurintg.py, osrecurintg_makenum.py Generate the Fortran source for the Gaussian integrals.
hdf5Comp.py Compare matrices between Imago HDF5 files.
insert3cbo.py Three-centre bond orders. Currently not functional.

All scripts

bond_analysis.py

Geometric bond analysis of an atomic structure from its imago.skl, with atoms counted as bonded when closer than the sum of their covalent radii times a factor. One mode per run: ball-and-stick or VTK model files, bond angle or bond length lists, bond orientational order, openDX model, bond statistics with optional histogram, coordination numbers, Q^n distribution, ring distribution, or OpenSCAD files for 3D printing.

build_initial_potentials.py

The producer of the augmented initial-potential database. Reads a curation manifest naming reference solids, fetches and converts each structure, runs or reuses a cached Imago SCF for it through kaleidoscope, harvests the converged potential at each distinct atomic environment, and writes the per-element s_gaussian_pot.toml files that makeinput.py reads to start an SCF from a solid-state potential instead of the free atom.

cif2skl.py

Converts a CIF crystal structure file into an imago.skl skeleton file while preserving the space group. The skeleton stores the asymmetric unit plus a space-group token rather than a flattened P1 cell.

cluster_probe.py

Writes a starter clusterrc.py cluster-dispatch settings file by asking the SLURM scheduler what it knows: partitions and their node sizes from sinfo, chargeable accounts from sacctmgr. Site conventions it cannot discover are left as marked FILL IN blanks.

cod_fish.py

Searches the Crystallography Open Database (COD) by composition and downloads CIF files by COD id. Four verbs separate browsing (search, rank) from reproducible acquisition (pin, get), so a pinned id and revision can always be re-fetched exactly.

condense.py

Creates every input file for a LAMMPS condensation of precursor molecules with bond/react reaction chemistry. Reads a condense.in keyword file naming the molecules, cell, compression stages and reactions, gathers reaction templates from the precursor database, packs the molecules with packmol, and writes the LAMMPS data, input and SLURM files.

deadmd.py

DEAD-MD, a genetic algorithm that searches the parameters of a condense.py plus LAMMPS bond/react condensation (cell size, compression rate, per-reaction probabilities, Rmax and caps) for amorphous models matching a target composition and density, or minimizing energy. Runs members concurrently as srun steps inside one SLURM job, driven by a deadmd.in keyword file.

deadmd_validity.py

Pass/fail gate for a condensed LAMMPS model before deadmd.py scores it. Checks that every atom has an allowed bond count for its element, that the final atom count matches the reactions that fired, and that no bond is strained beyond a tolerance. Writes validity.txt and exits 0 for valid, 1 for invalid.

dump2skl.py

Converts one frame of a LAMMPS dump file into an imago.skl skeleton file, using the LAMMPS data file to identify elements by their masses. The frame is chosen by frame number or by timestep.

element_pct.py

Prints the atomic percentage of one element in an imago.skl file by counting its atoms in the fractional coordinate block. A small helper used by the DEAD-MD genetic algorithm and handy on its own.

expand_manifest.py

Authoring tool that expands a structure sketch (from cod_fish.py –sketch-only or written by hand) into a complete curation manifest for build_initial_potentials.py, filling in the database-wide fingerprint recipe and the shared basis, functional, k-point integration and SCF threshold, either mechanically or through interactive prompts.

graspElems.py

Runs the Grasp2K relativistic atomic-structure programs for chosen elements and writes the orbitals of each atom or ion on a numerical radial grid, with a record of how each calculation went. Unoccupied orbitals are obtained from ions in which they hold an electron. Runs directly or writes job files for a cluster.

guidance_harvest.py

Reads a finished kaleidoscope k-point convergence flight off disk, finds the converged k-point density for each structure by a two-sided energy test, and stages one historical-guidance entry per structure under $IMAGO_DATA/historicalGuidanceDB/staging for a curator to promote with guidance_promote.py.

guidance_promote.py

The curator’s helper for the historical guidance database. Reviews the entries guidance_harvest.py staged and moves the accepted ones into entries/, where the k-point predictor reads them, either interactively, by an objective rule, or wholesale. Catches re-runs of an already-promoted solid and retires the duplicate.

hdf5Comp.py

Debugging tool that compares one matrix dataset in an Imago HDF5 file against another, in the same or a different file, prints both and their difference, and shows the difference as a colour map. Can unpack packed-triangle real, imaginary or magnitude storage.

imago.py

The main driver for running electronic structure calculation jobs. When run in a directory prepared by the makeinput.py script, running this will run an electronic structure calculation as specified by the command line arguments and place the output files in the current working directory.

insert3cbo.py

Merges three-centre bond order data into the two-centre bond order raw file and adds fake centroid atoms to structure.dat so that three-centre bonds can be visualised with makeBOND. NOT CURRENTLY FUNCTIONAL: it edits structure.dat while makeBOND now reads imago.skl, and must be re-merged with makeBOND before it works again.

interFit.py

Gaussian fitting of Grasp2K relativistic atomic orbitals. Reads the rwfn.out and isodata files of a Grasp2K run, sweeps the maximum Gaussian exponent and the number of terms per angular momentum channel, keeps the expansion with the lowest weighted error, and writes the atom-type and potential-type block that Imago reads, in one-, two- or four-component form.

makeBDB.py

Builds the default atomic basis set database in $IMAGO_DATA/atomicBDB. For every element it runs an atomic SCF calculation, fits the numerical free-atom potential with Gaussians, and writes the two contraction input files (core-orthogonalized and no-core) from which makeinput.py later contracts the basis.

makeBOND.py

Parses the raw bond order and Q* (effective charge) output of an Imago bond calculation and writes files for visualisation: scatter-plot data grouped by element and species, openDX or VTK structural models with colour-coded bonds and atoms, a bond profile along a lattice axis, or a 3D openDX mesh of bond order.

makeFittedRhoV.py

Evaluates the fitted SCF charge density and potential of an Imago calculation on a 3D real-space mesh, plus their differences from isolated-atom values, by building an input file for the imagoRhoV Fortran program and running it. Produces profile data along each lattice axis and openDX volume files.

makePDOS.py

Partial density of states post-processor. Reads the raw PDOS file from an Imago DOS calculation and combines its per-atom or per-type data units into the curves you ask for, either by a control file or by internal defaults, producing a PDOS.plot file for plotgraph.py.

makePotDB.py

Builds the default atomic potential database in $IMAGO_DATA/atomicPDB. For every element it writes the potential definition file pot1 and fits the numerical free-atom potential from makeBDB with a linear Gaussian expansion to produce the initial SCF potential coefficients in coeff1.

makeSGDB.py

Builds the space group database consumed by applySpaceGroup. Reads a plain-text table of all 230 space groups in x,y,z operation notation, decomposes every operation into a rotation matrix and fractional shift, expands non-primitive lattices, writes one file per space-group setting and creates the numeric symbolic links by which skeletons name a setting.

makeSYBD.py

Merges the three files of an Imago symmetric band structure (SYBD) calculation into one plot-ready file: each k-point line carries its path coordinate and band energies, and the high-symmetry k-points are annotated with their position and label. imago.py runs it automatically at the end of a -sybd job.

make_reactions.py

Creates the pre-reaction and post-reaction molecule template files and the atom map that LAMMPS fix bond/react needs for one pair of precursor molecules, by identifying leaving (surface) atoms on each, orienting the molecules for bonding, merging them, and pruning the result to the atoms within a chain length of the new bond.

make_veusz_graph.py

Writes Veusz plot documents of the Grasp2K relativistic orbitals in the current directory: one page per orbital showing the large and small components divided by r against radius, plus a second document of the fitted orbital equations when a fit is present.

makegroups.py

Groups the atoms of a non-crystalline (P1) skeleton into species by their bispectrum local-environment fingerprints. Runs makeinput and an imago.py -loen pass to compute the descriptors inside the engine, clusters atoms of each element by fingerprint distance, and rewrites the skeleton with explicit per-element species tags.

makeinput.py

Takes a skeleton file input (default: imago.skl) and prepares all the files imago.py requires for input. Including a default slurm file for submitting to a system utilizing slurm submission.

mod_struct.py

Modifies an imago.skl structure by applying an ordered sequence of operations given on the command line: supercell replication with optional mirroring, translation, rotation about an axis or plane normal, reorientation of a Miller direction to z for surfaces, vacuum insertion, sphere and block cutting, orthorhombic conversion and random perturbation.

org_radwavefn.py

Parser for Grasp2K Dirac four-component relativistic wavefunctions. Reads rwfn.out and isodata from the current directory and writes a CSV of orbital eigenvalues plus one CSV per orbital of the large and small components on the radial grid. Also the library that interFit.py and make_veusz_graph.py import.

osrecurintg.py

Code generator for the Obara-Saika recursive evaluation of one-electron Gaussian integrals. Writes the Fortran source (gaussIntegrals.f90, optionally vectorised) that the Imago engine compiles for overlap, kinetic, nuclear, electronic, momentum, mass-velocity, dipole, derivative and plane-wave integrals, or a self-checking test program comparing analytic against numerical integration.

osrecurintg_makenum.py

Derives the integrand equations used for numerical, brute-force evaluation of the multicentre Gaussian integrals, and prints them as Fortran code chunks for pasting into the osrecurintg numerical module. Separated from osrecurintg.py because the derivation is slow and need not be repeated on every run.

pdb2skl.py

Converts a Protein Data Bank (.pdb) file into an imago.skl skeleton file with the atoms sorted by element, and writes a map file recording which PDB atom became which skeleton atom.

pdf_neutron.py

Computes the normalised, optionally neutron-weighted total pair distribution function g(r) or reduced G(r) of a periodic model from an imago.skl file, including periodic images, for comparison with diffraction experiments. Used by deadmd.py for its PDF fitness metric.

plot_deadmd.py

Plotting utility for DEAD-MD genetic algorithm runs. Reads the per-generation data files written by deadmd.py and saves PNG plots of fitness, energy, density, element percentage and composition versus generation, optionally displaying them over X11.

plotgraph.py

General-purpose plotter for Imago output. Reads a column-oriented data file, writes a plotting script for matplotlib, plotly or veusz, and runs it. Has dedicated figure types for density of states, optical properties and symmetric band structures, with control over subplots, curve stacking, axis limits and curve styling.

porosity.py

Calculates the porosity of a solid from an imago.skl file by sampling the cell on a regular mesh and marking every point within a scaled covalent radius of an atom as solid. Porosity is the fraction of the cell volume left unmarked.

pot2plot.py

Converts an Imago SCF potential file (scfV) and its structure.dat into per-element plottable files: one listing the Gaussian potential coefficients of every potential type of the element, and one evaluating each potential function on a radial grid.

processPOPTC.py

Partial optical properties post-processor. Splits the raw partial epsilon-2 file from an Imago POPTC calculation into its partial pairs, runs the Kramers-Kronig program imagoKKc on each, and gathers the resulting partial epsilon-1, ELF, refractive index, reflectivity and absorption into raw files that makePDOS.py can read.

runIsoAtoms.py

Runs a full Imago SCF calculation for every element as an isolated atom in a 20 Angstrom box and collects the converged potentials into an atomPDB directory, giving an isolated-atom potential database computed with the solid-state code itself rather than with atomSCF.

skl2isaacs.py

Converts an imago.skl skeleton file into the two input files of ISAACS, the Interactive Structure Analysis of Amorphous and Crystalline Structures tool: an XML project file (.ipf) and a Chem3D coordinate file (.chem3d).

skl2pdb.py

Converts an imago.skl skeleton file into a Protein Data Bank (.pdb) file with the atoms sorted by element, and writes a map file recording which skeleton atom became which PDB atom. Useful for viewing an Imago structure in molecular visualisation software.

skl2vasp.py

Converts an imago.skl skeleton file into VASP input. At present only the POSCAR file is written; the options for pseudopotential type, GW, Gamma-point sampling, job type and cell type are accepted and stored for the POTCAR, KPOINTS and INCAR generation that is not yet ported.

struct2skl.py

Converts an Imago structure.dat file back into an imago.skl skeleton file with the atoms sorted by element, and writes a map file recording which structure.dat atom became which skeleton atom.

tidy_scratch.py

Reclaims the intermediate scratch behind finished Imago runs, which is almost all of the bytes a run leaves, while never removing a run directory, an unfinished run, or anything a symlink points to outside $IMAGO_TEMP. Handles a kaleidoscope flight workspace or a tree of ordinary job directories. Previews by default; deletes only with –apply.

unpackImagoDB.py

One-time post-install step. Unpacks the five database tarballs shipped with Imago (atomic basis sets, atomic potentials, atomic SCF precursor data, space groups, and symmetric band k-point paths) in $IMAGO_DATA and regenerates the space group files.

vasp2skl.py

Converts a VASP position file (CONTCAR or POSCAR) into an imago.skl skeleton file, taking the element names from the POTCAR file. Supports both VASP 4.6 and VASP 5.x formats and skips selective-dynamics lines.

viewCell.py

Interactive 3D viewer for the real-space cell, the reciprocal cell, a chosen Brillouin zone, the k-point mesh, the folded k-points scaled by weight, and the band-structure path, read from a BZ. file produced by makeinput.py -printbz. Built on vedo.

xyz2skl.py

Converts a plain XYZ Cartesian coordinate file into an imago.skl skeleton file with the atoms sorted by element, building an enclosing orthorhombic P1 cell, and writes a map file recording which XYZ atom became which skeleton atom.