soprano.scripts.molecules

soprano.scripts.molecules#

CLI to extract all molecules in a molecular crystal (in any ASE-readable format) and output the in individual structure files.

Functions

extract_molecules(atoms, use_cell_indices, ...)

redefine_unit_cell(atoms, cell[, center, vacuum])

Redefine the unit cell of the structure. If center is True, the structure is centered in the cell. (Centers the atoms in the unit cell, so there is the same amount of vacuum on all sides.) If vacuum is not None, a minimum vacuum is enforced. cell can be a single float (-> a cubic cell is created with that lattice constant) or as three floats (a b c -> an orthorhombic cell is created with the given side lengths) or as six floats (a b c alpha beta gamma) or a 3x3 np.array defining the full unit cell.

validate_cell(ctx, param, value)

write_molecules(molecules, output_dir, ...)

Write the molecules to individual files.

soprano.scripts.molecules.redefine_unit_cell(atoms, cell, center=False, vacuum=None)[source]#

Redefine the unit cell of the structure. If center is True, the structure is centered in the cell. (Centers the atoms in the unit cell, so there is the same

amount of vacuum on all sides.)

If vacuum is not None, a minimum vacuum is enforced. cell can be a single float (-> a cubic cell is created with that lattice constant) or as three floats (a b c -> an orthorhombic cell is created with the given side lengths) or as six floats (a b c alpha beta gamma) or a 3x3 np.array defining the full unit cell.

Parameters:
  • atoms (Atoms)

  • cell (ndarray)

soprano.scripts.molecules.write_molecules(molecules, output_dir, format, seedname)[source]#

Write the molecules to individual files.