diff --git a/diffsims/generators/diffraction_generator.py b/diffsims/generators/diffraction_generator.py index 3bb7cbeb..7bb677aa 100644 --- a/diffsims/generators/diffraction_generator.py +++ b/diffsims/generators/diffraction_generator.py @@ -246,7 +246,7 @@ def calculate_profile_data( if is_hex: # Use Miller-Bravais indices for hexagonal lattices. - hkl = (hkl[0], hkl[1], -hkl[0] - hkl[1], hkl[2]) + g_indices = (g_indices[0], g_indices[1], -g_indices[0] - g_indices[1], g_indices[2]) hkls_labels = ["".join([str(int(x)) for x in xs]) for xs in unique_hkls] diff --git a/diffsims/tests/test_sims/test_diffraction_simulation.py b/diffsims/tests/test_sims/test_diffraction_simulation.py index d3553806..175235ca 100644 --- a/diffsims/tests/test_sims/test_diffraction_simulation.py +++ b/diffsims/tests/test_sims/test_diffraction_simulation.py @@ -66,22 +66,21 @@ def profile_simulation(): ] ), hkls=[ - {(1, 1, 1): 8}, - {(2, 2, 0): 12}, - {(3, 1, 1): 24}, - {(4, 0, 0): 6}, - {(3, 3, 1): 24}, - {(4, 2, 2): 24}, - {(3, 3, 3): 8, (5, 1, 1): 24}, - {(4, 4, 0): 12}, - {(5, 3, 1): 48}, - {(6, 2, 0): 24}, - {(5, 3, 3): 24}, - {(4, 4, 4): 8}, + (1, 1, 1), + (2, 2, 0), + (3, 1, 1), + (4, 0, 0), + (3, 3, 1), + (4, 2, 2), + (3, 3, 3), + (4, 4, 0), + (5, 3, 1), + (6, 2, 0), + (5, 3, 3), + (4, 4, 4), ], ) - def test_plot_profile_simulation(profile_simulation): profile_simulation.get_plot(g_max=1) @@ -167,7 +166,7 @@ def test_assertion_free_get_diffraction_pattern(self): ) z = short_sim.get_diffraction_pattern() - + empty_sim = DiffractionSimulation( coordinates=np.asarray([[0.3, 1000, 0]]), intensities=np.ones(1), diff --git a/diffsims/tests/test_utils/test_sim_utils.py b/diffsims/tests/test_utils/test_sim_utils.py index 93000891..167d0186 100644 --- a/diffsims/tests/test_utils/test_sim_utils.py +++ b/diffsims/tests/test_utils/test_sim_utils.py @@ -157,7 +157,7 @@ def test_get_kinematical_intensities(default_structure): unique_hkls, multiplicites, g_hkls = get_intensities_params(reciprocal_lattice, reciprocal_radius) g_hkls_array = np.asarray(g_hkls) i_hkls = get_kinematical_intensities( - struct, + default_structure, g_indices=unique_hkls, g_hkls_array=g_hkls_array, debye_waller_factors={1:1},