Skip to content

Commit

Permalink
fix: support alpha 7 in utils.spread_orientations
Browse files Browse the repository at this point in the history
  • Loading branch information
aplowman committed Dec 13, 2023
1 parent dea39da commit 47901c0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions damask_parse/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1767,7 +1767,6 @@ def spread_orientations(volume_element, phase_names, sigmas):
# each identified constituent will be split into one or more constituents, corresponding
# to the number of assigned voxels:
for const_idx_i in const_idx:

base_ori = volume_element["orientations"]["quaternions"][
volume_element["constituent_orientation_idx"][const_idx_i]
]
Expand All @@ -1778,9 +1777,16 @@ def spread_orientations(volume_element, phase_names, sigmas):
num_elems = len(elem_idx[0])

# generate a set of orientations that have a defined spread:
spread_oris = Rotation.from_spherical_component(
base_ori_dmsk, sigma=sigma, degrees=True, N=num_elems
)
try:
# known: v3 alpha 7
spread_oris = Rotation.from_spherical_component(
base_ori_dmsk, sigma=sigma, degrees=True, shape=num_elems
)
except TypeError:
# known: v3 alpha 3
spread_oris = Rotation.from_spherical_component(
base_ori_dmsk, sigma=sigma, degrees=True, N=num_elems
)

cur_num_consts = volume_element["constituent_material_idx"].shape[0]
cur_num_oris = volume_element["orientations"]["quaternions"].shape[0]
Expand Down

0 comments on commit 47901c0

Please sign in to comment.