4 Commits
0.7.0 ... 0.7.1

Author SHA1 Message Date
bce8cf3120 Updating for version 0.7.1 2022-08-25 17:04:41 +02:00
56d626e312 Display the same UB matrix as in the spind table 2022-08-25 16:47:15 +02:00
19daa16de7 Treat o2t as om 2022-06-17 10:28:13 +02:00
4bcfaf8c80 Use a dummy UB matrix if it's absent in hdf file 2022-05-30 15:20:59 +02:00
4 changed files with 12 additions and 7 deletions

View File

@ -6,4 +6,4 @@ from pyzebra.utils import *
from pyzebra.xtal import *
from pyzebra.sxtal_refgen import *
__version__ = "0.7.0"
__version__ = "0.7.1"

View File

@ -143,8 +143,7 @@ def create():
# last digits are spind UB matrix
vals = list(map(float, c_rest))
ub_matrix_spind = np.transpose(np.array(vals).reshape(3, 3))
ub_matrix = np.linalg.inv(ub_matrix_spind)
ub_matrices.append(ub_matrix)
ub_matrices.append(ub_matrix_spind)
spind_res["ub_matrix"].append(str(ub_matrix_spind * 1e-10))
print(f"Content of {spind_out_file}:")
@ -168,11 +167,11 @@ def create():
def results_table_select_callback(_attr, old, new):
if new:
ind = new[0]
ub_matrix = ub_matrices[ind]
ub_matrix_spind = ub_matrices[ind]
res = ""
for vec in diff_vec:
res += f"{ub_matrix @ vec}\n"
ub_matrix_textareainput.value = str(ub_matrix * 1e10)
res += f"{np.linalg.inv(ub_matrix_spind) @ vec}\n"
ub_matrix_textareainput.value = str(ub_matrix_spind * 1e-10)
hkl_textareainput.value = res
else:
ub_matrix_textareainput.value = ""

View File

@ -167,6 +167,9 @@ def parse_1D(fileobj, data_type):
if "scan_motor" not in scan:
scan["scan_motor"] = "om"
if scan["scan_motor"] == "o2t":
scan["scan_motor"] = "om"
if scan["scan_motor"] != "om":
raise Exception("Unsupported variable name in ccl file.")

View File

@ -119,7 +119,10 @@ def read_detector_data(filepath, cami_meta=None):
scan["phi"] = h5f["/entry1/sample/phi"][:]
if len(scan["phi"]) == 1:
scan["phi"] = np.ones(n) * scan["phi"]
scan["ub"] = h5f["/entry1/sample/UB"][:].reshape(3, 3)
if h5f["/entry1/sample/UB"].size == 0:
scan["ub"] = np.eye(3) * 0.177
else:
scan["ub"] = h5f["/entry1/sample/UB"][:].reshape(3, 3)
scan["name"] = h5f["/entry1/sample/name"][0].decode()
scan["cell"] = h5f["/entry1/sample/cell"][:]