diffpy.structure.expansion package

Methods and classes for manipulating Structure instances.

Package content:
  • supercell – create a supercell from an existing Structure.

Submodules

diffpy.structure.expansion.shapeutils module

Utilities for making shapes.

diffpy.structure.expansion.shapeutils.findCenter(S)[source]

Find the approximate center Atom of a Structure.

The center of the Structure is the Atom closest to (0.5, 0.5, 0.5).

Parameters:

S (Structure) – A Structure instance.

Returns:

The index of the center Atom.

Return type:

int

diffpy.structure.expansion.makeellipsoid module

Make a spheroid nanoparticle from a template structure.

diffpy.structure.expansion.makeellipsoid.makeEllipsoid(S, a, b=None, c=None)[source]

Cut a Structure out of another one.

Parameters:
  • S (Structure) – A Structure instance.

  • a (float) – Primary equatorial radius (along x-axis).

  • b (float, Optional) – Secondary equatorial radius (along y-axis). If b is None (default), then it is set equal to a.

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

Returns:

A new Structure instance.

Return type:

Structure

diffpy.structure.expansion.makeellipsoid.makeSphere(S, radius)[source]

Create a spherical nanoparticle.

Parameters:
  • S (Structure) – A Structure instance.

  • radius (float) – Primary equatorial radius (along x-axis).

Returns:

A new Structure instance.

Return type:

Structure

diffpy.structure.expansion.supercell_mod module

This module contains functions for simple Structure manipulation.

diffpy.structure.expansion.supercell_mod.supercell(S, mno)[source]

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.

Parameters:
  • S (Structure) – An instance of Structure from diffpy.structure.

  • mno (array_like) – Sequence of 3 integers for cell multipliers along the a, b and c axes.

Returns:

A new Structure instance representing the expanded supercell.

Return type:

Structure

Raises:
  • TypeErrorS is not a Structure instance.

  • ValueError – Invalid mno argument.