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 3986b817 authored by usov_i's avatar usov_i
Browse files

Use scan_motor instead of "omega"

parent 16966b6e
No related branches found
No related tags found
No related merge requests found
......@@ -80,7 +80,6 @@ def merge_datasets(dataset_into, dataset_from):
def merge_scans(scan_into, scan_from):
# TODO: does it need to be "scan_motor" instead of omega for a generalized solution?
if "init_scan" not in scan_into:
scan_into["init_scan"] = scan_into.copy()
......@@ -92,9 +91,11 @@ def merge_scans(scan_into, scan_from):
scan_into["merged_scans"].append(scan_from)
scan_motor = scan_into["scan_motor"] # the same as scan_from["scan_motor"]
if (
scan_into["omega"].shape == scan_from["omega"].shape
and np.max(np.abs(scan_into["omega"] - scan_from["omega"])) < 0.0005
scan_into[scan_motor].shape == scan_from[scan_motor].shape
and np.max(np.abs(scan_into[scan_motor] - scan_from[scan_motor])) < 0.0005
):
counts_tmp = 0
counts_err_tmp = 0
......@@ -107,13 +108,13 @@ def merge_scans(scan_into, scan_from):
scan_into["counts_err"] = np.sqrt(counts_err_tmp)
else:
omega = np.concatenate((scan_into["omega"], scan_from["omega"]))
motor_pos = np.concatenate((scan_into[scan_motor], scan_from[scan_motor]))
counts = np.concatenate((scan_into["counts"], scan_from["counts"]))
counts_err = np.concatenate((scan_into["counts_err"], scan_from["counts_err"]))
index = np.argsort(omega)
index = np.argsort(motor_pos)
scan_into["omega"] = omega[index]
scan_into[scan_motor] = motor_pos[index]
scan_into["counts"] = counts[index]
scan_into["counts_err"] = counts_err[index]
......
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