Dynamic diffraction#

pyemaps.ddiffs.EMC#

alias of EMControl

exception pyemaps.ddiffs.BlochListError(message='')#

Bases: Exception

Raised when a list of dynamic diffraction images, BImgList, is invalid.

__init__(message='')#
class pyemaps.ddiffs.BlochImgs(name)#

Bases: object

A list of dynamic diffraction (Bloch) images, each paired with the microscope controls it was simulated with, including its sample thickness. Returned by generateBloch() and getBlochImages(), and displayed by showBloch(). It’s also available as BImgList.

for emc, img in bloch_imgs:
    print(emc.simc.sth, img.shape)     # thickness (Å) and image size
__init__(name)#
Parameters:

name (str, required) – the crystal’s name.

Raises:

BlochListError – if name is empty.

property name#

The crystal’s name.

property blochList#

The images, as a list of (controls, image) tuples; each image is a 2-D numpy array.

add(emc, b)#

Add an image, with the controls it was simulated with.

Parameters:
  • emc (EMControl, required) – the controls.

  • b (2-D numpy.ndarray, required) – the image.

Raises:

BlochListError – if emc isn’t an EMControl or b isn’t a 2-D array.

sort()#

Sort the images by their controls.