Skip to content

Commit

Permalink
Re add interpolation option
Browse files Browse the repository at this point in the history
Refs #11859
  • Loading branch information
DanNixon committed May 28, 2015
1 parent 077b8be commit 00fb2c4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
Expand Up @@ -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')

Expand Down
Expand Up @@ -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')

Expand All @@ -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')
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 00fb2c4

Please sign in to comment.