Skip to content

Commit

Permalink
Revert "Revert "Update to sim_utils""
Browse files Browse the repository at this point in the history
This reverts commit fa23b3f.
  • Loading branch information
isabelwood100 committed Aug 7, 2020
1 parent fa23b3f commit 67e7abe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 0 additions & 2 deletions diffsims/generators/diffraction_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ def calculate_ed_data(
max_excitation_error,
debye_waller_factors,
scattering_params,
shape_factor_use = True
)

# Threshold peaks included in simulation based on minimum intensity.
Expand Down Expand Up @@ -244,7 +243,6 @@ def calculate_profile_data(
max_excitation_error,
debye_waller_factors,
scattering_params,
shape_factor_use = False
)

if is_hex:
Expand Down
14 changes: 7 additions & 7 deletions diffsims/utils/sim_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ def is_perm(hkl1, hkl2):
unique[hkl2].append(hkl1)
break
if not found:
unique[hkl1].append(hkl1)
unique[tuple(hkl1)].append(hkl1)

pretty_unique = {}
for k, v in unique.items():
pretty_unique[sorted(v)[-1]] = len(v)
pretty_unique[tuple(sorted(v)[-1])] = len(v)

return pretty_unique

Expand Down Expand Up @@ -224,11 +224,10 @@ def get_kinematical_intensities(
g_indices,
g_hkls,
multiplicities,
excitation_error,
maximum_excitation_error,
excitation_error=None,
maximum_excitation_error=None,
debye_waller_factors,
scattering_params="lobato",
shape_factor_use
):
"""Calculates peak intensities.
Expand Down Expand Up @@ -292,9 +291,10 @@ def get_kinematical_intensities(

##since get_kinematical_intensities is now used for both calculate_profile_data
##and calculate_ed_data need an if else for shape_factor
if shape_factor_use = True
if excitation_error :
shape_factor = 1 - (excitation_error / maximum_excitation_error)
else shape_factor = 1

else : shape_factor = 1


# Calculate the peak intensities from the structure factor and excitation
Expand Down

0 comments on commit 67e7abe

Please sign in to comment.