Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/feature/10264_indirect_slice_alg…
Browse files Browse the repository at this point in the history
…orithm'
  • Loading branch information
abuts committed Oct 4, 2014
2 parents 21059cc + 59a6ffd commit a06ff5d
Showing 1 changed file with 24 additions and 26 deletions.
50 changes: 24 additions & 26 deletions SystemTests/AnalysisTests/ISISIndirectInelastic.py
Expand Up @@ -10,7 +10,7 @@
# Import our workflows.
from inelastic_indirect_reducer import IndirectReducer
from inelastic_indirect_reduction_steps import CreateCalibrationWorkspace
from IndirectEnergyConversion import resolution, slice
from IndirectEnergyConversion import resolution
from IndirectDataAnalysis import elwin, msdfit, fury, furyfitSeq, furyfitMult, confitSeq

'''
Expand Down Expand Up @@ -622,61 +622,59 @@ def _run(self):
'''Defines the workflow for the test'''

self.tolerance = 1e-7
slice(self.rawfiles,
'', # No calib file.
self.tofRange,
self.spectra,
self.suffix,
Save=False,
Verbose=False,
Plot=False)

TimeSlice(InputFiles=self.rawfiles,
OutputNameSuffix=self.suffix,
PeakRange=self.peak,
SpectraRange=self.spectra,
Plot=False,
Save=False)

# Construct the result ws name.
file = self.rawfiles[0]
self.result_names = [os.path.splitext(file)[0] + "_" +
self.suffix + "_slice"]
self.result_names = [os.path.splitext(self.rawfiles[0])[0] + self.suffix]

def _validate_properties(self):
'''Check the object properties are in an expected state to continue'''

if type(self.rawfiles) != list and len(self.rawfiles) != 2:
raise RuntimeError("rawfiles should be a list of exactly 2 "
"values")
if type(self.tofRange) != list and len(self.tofRange) != 1:
raise RuntimeError("tofRange should be a list of exactly 1 "
"value")
if type(self.rawfiles) != list and len(self.rawfiles) != 1:
raise RuntimeError("rawfiles should be a list of exactly 1 value")
if type(self.peak) != list and len(self.peak) != 2:
raise RuntimeError("peak should be a list of exactly 2 values")
if type(self.spectra) != list and len(self.spectra) != 2:
raise RuntimeError("spectra should be a list of exactly 2 "
"values")
raise RuntimeError("spectra should be a list of exactly 2 values")
if type(self.suffix) != str:
raise RuntimeError("suffix property should be a string")

#------------------------- OSIRIS tests ---------------------------------------

#------------------------- IRIS tests -----------------------------------------


class IRISDiagnostics(ISISIndirectInelasticDiagnostics):

def __init__(self):
ISISIndirectInelasticDiagnostics.__init__(self)
self.tofRange = [62500, 65000]

self.peak = [62500, 65000]
self.rawfiles = ['IRS53664.raw']
self.spectra = [3, 53]
self.suffix = 'graphite002'
self.suffix = '_graphite002_slice'

def get_reference_files(self):
return ["II.IRISDiagnostics.nxs"]

#------------------------- IRIS tests -----------------------------------------

#------------------------- OSIRIS tests ---------------------------------------


class OSIRISDiagnostics(ISISIndirectInelasticDiagnostics):

def __init__(self):
ISISIndirectInelasticDiagnostics.__init__(self)
self.tofRange = [59000, 61000]

self.peak = [59000, 61000]
self.rawfiles = ['OSI97935.raw']
self.spectra = [963, 1004]
self.suffix = 'graphite002'
self.suffix = '_graphite002_slice'

def get_reference_files(self):
return ["II.OSIRISDiagnostics.nxs"]
Expand Down

0 comments on commit a06ff5d

Please sign in to comment.