Skip to content
Snippets Groups Projects
Commit 8b658c0d authored by Doucet, Mathieu's avatar Doucet, Mathieu
Browse files

Re #11488 Add TOF range test

parent da99cd23
No related branches found
No related tags found
No related merge requests found
......@@ -230,6 +230,10 @@ class LiquidsReflectometryReduction(PythonAlgorithm):
q_rebin = Multiply(LHSWorkspace=q_rebin, RHSWorkspace=ws_fraction,
OutputWorkspace=name_output_ws)
# Replace NaNs by zeros
q_rebin = ReplaceSpecialValues(InputWorkspace=q_rebin,
OutputWorkspace=name_output_ws,
NaNValue=0.0, NaNError=0.0)
# Crop to non-zero values
data_y = q_rebin.readY(0)
low_q = None
......@@ -302,15 +306,6 @@ class LiquidsReflectometryReduction(PythonAlgorithm):
angle_offset_deg = self.getProperty("AngleOffset").value
return theta + angle_offset_deg * math.pi / 180.0
def clocking_correction(self, workspace, pixel_range, range_width=3):
"""
Applies the "clocking correction". The pixel range is
the range that contains the reflectivity data. Compute the
average noise per pixel over two small bands on each side.
The subtract that noise pixel-wise from the data
"""
pass
def subtract_background(self, workspace, peak_range, background_range,
low_res_range, sum_peak=False, offset=None):
"""
......
......@@ -128,5 +128,46 @@ class NoNormalizationTest(stresstesting.MantidStressTest):
self.disableChecking.append('Sample')
self.disableChecking.append('SpectraMap')
self.disableChecking.append('Axes')
return "reflectivity_119816", ' REFL_NoNormalizationTest.nxs'
return "reflectivity_119816", 'REFL_NoNormalizationTest.nxs'
class TOFRangeOFFTest(stresstesting.MantidStressTest):
def runTest(self):
#TODO: The reduction algorithm should not require an absolute path
scaling_factor_file = FileFinder.getFullPath("directBeamDatabaseFall2014_IPTS_11601_2.cfg")
LiquidsReflectometryReduction(RunNumbers=[119816],
NormalizationRunNumber=119692,
SignalPeakPixelRange=[155, 165],
SubtractSignalBackground=True,
SignalBackgroundPixelRange=[146, 165],
NormFlag=True,
NormPeakPixelRange=[154, 162],
NormBackgroundPixelRange=[151, 165],
SubtractNormBackground=True,
LowResDataAxisPixelRangeFlag=True,
LowResDataAxisPixelRange=[99, 158],
LowResNormAxisPixelRangeFlag=True,
LowResNormAxisPixelRange=[118, 137],
TOFRange=[9610, 22425],
TofRangeFlag=False,
IncidentMediumSelected='2InDiamSi',
GeometryCorrectionFlag=False,
QMin=0.005,
QStep=0.01,
AngleOffset=0.009,
AngleOffsetError=0.001,
ScalingFactorFile=scaling_factor_file,
SlitsWidthFlag=True,
CropFirstAndLastPoints=False,
OutputWorkspace='reflectivity_119816')
def validate(self):
self.disableChecking.append('Instrument')
self.disableChecking.append('Sample')
self.disableChecking.append('SpectraMap')
self.disableChecking.append('Axes')
return "reflectivity_119816", ' TOFRangeOFFTest.nxs'
#TESTS to do:
# - TOF mismatch btw data and norm
713537859017897277e049c17d7f3fe4
2460ea1adf15e55f788c0b7def73dc58
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment