Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 9f258513 authored by usov_i's avatar usov_i
Browse files

Calculate and display y_dir

parent afea511b
No related branches found
No related tags found
No related merge requests found
...@@ -132,6 +132,7 @@ def create(): ...@@ -132,6 +132,7 @@ def create():
# Calculate y-direction in plot (orthogonal to x-direction and out-of-plane direction) # Calculate y-direction in plot (orthogonal to x-direction and out-of-plane direction)
y_c = np.cross(x_c, o_c) y_c = np.cross(x_c, o_c)
hkl_in_plane_y.value = " ".join([f"{val:.1f}" for val in y_c])
# Calculate distance of all points to plane # Calculate distance of all points to plane
Q = np.array(o_c) * orth_cut Q = np.array(o_c) * orth_cut
...@@ -211,6 +212,7 @@ def create(): ...@@ -211,6 +212,7 @@ def create():
hkl_cut = Spinner(title="cut", value=0, step=0.1, width=70) hkl_cut = Spinner(title="cut", value=0, step=0.1, width=70)
hkl_delta = NumericInput(title="delta", value=0.1, mode="float", width=70) hkl_delta = NumericInput(title="delta", value=0.1, mode="float", width=70)
hkl_in_plane_x = TextInput(title="in-plane X", value="1 0 0", width=70) hkl_in_plane_x = TextInput(title="in-plane X", value="1 0 0", width=70)
hkl_in_plane_y = TextInput(title="in-plane Y", value="", width=100, disabled=True)
def redef_lattice_cb_callback(_attr, _old, new): def redef_lattice_cb_callback(_attr, _old, new):
if new: if new:
...@@ -301,7 +303,8 @@ def create(): ...@@ -301,7 +303,8 @@ def create():
hkl_delta, hkl_delta,
Spacer(width=10), Spacer(width=10),
hkl_in_plane_x, hkl_in_plane_x,
Spacer(width=50), hkl_in_plane_y,
Spacer(width=10),
cm_layout, cm_layout,
), ),
row(column(Spacer(height=7), redef_lattice_cb), redef_lattice_ti), row(column(Spacer(height=7), redef_lattice_cb), redef_lattice_ti),
......
...@@ -46,7 +46,6 @@ class PlotHKL: ...@@ -46,7 +46,6 @@ class PlotHKL:
cut_tol = hkl_delta.value cut_tol = hkl_delta.value
cut_or = hkl_cut.value cut_or = hkl_cut.value
x_dir = list(map(float, hkl_in_plane_x.value.split())) x_dir = list(map(float, hkl_in_plane_x.value.split()))
y_dir = list(map(float, hkl_in_plane_y.value.split()))
k = np.array(k_vectors.value.split()).astype(float).reshape(-1, 3) k = np.array(k_vectors.value.split()).astype(float).reshape(-1, 3)
tol_k = tol_k_ni.value tol_k = tol_k_ni.value
...@@ -98,9 +97,12 @@ class PlotHKL: ...@@ -98,9 +97,12 @@ class PlotHKL:
# Calculate in-plane y-direction # Calculate in-plane y-direction
x_c = M @ x_dir x_c = M @ x_dir
y_c = M @ y_dir
o_c = M @ orth_dir o_c = M @ orth_dir
# Calculate y-direction in plot (orthogonal to x-direction and out-of-plane direction)
y_c = np.cross(x_c, o_c)
hkl_in_plane_y.value = " ".join([f"{val:.1f}" for val in y_c])
# Normalize all directions # Normalize all directions
y_c = y_c / np.linalg.norm(y_c) y_c = y_c / np.linalg.norm(y_c)
x_c = x_c / np.linalg.norm(x_c) x_c = x_c / np.linalg.norm(x_c)
...@@ -349,7 +351,7 @@ class PlotHKL: ...@@ -349,7 +351,7 @@ class PlotHKL:
hkl_cut = Spinner(title="cut", value=0, step=0.1, width=70) hkl_cut = Spinner(title="cut", value=0, step=0.1, width=70)
hkl_delta = NumericInput(title="delta", value=0.1, mode="float", width=70) hkl_delta = NumericInput(title="delta", value=0.1, mode="float", width=70)
hkl_in_plane_x = TextInput(title="in-plane X", value="1 0 0", width=70) hkl_in_plane_x = TextInput(title="in-plane X", value="1 0 0", width=70)
hkl_in_plane_y = TextInput(title="in-plane Y", value="0 1 0", width=70) hkl_in_plane_y = TextInput(title="in-plane Y", value="", width=100, disabled=True)
disting_opt_div = Div(text="Distinguish options:", margin=(5, 5, 0, 5)) disting_opt_div = Div(text="Distinguish options:", margin=(5, 5, 0, 5))
disting_opt_cb = CheckboxGroup( disting_opt_cb = CheckboxGroup(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment