DiffractionVectorLibrary#

class diffsims.libraries.vector_library.DiffractionVectorLibrary(*args, **kwargs)[source]#

Bases: dict

Maps crystal structure (phase) to diffraction vectors.

The library is a dictionary mapping from a phase name to phase information. The phase information is stored as a dictionary with the following entries:

‘indices’np.array

List of peak indices [hkl1, hkl2] as a 2D array.

‘measurements’np.array

List of vector measurements [len1, len2, angle] in the same order as the indices. Lengths in reciprocal Angstrom and angles in radians.

Attributes:
identifierslist of strings/ints

A list of phase identifiers referring to different atomic structures.

structureslist of diffpy.structure.Structure objects.

A list of diffpy.structure.Structure objects describing the atomic structure associated with each phase in the library.

reciprocal_radiusfloat

Maximum reciprocal radius used when generating the library.

Methods

DiffractionVectorLibrary.clear()

DiffractionVectorLibrary.copy()

DiffractionVectorLibrary.fromkeys(iterable)

Create a new dictionary with keys from iterable and values set to value.

DiffractionVectorLibrary.get(key[, default])

Return the value for key if key is in the dictionary, else default.

DiffractionVectorLibrary.items()

DiffractionVectorLibrary.keys()

DiffractionVectorLibrary.pickle_library(filename)

Saves a vector library in the pickle format.

DiffractionVectorLibrary.pop(key[, default])

If the key is not found, return the default if given; otherwise, raise a KeyError.

DiffractionVectorLibrary.popitem(/)

Remove and return a (key, value) pair as a 2-tuple.

DiffractionVectorLibrary.setdefault(key[, ...])

Insert key with a value of default if key is not in the dictionary.

DiffractionVectorLibrary.update([E, ]**F)

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

DiffractionVectorLibrary.values()