Skip to content

Commit

Permalink
Re #11488 Add TOF range test
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoucet committed Apr 7, 2015
1 parent da99cd2 commit 8b658c0
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 10 deletions.
Expand Up @@ -230,6 +230,10 @@ def PyExec(self):
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
Expand Down Expand Up @@ -302,15 +306,6 @@ def calculate_scattering_angle(self, ws_event_data):
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):
"""
Expand Down
Expand Up @@ -128,5 +128,46 @@ def validate(self):
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

@@ -0,0 +1 @@
713537859017897277e049c17d7f3fe4
@@ -0,0 +1 @@
2460ea1adf15e55f788c0b7def73dc58

0 comments on commit 8b658c0

Please sign in to comment.