Skip to content

Commit

Permalink
DefDAP consistent with mtex/aztec for hcp
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysgt committed Dec 5, 2024
1 parent b299f35 commit 0ee0826
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions defdap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
'BCC': 'cubic_bcc',
'HCP': 'hexagonal_withca',
},
'ipf_triangle_convention': 'aztec'
}

anonymous_experiment = Experiment()
6 changes: 3 additions & 3 deletions defdap/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ def add_axis(self):

elif self.plot_type == "IPF" and self.crystal_sym == "hexagonal":

triangle = 'aztec'
triangle = defaults['ipf_triangle_convention']

if triangle == 'aztec':
# line between [0001] and [01-10] ([001] and [2-10])
Expand Down Expand Up @@ -1047,9 +1047,9 @@ def add_axis(self):
# label poles
self.label_point([0, 0, 1], '0001',
pad_y=-0.012, va='top', ha='center', fontsize=12)
self.label_point([1, 0, 0], r'$2\bar{1}\bar{1}0$',
self.label_point([1, 0, 0], r'$\bar{1}2\bar{1}0$',
pad_y=-0.012, va='top', ha='center', fontsize=12)
self.label_point([np.sqrt(3), 1, 0], r'$10\bar{1}0$',
self.label_point([np.sqrt(3), 1, 0], r'$\bar{1}100$',
pad_y=0.009, va='bottom', ha='center', fontsize=12)

else:
Expand Down
11 changes: 8 additions & 3 deletions defdap/quat.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import numpy as np

from defdap import plotting
from defdap import defaults

from typing import Union, Tuple, List, Optional

Expand Down Expand Up @@ -1053,9 +1054,13 @@ def calc_fund_dirs(

elif sym_group == "hexagonal":

triangle = 'aztec'
triangle = defaults['ipf_triangle_convention']
convention = defaults['crystal_ortho_conv']

if convention.lower() in ['hkl', 'oi']:
beta += np.pi / 6

if triangle == 'aztec':
if triangle.lower() == 'aztec':

# first beta should be between 0 and 30 deg leaving 1
# symmetric equivalent per orientation
Expand All @@ -1067,7 +1072,7 @@ def calc_fund_dirs(
trial_poles = np.logical_and(beta >= delta_beta,
beta <= - (np.pi / 6 + delta_beta))

if triangle == 'mtex':
if triangle.lower() == 'mtex':

# first beta should be between -30 and 0 deg leaving 1
# symmetric equivalent per orientation
Expand Down

0 comments on commit 0ee0826

Please sign in to comment.