|
11 | 11 | """
|
12 | 12 |
|
13 | 13 | import numpy as np
|
14 |
| -import diffpy |
15 | 14 | import matplotlib.pyplot as plt
|
| 15 | +from diffpy.structure import Atom, Lattice, Structure |
| 16 | + |
16 | 17 | from diffsims.libraries.structure_library import StructureLibrary
|
17 | 18 | from diffsims.generators.diffraction_generator import DiffractionGenerator
|
18 | 19 | from diffsims.generators.library_generator import DiffractionLibraryGenerator
|
19 | 20 |
|
20 | 21 |
|
21 |
| -latt = diffpy.structure.lattice.Lattice(4, 4, 4, 90, 90, 90) |
| 22 | +latt = Lattice(4, 4, 4, 90, 90, 90) |
22 | 23 | atoms = [
|
23 |
| - diffpy.structure.atom.Atom(atype="Al", xyz=[0.0, 0.0, 0.0], lattice=latt), |
24 |
| - diffpy.structure.atom.Atom(atype="Al", xyz=[0.5, 0.5, 0.0], lattice=latt), |
25 |
| - diffpy.structure.atom.Atom(atype="Al", xyz=[0.5, 0.0, 0.5], lattice=latt), |
26 |
| - diffpy.structure.atom.Atom(atype="Al", xyz=[0.0, 0.5, 0.5], lattice=latt), |
| 24 | + Atom(atype="Al", xyz=[0.0, 0.0, 0.0], lattice=latt), |
| 25 | + Atom(atype="Al", xyz=[0.5, 0.5, 0.0], lattice=latt), |
| 26 | + Atom(atype="Al", xyz=[0.5, 0.0, 0.5], lattice=latt), |
| 27 | + Atom(atype="Al", xyz=[0.0, 0.5, 0.5], lattice=latt), |
27 | 28 | ]
|
28 |
| -structure_matrix = diffpy.structure.Structure(atoms=atoms, lattice=latt) |
| 29 | +structure_matrix = Structure(atoms=atoms, lattice=latt) |
29 | 30 | euler_angles = np.array([[0, 0, 0], [10.0, 0.0, 0.0]])
|
30 | 31 | struct_library = StructureLibrary(["Al"], [structure_matrix], [euler_angles])
|
31 | 32 | diff_gen = DiffractionGenerator(accelerating_voltage=200)
|
|
43 | 44 | # New
|
44 | 45 | # ---
|
45 | 46 |
|
46 |
| -import diffpy |
47 | 47 | from orix.crystal_map import Phase
|
48 | 48 | from orix.quaternion import Rotation
|
49 | 49 | from diffsims.generators.simulation_generator import SimulationGenerator
|
50 | 50 |
|
51 |
| -latt = diffpy.structure.lattice.Lattice(4, 4, 4, 90, 90, 90) |
| 51 | +latt = Lattice(4, 4, 4, 90, 90, 90) |
52 | 52 | atoms = [
|
53 |
| - diffpy.structure.atom.Atom(atype="Al", xyz=[0.0, 0.0, 0.0], lattice=latt), |
54 |
| - diffpy.structure.atom.Atom(atype="Al", xyz=[0.5, 0.5, 0.0], lattice=latt), |
55 |
| - diffpy.structure.atom.Atom(atype="Al", xyz=[0.5, 0.0, 0.5], lattice=latt), |
56 |
| - diffpy.structure.atom.Atom(atype="Al", xyz=[0.0, 0.5, 0.5], lattice=latt), |
| 53 | + Atom(atype="Al", xyz=[0.0, 0.0, 0.0], lattice=latt), |
| 54 | + Atom(atype="Al", xyz=[0.5, 0.5, 0.0], lattice=latt), |
| 55 | + Atom(atype="Al", xyz=[0.5, 0.0, 0.5], lattice=latt), |
| 56 | + Atom(atype="Al", xyz=[0.0, 0.5, 0.5], lattice=latt), |
57 | 57 | ]
|
58 |
| -structure_matrix = diffpy.structure.Structure(atoms=atoms, lattice=latt) |
| 58 | +structure_matrix = Structure(atoms=atoms, lattice=latt) |
59 | 59 | p = Phase("Al", point_group="m-3m", structure=structure_matrix)
|
60 | 60 | gen = SimulationGenerator(accelerating_voltage=200)
|
61 | 61 | rot = Rotation.from_euler([[0, 0, 0], [10.0, 0.0, 0.0]], degrees=True)
|
|
78 | 78 | axs[i, 1].set_xlim(-1.5, 1.5)
|
79 | 79 | axs[i, 1].set_ylim(-1.5, 1.5)
|
80 | 80 |
|
81 |
| -axs[0, 0].set_title("Old") |
82 |
| -axs[0, 1].set_title("New") |
| 81 | +_ = axs[0, 0].set_title("Old") |
| 82 | +_ = axs[0, 1].set_title("New") |
| 83 | + |
| 84 | +# %% |
0 commit comments