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

Convert scan motors with step=0 to normal params

parent 313bd8bc
No related branches found
No related tags found
No related merge requests found
......@@ -183,8 +183,8 @@ def parse_1D(fileobj, data_type):
s = defaultdict(list)
match = re.search("Scanning Variables: (.*), Steps: (.*)", next(fileobj))
s["scan_motors"] = [var.lower() for var in match.group(1).split(", ")]
s["scan_motor"] = s["scan_motors"][0]
motors = [motor.lower() for motor in match.group(1).split(", ")]
steps = [float(step) for step in match.group(2).split()]
match = re.search("(.*) Points, Mode: (.*), Preset (.*)", next(fileobj))
if match.group(2) != "Monitor":
......@@ -204,6 +204,15 @@ def parse_1D(fileobj, data_type):
for name in col_names:
s[name] = np.array(s[name])
s["scan_motors"] = []
for motor, step in zip(motors, steps):
if step == 0:
# it's not a scan motor, so keep only the median value
s[motor] = np.median(s[motor])
else:
s["scan_motors"].append(motor)
s["scan_motor"] = s["scan_motors"][0]
# "om" -> "omega"
if "om" in s["scan_motors"]:
s["scan_motors"][s["scan_motors"].index("om")] = "omega"
......
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