Skip to content

Commit

Permalink
Make sans gui work for none disc samples. re #4357
Browse files Browse the repository at this point in the history
  • Loading branch information
Anders-Markvardsen committed Dec 21, 2011
1 parent d0fdb80 commit 0028606
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Code/Mantid/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1892,7 +1892,10 @@ QString SANSRunWindow::readUserFileGUIChanges(const States type)
///Reads the sample geometry, these settings will override what is stored in the run file
QString SANSRunWindow::readSampleObjectGUIChanges()
{
QString exec_reduce("\ni.ReductionSingleton().get_sample().geometry.height = ");
QString exec_reduce("\ni.ReductionSingleton().get_sample().geometry.shape = ");
exec_reduce += m_uiForm.sample_geomid->currentText().at(0);

exec_reduce +="\ni.ReductionSingleton().get_sample().geometry.height = ";
exec_reduce += m_uiForm.sample_height->text();

exec_reduce += "\ni.ReductionSingleton().get_sample().geometry.width = ";
Expand All @@ -1901,8 +1904,6 @@ QString SANSRunWindow::readSampleObjectGUIChanges()
exec_reduce += "\ni.ReductionSingleton().get_sample().geometry.thickness = ";
exec_reduce += m_uiForm.sample_thick->text();

exec_reduce += "\ni.ReductionSingleton().get_sample().geometry.shape = ";
exec_reduce += m_uiForm.sample_geomid->currentText().at(0);
exec_reduce += "\n";

return exec_reduce;
Expand Down
4 changes: 4 additions & 0 deletions Code/Mantid/scripts/SANS/isis_reducer.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ def _init_steps(self):
isis_reduction_steps.TransmissionCalc(loader=None)
self._corr_and_scale = isis_reduction_steps.AbsoluteUnitsISIS()

# note CalculateNormISIS does not inherit from ReductionStep
# so currently do not understand why it is in isis_reduction_steps
# Also the main purpose of this class is to use it as an input argument
# to ConvertToQ below
self.prep_normalize = isis_reduction_steps.CalculateNormISIS(
[self.norm_mon, self.transmission_calculator])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1443,10 +1443,12 @@ def execute(self, reducer, workspace):
volume = self.geo.height*math.pi
volume *= math.pow(self.geo.width,2)/4.0
elif self.geo.shape == 'cuboid':
# Flat plate sample
volume = self.geo.width
volume *= self.geo.height*self.geo.thickness
elif self.geo.shape == 'cylinder-axis-along':
# Factor of four comes from radius = width/2
# Disc - where height is not used
volume = self.geo.thickness*math.pi
volume *= math.pow(self.geo.width, 2)/4.0
else:
Expand Down

0 comments on commit 0028606

Please sign in to comment.