Skip to content

Commit

Permalink
Small refactor and some more docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
pc494 committed Sep 2, 2020
1 parent d8fb291 commit a9c6e38
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
12 changes: 2 additions & 10 deletions diffsims/generators/diffraction_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
get_vectorized_list_for_atomic_scattering_factors,
is_lattice_hexagonal,
get_intensities_params,
get_scattering_params_dict
)
from diffsims.utils.fourier_transform import from_recip

Expand Down Expand Up @@ -76,18 +77,9 @@ def __init__(
"This class changed in v0.3 and no longer takes a maximum_excitation_error"
)
self.wavelength = get_electron_wavelength(accelerating_voltage)
self.scatterng_params = get_scattering_params_dict(scattering_params)
self.debye_waller_factors = debye_waller_factors

scattering_params_dict = {"lobato": "lobato", "xtables": "xtables"}
if scattering_params in scattering_params_dict:
self.scattering_params = scattering_params_dict[scattering_params]
else:
raise NotImplementedError(
"The scattering parameters `{}` is not implemented. "
"See documentation for available "
"implementations.".format(scattering_params)
)

def calculate_ed_data(
self,
structure,
Expand Down
16 changes: 8 additions & 8 deletions diffsims/utils/sim_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,15 @@ def get_kinematical_intensities(
structure : Structure
The structure for which to derive the structure factors.
g_indices : array-like
Indicies of spots to be considered
g_hkls_array : array-like
debye_waller_factors : bool
scattering_params :
prefactor :
coordinates of spots to be considered
debye_waller_factors : dict of str:value pairs
Maps element names to their temperature-dependent Debye-Waller factors.
scattering_params : str
"lobato" or "xtables"
prefactor : array-like
multiplciation factor for structure factor
Returns
-------
peak_intensities : array-like
Expand Down

0 comments on commit a9c6e38

Please sign in to comment.