From 00fb2c426fb4dd60a20bb85539ac6bc224d7ce86 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Thu, 28 May 2015 10:17:46 +0100 Subject: [PATCH] Re add interpolation option Refs #11859 --- .../CylinderPaalmanPingsCorrection.py | 5 ++-- .../CylinderPaalmanPingsCorrection2.py | 28 ++++++++++++------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection.py index 686567fff8c3..e56af5905cef 100644 --- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection.py +++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection.py @@ -79,14 +79,13 @@ def PyInit(self): self.declareProperty(name='CanOuterRadius', defaultValue=0.15, doc='Can outer radius') - self.declareProperty(name='BeamHeight', defaultValue=0.1, + self.declareProperty(name='BeamHeight', defaultValue=3.0, doc='Height of the beam at the sample.') - self.declareProperty(name='BeamWidth', defaultValue=0.1, + self.declareProperty(name='BeamWidth', defaultValue=2.0, doc='Width of the beam at the sample.') self.declareProperty(name='StepSize', defaultValue=0.002, doc='Step size for calculation') - self.declareProperty(name='Interpolate', defaultValue=True, doc='Interpolate the correction workspaces to match the sample workspace') diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection2.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection2.py index a497667ff064..f7b84c0b8766 100644 --- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection2.py +++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection2.py @@ -57,16 +57,17 @@ def PyInit(self): validator=ws_validator, direction=Direction.Input), doc="Name for the input Sample workspace.") + self.declareProperty(name='SampleChemicalFormula', defaultValue='', validator=StringMandatoryValidator(), doc='Sample chemical formula') - self.declareProperty(name='SampleNumberDensity', defaultValue=0.0, + self.declareProperty(name='SampleNumberDensity', defaultValue=0.1, validator=FloatBoundedValidator(0.0), doc='Sample number density') - self.declareProperty(name='SampleInnerRadius', defaultValue=0.0, + self.declareProperty(name='SampleInnerRadius', defaultValue=0.05, validator=FloatBoundedValidator(0.0), doc='Sample inner radius') - self.declareProperty(name='SampleOuterRadius', defaultValue=0.0, + self.declareProperty(name='SampleOuterRadius', defaultValue=0.1, validator=FloatBoundedValidator(0.0), doc='Sample outer radius') @@ -75,24 +76,28 @@ def PyInit(self): validator=ws_validator, direction=Direction.Input), doc="Name for the input Can workspace.") + self.declareProperty(name='CanChemicalFormula', defaultValue='', doc='Can chemical formula') - self.declareProperty(name='CanNumberDensity', defaultValue=0.0, + self.declareProperty(name='CanNumberDensity', defaultValue=0.1, validator=FloatBoundedValidator(0.0), doc='Can number density') - self.declareProperty(name='CanOuterRadius', defaultValue=0.0, + self.declareProperty(name='CanOuterRadius', defaultValue=0.15, validator=FloatBoundedValidator(0.0), doc='Can outer radius') - self.declareProperty(name='StepSize', defaultValue=0.002, + self.declareProperty(name='BeamHeight', defaultValue=3.0, validator=FloatBoundedValidator(0.0), - doc='Step size') + doc='Beam height') self.declareProperty(name='BeamWidth', defaultValue=2.0, validator=FloatBoundedValidator(0.0), doc='Beam width') - self.declareProperty(name='BeamHeight', defaultValue=3.0, + + self.declareProperty(name='StepSize', defaultValue=0.002, validator=FloatBoundedValidator(0.0), - doc='Beam height') + doc='Step size') + self.declareProperty(name='Interpolate', defaultValue=True, + doc='Interpolate the correction workspaces to match the sample workspace') self.declareProperty(name='NumberWavelengths', defaultValue=10, validator=IntBoundedValidator(1), doc='Number of wavelengths for calculation') @@ -172,7 +177,8 @@ def PyExec(self): CreateWorkspace(OutputWorkspace=acc_ws, DataX=dataX, DataY=dataA4, NSpec=len(self._angles), UnitX='Wavelength') - self._interpolate_corrections(workspaces) + if self._interpolate: + self._interpolate_corrections(workspaces) try: self. _copy_detector_table(workspaces) except RuntimeError: @@ -250,6 +256,8 @@ def _setup(self): beam_height, 0.0, beam_height] + + self._interpolate = self.getProperty('Interpolate').value self._number_wavelengths = self.getProperty('NumberWavelengths').value self._emode = self.getPropertyValue('Emode')