Skip to content

Commit

Permalink
Order runs with Q
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoucet committed Mar 29, 2023
1 parent b7ab917 commit ba4031f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions reflectivity_ui/interfaces/data_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,11 @@ def add_active_to_reduction(self):
if self.is_active_data_compatible():
if len(self.reduction_list) == 0:
self.reduction_states = list(self.data_sets.keys())
ws = self._nexus_data.get_reflectivity_workspace_group()[0]
# Append to the reduction list, but keep the theta ordering
theta = ws.getRun().getProperty("two_theta").value
is_inserted = False
q_min, _ = self._nexus_data.get_q_range()
for i in range(len(self.reduction_list)):
_ws = self.reduction_list[i].get_reflectivity_workspace_group()[0]
_theta = _ws.getRun().getProperty("two_theta").value
if theta <= _theta:
_q_min, _ = self.reduction_list[i].get_q_range()
if q_min <= _q_min:
self.reduction_list.insert(i, self._nexus_data)
is_inserted = True
break
Expand Down

4 comments on commit ba4031f

@mdoucet
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmborr Do you ming having a look at this? It went straight to next

@jmborr
Copy link
Member

@jmborr jmborr commented on ba4031f Mar 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mdoucet so the comparison is now between momentum transfer instead of scattering angle? Looks like a big change

@mdoucet
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the correct thing to do, otherwise we the automated scaling fails when reloading reduced data if two runs are at the same angle.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitLab pipeline for quicknxs2-dev has been submitted for this commit: "https://code.ornl.gov/sns-hfir-scse/deployments/quicknxs-deploy/-/pipelines/358855"

Please sign in to comment.