Skip to content

Commit

Permalink
Refs #9457 - Add SANS2DTUBES() to the ISISCommandInterface.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterParker committed May 14, 2014
1 parent 33b2e4f commit c8049a8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
17 changes: 13 additions & 4 deletions Code/Mantid/scripts/SANS/ISISCommandInterface.py
Expand Up @@ -80,21 +80,30 @@ def DataPath(path):
"""
ReductionSingleton().set_data_path(path)

def SANS2D():
def SANS2D(idf_path=None):
"""
Initialises the instrument settings for SANS2D
@param idf_path :: optionally specify the path to the SANS2D IDF to use.
Uses default if none specified.
@return True on success
"""
_printMessage('SANS2D()')
try:
instrument = isis_instrument.SANS2D()
instrument = isis_instrument.SANS2D(idf_path)

ReductionSingleton().set_instrument(instrument)
config['default.instrument']='SANS2D'
config['default.instrument']='SANS2D'
except:
return False
return True

def SANS2DTUBES():
"""
Quick, temporary workaround for the IDF problem we're fixing in #9367.
Simply pass the correct IDF to SANS2D().
"""
return SANS2D("SANS2D_Definition_Tubes.xml")

def LOQ():
"""
Initialises the instrument settings for LOQ
Expand All @@ -105,7 +114,7 @@ def LOQ():
instrument = isis_instrument.LOQ()

ReductionSingleton().set_instrument(instrument)
config['default.instrument']='LOQ'
config['default.instrument']='LOQ'
except:
return False
return True
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/scripts/SANS/isis_instrument.py
Expand Up @@ -781,8 +781,8 @@ class SANS2D(ISISInstrument):
WAV_RANGE_MIN = 2.0
WAV_RANGE_MAX = 14.0

def __init__(self):
super(SANS2D, self).__init__()
def __init__(self, idf_path=None):
super(SANS2D, self).__init__(idf_path)

self._marked_dets = []
# set to true once the detector positions have been moved to the locations given in the sample logs
Expand Down

0 comments on commit c8049a8

Please sign in to comment.