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

Commit

Permalink
Merge branch 'master' into bugfix/10064_indirect_resolution_algorithm…
Browse files Browse the repository at this point in the history
…_refactor

Conflicts:
	SystemTests/AnalysisTests/ISISIndirectInelastic.py

Refs #10064
  • Loading branch information
DanNixon committed Oct 14, 2014
2 parents d1770a3 + 244dea2 commit 695820d
Show file tree
Hide file tree
Showing 17 changed files with 341 additions and 98 deletions.
Binary file added Data/IRS26173.RAW
Binary file not shown.
Binary file added Data/IRS26176.RAW
Binary file not shown.
Binary file added Data/irs26176_graphite002_cyl_Abs.nxs
Binary file not shown.
57 changes: 55 additions & 2 deletions SystemTests/AnalysisTests/BuildSQWTest.py
Expand Up @@ -12,7 +12,7 @@
import os

# allow for multiple locations
FILE_LOCATIONS = ["/isis/mantid/localtestdata/"]
FILE_LOCATIONS = ["/isis/mantid/localtestdata/"]#,"d:/Data/MantidSystemTests/BigData/Dropbox/LoadSQW"]

class BuildSQWTest(stresstesting.MantidStressTest):

Expand Down Expand Up @@ -101,4 +101,57 @@ def cleanup(self):
try:
os.remove(filename)
except OSError,exc:
mantid.logger.warning("Unable to remove created file '%s'" % filename)
mantid.logger.warning("Unable to remove created file '%s'" % filename)

class LoadSQW_FileBasedTest(BuildSQWTest):
""" The test checks loading MD workspace from SQW file when target file is file based"""

def __init__(self):

self._input_data = ["Test22meV2f.sqw","Test22meVMD.nxs"]

def runTest(self):

MDws_file = os.path.join(config["defaultsave.directory"],"LoadSQWTestFileBased.nxs")
sqw_file = os.path.join(self._input_location,self._input_data[0])

wsMD=LoadSQW(Filename=sqw_file, OutputFilename=MDws_file)

self._created_files=MDws_file;


def validate(self):
"""Compare file-based MD files """
ref_file = os.path.join(self._input_location, self._input_data[1])
Reference=LoadMD(Filename=ref_file, FileBackEnd=True, Memory=100)
rez = CompareMDWorkspaces(Workspace1="wsMD",Workspace2=Reference,Tolerance=1.e-5,CheckEvents=False,IgnoreBoxID=False)

DeleteWorkspace("wsMD");

return rez[0];

class LoadSQW_MemBasedTest(BuildSQWTest):
""" The test checks loading MD workspace from SQW file when target file is file based"""

def __init__(self):

self._input_data = ["Test22meV2f.sqw","Test22meVMD.nxs"]

def runTest(self):

sqw_file = os.path.join(self._input_location,self._input_data[0])

wsMD=LoadSQW(Filename=sqw_file)

self._created_files=[];


def validate(self):
"""Compare memory-based vs file based MD workspaces """
ref_file = os.path.join(self._input_location, self._input_data[1])
Reference=LoadMD(Filename=ref_file, FileBackEnd=True, Memory=100)
rez = CompareMDWorkspaces(Workspace1="wsMD",Workspace2=Reference,Tolerance=1.e-5,CheckEvents=False,IgnoreBoxID=False)

DeleteWorkspace("wsMD");

return rez[0];
2 changes: 1 addition & 1 deletion SystemTests/AnalysisTests/ISISIndirectAbsCorTest.py
Expand Up @@ -159,7 +159,7 @@ def runTest(self):
beam_width = 4.0
sampleFormula = 'H2-O'
canFormula = 'V'
AbsRunFeeder(inputWS, canWS, geom, ncan, size, avar, density, beam_width=beam_width, sampleFormula=sampleFormula, canFormula=canFormula, sigs=[0,0,0], siga=[0,0,0])
AbsRunFeeder(inputWS, canWS, geom, ncan, size, avar, density, beam_width=beam_width, sample_formula=sampleFormula, can_formula=canFormula, sigs=[0,0,0], siga=[0,0,0])

def validate(self):
self.tolerance = 1e-3
Expand Down
48 changes: 36 additions & 12 deletions SystemTests/AnalysisTests/ISISIndirectBayesTest.py
Expand Up @@ -288,26 +288,31 @@ def cleanup(self):
class JumpCETest(stresstesting.MantidStressTest):

def runTest(self):
from IndirectJumpFit import JumpRun
sname = 'irs26176_graphite002_QLr_Workspace'
qrange = [0.6, 1.705600]
verbOp = False
plotOp = False
saveOp = False

filename = sname+'.nxs' # path name for nxs file
filename = sname + '.nxs' # path name for nxs file
LoadNexusProcessed(Filename=filename, OutputWorkspace=sname)
JumpRun(sname,'CE',2,qrange[0],qrange[1],verbOp,plotOp,saveOp)
JumpFit(InputWorkspace=sname,
Function='ChudleyElliot',
Width=2,
QMin=qrange[0],
QMax=qrange[1],
Verbose=verbOp,
Plot=plotOp,
Save=saveOp)

def validate(self):
self.tolerance = 1e-5
return 'irs26176_graphite002_QLr_CEfit_Workspace','ISISIndirectBayes_JumpCETest.nxs'
return 'irs26176_graphite002_QLr_ChudleyElliotfit_Workspace','ISISIndirectBayes_JumpCETest.nxs'

#=============================================================================
class JumpHallRossTest(stresstesting.MantidStressTest):

def runTest(self):
from IndirectJumpFit import JumpRun
sname = 'irs26176_graphite002_QLr_Workspace'
qrange = [0.6, 1.705600]
verbOp = False
Expand All @@ -316,7 +321,14 @@ def runTest(self):

path = sname+'.nxs' # path name for nxs file
LoadNexusProcessed(Filename=path, OutputWorkspace=sname)
JumpRun(sname,'HallRoss',2,qrange[0],qrange[1],verbOp,plotOp,saveOp)
JumpFit(InputWorkspace=sname,
Function='HallRoss',
Width=2,
QMin=qrange[0],
QMax=qrange[1],
Verbose=verbOp,
Plot=plotOp,
Save=saveOp)

def validate(self):
self.tolerance = 1e-5
Expand All @@ -326,7 +338,6 @@ def validate(self):
class JumpFickTest(stresstesting.MantidStressTest):

def runTest(self):
from IndirectJumpFit import JumpRun
sname = 'irs26176_graphite002_QLr_Workspace'
qrange = [0.6, 1.705600]
verbOp = False
Expand All @@ -335,17 +346,23 @@ def runTest(self):

path = sname+'.nxs' # path name for nxs file
LoadNexusProcessed(Filename=path, OutputWorkspace=sname)
JumpRun(sname,'Fick',2,qrange[0],qrange[1],verbOp,plotOp,saveOp)
JumpFit(InputWorkspace=sname,
Function='FickDiffusion',
Width=2,
QMin=qrange[0],
QMax=qrange[1],
Verbose=verbOp,
Plot=plotOp,
Save=saveOp)

def validate(self):
self.tolerance = 1e-5
return 'irs26176_graphite002_QLr_Fickfit_Workspace','ISISIndirectBayes_JumpFickTest.nxs'
return 'irs26176_graphite002_QLr_FickDiffusionfit_Workspace','ISISIndirectBayes_JumpFickTest.nxs'

#=============================================================================
class JumpTeixeiraTest(stresstesting.MantidStressTest):

def runTest(self):
from IndirectJumpFit import JumpRun
sname = 'irs26176_graphite002_QLr_Workspace'
qrange = [0.6, 1.705600]
verbOp = False
Expand All @@ -354,10 +371,17 @@ def runTest(self):

path = sname+'.nxs' # path name for nxs file
LoadNexusProcessed(Filename=path, OutputWorkspace=sname)
JumpRun(sname,'Teixeira',2,qrange[0],qrange[1],verbOp,plotOp,saveOp)
JumpFit(InputWorkspace=sname,
Function='TeixeiraWater',
Width=2,
QMin=qrange[0],
QMax=qrange[1],
Verbose=verbOp,
Plot=plotOp,
Save=saveOp)

def validate(self):
self.tolerance = 1e-2
return 'irs26176_graphite002_QLr_Teixeirafit_Workspace','ISISIndirectBayes_JumpTeixeiraTest.nxs'
return 'irs26176_graphite002_QLr_TeixeiraWaterfit_Workspace','ISISIndirectBayes_JumpTeixeiraTest.nxs'

#=============================================================================

0 comments on commit 695820d

Please sign in to comment.