Skip to content

Commit

Permalink
Merge pull request #1613 from HEXRD/flip-overlay-data-fixes
Browse files Browse the repository at this point in the history
Fix a few issues due to the flipped overlay data
  • Loading branch information
psavery authored Nov 9, 2023
2 parents 97c5fbb + edc584b commit 1e0aaf9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions hexrdgui/calibration/calibration_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def reset_overlay_data_index_map(self):
if hkl_index == -1:
continue

tth_values = data[key][data_key][hkl_index][:, 1]
tth_values = data[key][data_key][hkl_index][:, 0]
min_value = min(min_value, np.nanmin(tth_values))

min_tth_values.append(min_value)
Expand All @@ -542,7 +542,7 @@ def reset_overlay_data_index_map(self):
rings = data[key][data_key]

keys.append(key)
min_eta_values[key] = np.nanmin(rings[hkl_index][:, 0])
min_eta_values[key] = np.nanmin(rings[hkl_index][:, 1])
hkl_indices[key] = hkl_index

keys.sort(key=lambda x: min_eta_values[x])
Expand Down
3 changes: 1 addition & 2 deletions hexrdgui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,8 +817,7 @@ def action_edit_apply_powder_mask_to_polar(self):
for _, val in overlay.data.items():
a = iter(val['rbnds'])
for start, end in zip(a, a):
ranges = np.array(np.flip(start, axis=1))
ranges = np.append(ranges, np.flip(end), axis=0)
ranges = np.append(start, np.flip(end, axis=0), axis=0)
ranges = np.append(ranges, [ranges[0]], axis=0)
data.append(ranges[~np.isnan(ranges).any(axis=1)])

Expand Down

0 comments on commit 1e0aaf9

Please sign in to comment.