Skip to content

Commit

Permalink
Re #7673. Throw error if no groups in CalibrateRectangularDetectors
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfpeterson committed Aug 7, 2013
1 parent 68950aa commit 37150d1
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,10 @@ def _cccalibrate(self, wksp, calib, filterLogs=None):
for ws in [str(wksp)+"cc3", str(wksp)+"offset3", str(wksp)+"mask3"]:
if AnalysisDataService.doesExist(ws):
AnalysisDataService.remove(ws)
CreateGroupingWorkspace(InputWorkspace=wksp, GroupDetectorsBy=self._grouping,
(temp, numGroupedSpectra, numGroups) = CreateGroupingWorkspace(InputWorkspace=wksp, GroupDetectorsBy=self._grouping,
OutputWorkspace=str(wksp)+"group")
if (numGroupedSpectra==0) or (numGroups==0):
raise RuntimeError("%d spectra will be in %d groups" % (numGroupedSpectra, numGroups))
lcinst = str(self._instrument)

if "dspacemap" in self._outTypes:
Expand Down Expand Up @@ -366,8 +368,10 @@ def _multicalibrate(self, wksp, calib, filterLogs=None):
if not "histo" in self.getProperty("Extension").value:
wksp = Rebin(InputWorkspace=wksp, OutputWorkspace=wksp.name(),
Params=str(self._binning[0])+","+str((self._binning[1]))+","+str(self._binning[2]))
CreateGroupingWorkspace(InputWorkspace=wksp, GroupDetectorsBy=self._grouping,
(temp, numGroupedSpectra, numGroups) = CreateGroupingWorkspace(InputWorkspace=wksp, GroupDetectorsBy=self._grouping,
OutputWorkspace=str(wksp)+"group")
if (numGroupedSpectra==0) or (numGroups==0):
raise RuntimeError("%d spectra will be in %d groups" % (numGroupedSpectra, numGroups))
if len(self._smoothGroups) > 0:
wksp = SmoothData(InputWorkspace=wksp, OutputWorkspace=wksp.name(),
NPoints=self._smoothGroups, GroupingWorkspace=str(wksp)+"group")
Expand Down

0 comments on commit 37150d1

Please sign in to comment.