Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
45b091f90b | |||
20fc969d60 | |||
bce8cf3120 | |||
56d626e312 | |||
19daa16de7 | |||
4bcfaf8c80 |
@ -6,4 +6,4 @@ from pyzebra.utils import *
|
|||||||
from pyzebra.xtal import *
|
from pyzebra.xtal import *
|
||||||
from pyzebra.sxtal_refgen import *
|
from pyzebra.sxtal_refgen import *
|
||||||
|
|
||||||
__version__ = "0.7.0"
|
__version__ = "0.7.2"
|
||||||
|
@ -143,8 +143,7 @@ def create():
|
|||||||
# last digits are spind UB matrix
|
# last digits are spind UB matrix
|
||||||
vals = list(map(float, c_rest))
|
vals = list(map(float, c_rest))
|
||||||
ub_matrix_spind = np.transpose(np.array(vals).reshape(3, 3))
|
ub_matrix_spind = np.transpose(np.array(vals).reshape(3, 3))
|
||||||
ub_matrix = np.linalg.inv(ub_matrix_spind)
|
ub_matrices.append(ub_matrix_spind)
|
||||||
ub_matrices.append(ub_matrix)
|
|
||||||
spind_res["ub_matrix"].append(str(ub_matrix_spind * 1e-10))
|
spind_res["ub_matrix"].append(str(ub_matrix_spind * 1e-10))
|
||||||
|
|
||||||
print(f"Content of {spind_out_file}:")
|
print(f"Content of {spind_out_file}:")
|
||||||
@ -168,11 +167,11 @@ def create():
|
|||||||
def results_table_select_callback(_attr, old, new):
|
def results_table_select_callback(_attr, old, new):
|
||||||
if new:
|
if new:
|
||||||
ind = new[0]
|
ind = new[0]
|
||||||
ub_matrix = ub_matrices[ind]
|
ub_matrix_spind = ub_matrices[ind]
|
||||||
res = ""
|
res = ""
|
||||||
for vec in diff_vec:
|
for vec in diff_vec:
|
||||||
res += f"{ub_matrix @ vec}\n"
|
res += f"{np.linalg.inv(ub_matrix_spind) @ vec}\n"
|
||||||
ub_matrix_textareainput.value = str(ub_matrix * 1e10)
|
ub_matrix_textareainput.value = str(ub_matrix_spind * 1e-10)
|
||||||
hkl_textareainput.value = res
|
hkl_textareainput.value = res
|
||||||
else:
|
else:
|
||||||
ub_matrix_textareainput.value = ""
|
ub_matrix_textareainput.value = ""
|
||||||
|
@ -167,6 +167,9 @@ def parse_1D(fileobj, data_type):
|
|||||||
if "scan_motor" not in scan:
|
if "scan_motor" not in scan:
|
||||||
scan["scan_motor"] = "om"
|
scan["scan_motor"] = "om"
|
||||||
|
|
||||||
|
if scan["scan_motor"] == "o2t":
|
||||||
|
scan["scan_motor"] = "om"
|
||||||
|
|
||||||
if scan["scan_motor"] != "om":
|
if scan["scan_motor"] != "om":
|
||||||
raise Exception("Unsupported variable name in ccl file.")
|
raise Exception("Unsupported variable name in ccl file.")
|
||||||
|
|
||||||
@ -201,7 +204,8 @@ def parse_1D(fileobj, data_type):
|
|||||||
|
|
||||||
match = re.search("Scanning Variables: (.*), Steps: (.*)", next(fileobj))
|
match = re.search("Scanning Variables: (.*), Steps: (.*)", next(fileobj))
|
||||||
motors = [motor.lower() for motor in match.group(1).split(", ")]
|
motors = [motor.lower() for motor in match.group(1).split(", ")]
|
||||||
steps = [float(step) for step in match.group(2).split()]
|
# Steps can be separated by " " or ", "
|
||||||
|
steps = [float(step.strip(",")) for step in match.group(2).split()]
|
||||||
|
|
||||||
match = re.search("(.*) Points, Mode: (.*), Preset (.*)", next(fileobj))
|
match = re.search("(.*) Points, Mode: (.*), Preset (.*)", next(fileobj))
|
||||||
if match.group(2) != "Monitor":
|
if match.group(2) != "Monitor":
|
||||||
|
@ -119,7 +119,10 @@ def read_detector_data(filepath, cami_meta=None):
|
|||||||
scan["phi"] = h5f["/entry1/sample/phi"][:]
|
scan["phi"] = h5f["/entry1/sample/phi"][:]
|
||||||
if len(scan["phi"]) == 1:
|
if len(scan["phi"]) == 1:
|
||||||
scan["phi"] = np.ones(n) * scan["phi"]
|
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["name"] = h5f["/entry1/sample/name"][0].decode()
|
||||||
scan["cell"] = h5f["/entry1/sample/cell"][:]
|
scan["cell"] = h5f["/entry1/sample/cell"][:]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user