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

Average counts in case of almost identical scans

Fix #37
parent 49a6bd22
No related branches found
No related tags found
No related merge requests found
......@@ -89,13 +89,20 @@ def merge_scans(scan_into, scan_from):
scan_into["merged_scans"] = []
scan_into["merged_scans"].append(scan_from)
omega = np.concatenate((scan_into["omega"], scan_from["omega"]))
counts = np.concatenate((scan_into["counts"], scan_from["counts"]))
if (
scan_into["omega"].shape == scan_from["omega"].shape
and np.max(np.abs(scan_into["omega"] - scan_from["omega"])) < 0.0005
):
scan_into["counts"] = (scan_into["counts"] + scan_from["counts"]) / 2
index = np.argsort(omega)
else:
omega = np.concatenate((scan_into["omega"], scan_from["omega"]))
counts = np.concatenate((scan_into["counts"], scan_from["counts"]))
scan_into["omega"] = omega[index]
scan_into["counts"] = counts[index]
index = np.argsort(omega)
scan_into["omega"] = omega[index]
scan_into["counts"] = counts[index]
scan_from["active"] = False
......
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