Skip to content

Commit

Permalink
Fixed issue with q binning. When config file has been saved with line…
Browse files Browse the repository at this point in the history
…ar binning, new binning stay linear, even if application does not say so.. this has been fixed and will always be linear for now on. This refs #4303
  • Loading branch information
JeanBilheux committed Jul 3, 2012
1 parent e22a85f commit d560791
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,16 @@ def PyExec(self):
# Steps for TOF rebin
TOFsteps = 100.0

#use now a global q binning (user does not have control over it)
#q_min = 0.005
#q_step = -0.01

# Q binning for output distribution
q_min = self.getProperty("QMin")
q_step = self.getProperty("QStep")

if (q_step > 0):
q_step = -q_step

#dimension of the detector (256 by 304 pixels)
maxX = 304
maxY = 256
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ def _smooth_x_axis(self, x_axis, y_axis, e_axis):
_y = 0.
_e = 0.
else:

_error = 1./_left_e2 + 1./_right_e2
_x = (_left_x + _right_x) / 2.
_y = (_left_y/_left_e2 + _right_y/_right_e2) / _error
Expand Down Expand Up @@ -338,6 +339,19 @@ def _create_ascii_clicked(self):
text = [line1, line2, line3]
else:
text = ['#Q(1/Angstrom) R delta_R']

# #rebinned using output factors
# q_min = float(self._summary.q_min_edit.text())
# q_bin = -float(self._summary.q_step_edit.text())
#
# mt = mtd['ref_combined']
# x_axis = mt.readX(0)[:]
# q_max = float(x_axis[-1])
#
# q_binning = [q_min, q_bin, q_max]
# Rebin(InputWorkspace='ref_combined',
# OutputWorkspace='ref_combined',
# Params=q_binning)

mt = mtd['ref_combined']
x_axis = mt.readX(0)[:]
Expand Down

0 comments on commit d560791

Please sign in to comment.