diffpy.structure.expansion package


diffpy.structure.expansion.makeellipsoid module

Make a spheroid nanoparticle from a template structure.

makeSphere(S, radius)

Create a spherical nanoparticle.

Arguments S – A Structure instance radius – primary equatorial radius (along x-axis)

Returns a new structure instance

makeEllipsoid(S, a, b=None, c=None)

Cut a structure out of another one.

Arguments S – A Structure instance a – primary equatorial radius (along x-axis) b – secondary equatorial radius (along y-axis). If b is None

(default) then it is set equal to a
c – polar radius (along z-axis). If c is None (default), then it is
set equal to a.

Returns a new structure instance

diffpy.structure.expansion.shapeutils module

Utilities for making shapes.


Find the approximate center atom of a structure.

The center of the structure is the atom closest to (0.5, 0.5, 0.5)

Returns the index of the atom.

diffpy.structure.expansion.supercell_mod module

This module contains functions for simple structure manipulation.

supercell(S, mno)

Perform supercell expansion for a structure.

New lattice parameters are multiplied and fractional coordinates divided by corresponding multiplier. New atoms are grouped with their source in the original cell.

S – an instance of Structure from diffpy.structure. mno – sequence of 3 integers for cell multipliers along

the a, b and c axes.

Return a new expanded structure instance. Raise TypeError when S is not Structure instance. Raise ValueError for invalid mno argument.

Module contents

Methods and classes for manipulating Structure instances.

Package content:

supercell – create a supercell from an existing Structure.