Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelwood100 committed Aug 27, 2020
1 parent f67cc0a commit a0dec82
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion diffsims/generators/diffraction_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
27 changes: 13 additions & 14 deletions diffsims/tests/test_sims/test_diffraction_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion diffsims/tests/test_utils/test_sim_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down

0 comments on commit a0dec82

Please sign in to comment.