pyemaps.kdiffs module

Kinematic diffraction module is designed to handle kinematic simulation data. It is composed of Point, Line and Disk class objects.

class pyemaps.kdiffs.Point(p=(0.0, 0.0))

Bases: object

Coordinates of kinematic diffraction pattern object.

__init__(p=(0.0, 0.0))
property x

X coordinate

property y

Y coordinate

class pyemaps.kdiffs.Line(pt1=Point(), pt2=Point(), intensity=0, type=1)

Bases: object

Kikuchi line representation in kinematic diffraction patterns.

__init__(pt1=Point(), pt2=Point(), intensity=0, type=1)
property pt1

The first end point of a Line

property pt2

The second end point of a Line

property type

The type of a Line: Kikuchi line or HOLZ line

property intensity

Line intensity

calOpacity(l, h)

Calculate the line opacity based on its intensity value

0.2 -> lowest intensity 0.35-> highest intensity

to_dict()
class pyemaps.kdiffs.Index(I0=(0, 0, 0))

Bases: object

Miller Indexes of a diffracted beam representation in kinematic diffraction pattern.

__init__(I0=(0, 0, 0))
property I1

The first element of Miller Index of a diffracted beam

property I2

The second element of Miller Index of a diffracted beam

property I3

The third element of Miller Index of a diffracted beam

class pyemaps.kdiffs.Disk(c=Point(), r=0.0, i=Index())

Bases: object

Diffracted beams representation in kinematic diffraction patterns

__init__(c=Point(), r=0.0, i=Index())
property c

The center point of a diffracted beam.

property r

The radius of a diffracted beam.

property idx

The Miller index of a diffracted beam.

to_dict()

Creates a diffracted beam object from a dict pyton object

class pyemaps.kdiffs.diffPattern(diff_dict)

Bases: object

Create a kinematic diffraction pattern based on the pyemaps kinematic simulation output in python dict object.

See :doc:Visualization for how to visualize kinematic diffraction patterns using this object.

__init__(diff_dict)
Parameters:

diff_dict (dict, required) – Only accepts output from pyemaps kinematic diffraction run.

property klines

Kikuchi lines array

property hlines

Holz lines array

property disks

Disks array

property name

Crystal name

property shift

Shifts of the diffraction pattern

property nklines

Number of Kikuchi lines

property nhlines

Number of HOLZ lines

property ndisks

Number of Disks

to_dict()
class pyemaps.kdiffs.Diffraction(name, mode=DEF_MODE)

Bases: object

List of DP objects and its associated EMControl objects.

__init__(name, mode=DEF_MODE)
property name
property mode
property diffList
add(emc, diffP)

Append a new kenematic diffraction pattern with its associated controls

sort()

Sorting diffraction list by controls

clear()

Empty the DP list, leaving it as empty.