Commit 5e81640e authored by Owen Arnold's avatar Owen Arnold
Browse files

refs #14124. OverwriteSpectraMap -> RewriteSpectraMap.

No reason to change the name of the property. Would be far more convient for existing clients if the name of this property remained the same.
parent 32864183
......@@ -31,7 +31,7 @@ In the first example, POLDI data is cropped to the correct workspace size:
from mantid.kernel import OptionalBoolValue
# Load data and instrument - this is important, as the chopper configuration must be known.
raw_6903 = LoadSINQFile(Filename = "poldi2013n006903.hdf", Instrument = "POLDI")
LoadInstrument(raw_6903, InstrumentName = "POLDI", OverwriteSpectraMap=OptionalBoolValue.True)
LoadInstrument(raw_6903, InstrumentName = "POLDI", RewriteSpectraMap=OptionalBoolValue.True)
print "The raw data workspace contains", len(raw_6903.readX(0)), "time bins."
......
......@@ -54,7 +54,7 @@ Usage
ws = ScaleX(ws, 0.1, "Multiply")
#load instrument and instrument parameters
LoadInstrument(ws, InstrumentName='IRIS', OverwriteSpectraMap=OptionalBoolValue.True)
LoadInstrument(ws, InstrumentName='IRIS', RewriteSpectraMap=OptionalBoolValue.True)
path = os.path.join(config['instrumentDefinition.directory'], 'IRIS_graphite_002_Parameters.xml')
LoadParameterFile(ws, Filename=path)
ws = RenameWorkspace(ws, OutputWorkspace=name)
......
......@@ -33,7 +33,7 @@ Usage
ws = ScaleX(ws, 0.1, "Multiply")
#load instrument and instrument parameters
LoadInstrument(ws, InstrumentName='IRIS', OverwriteSpectraMap=OptionalBoolValue.True)
LoadInstrument(ws, InstrumentName='IRIS', RewriteSpectraMap=OptionalBoolValue.True)
path = os.path.join(config['instrumentDefinition.directory'], 'IRIS_graphite_002_Parameters.xml')
LoadParameterFile(ws, Filename=path)
ws = RenameWorkspace(ws, OutputWorkspace=name)
......
......@@ -54,7 +54,7 @@ Usage
ws = ScaleX(ws, 0.1, "Multiply")
# Load instrument and instrument parameters
LoadInstrument(ws, InstrumentName='IRIS', OverwriteSpectraMap=OptionalBoolValue.True)
LoadInstrument(ws, InstrumentName='IRIS', RewriteSpectraMap=OptionalBoolValue.True)
path = os.path.join(config['instrumentDefinition.directory'], 'IRIS_graphite_002_Parameters.xml')
LoadParameterFile(ws, Filename=path)
ws = RenameWorkspace(ws, OutputWorkspace=name)
......
......@@ -30,7 +30,7 @@ Usage
x = [1,2,3,4,5,6,7,8,9,10,11]
y = 491520*[0.1]
ws = CreateWorkspace(DataX=x,DataY=y,DataE=y,NSpec='49152',UnitX='Wavelength')
LoadInstrument(ws, InstrumentName="EQSANS", OverwriteSpectraMap=OptionalBoolValue.True)
LoadInstrument(ws, InstrumentName="EQSANS", RewriteSpectraMap=OptionalBoolValue.True)
monitor = SumSpectra(ws)
# Do the correction, dragging in the file which contains the reference flux spectrum.
......
......@@ -31,7 +31,7 @@ Usage
ws = ScaleX(ws, -5, "Add") #shift to center on 0
ws = ScaleX(ws, 0.1) #scale to size
ws = RenameWorkspace(ws, OutputWorkspace="irs21760_graphite002_red")
LoadInstrument(ws, InstrumentName='IRIS', OverwriteSpectraMap=OptionalBoolValue.True)
LoadInstrument(ws, InstrumentName='IRIS', RewriteSpectraMap=OptionalBoolValue.True)
#Run SofQW and then SofQWMoments
ws = SofQW(ws, '0.4, 0.1, 1.8', EMode='Indirect', EFixed='1.845', OutputWorkspace="irs00001_graphite002_red")
......
......@@ -100,7 +100,7 @@ Usage
ws=CreateSampleWorkspace();
#--------------------------------------------------------------------------------------
# load MARI
det=LoadInstrument(ws,InstrumentName='MARI', OverwriteSpectraMap=OptionalBoolValue.True)
det=LoadInstrument(ws,InstrumentName='MARI', RewriteSpectraMap=OptionalBoolValue.True)
inst1=ws.getInstrument();
#
print_10_detectors('unCalibrated',inst1);
......
......@@ -167,7 +167,7 @@ class DGSPlannerGUI(QtGui.QWidget):
mantid.simpleapi.AddSampleLog(Workspace="__temp_instrument",LogName='msd',LogText='1798.5',LogType='Number Series')
mantid.simpleapi.AddSampleLog(Workspace="__temp_instrument",LogName='s2',
LogText=str(self.masterDict['S2']),LogType='Number Series')
mantid.simpleapi.LoadInstrument(Workspace="__temp_instrument", OverwriteSpectraMap=True, InstrumentName="HYSPEC")
mantid.simpleapi.LoadInstrument(Workspace="__temp_instrument", RewriteSpectraMap=True, InstrumentName="HYSPEC")
#masking
if self.masterDict.has_key('maskFilename') and len(self.masterDict['maskFilename'].strip())>0:
try:
......
......@@ -1004,7 +1004,7 @@ class RunDescriptor(PropDescriptor):
idf_file = api.ExperimentInfo.getInstrumentFilename(instr_name)
idf_path,tile = os.path.split(idf_file)
idf_file = os.path.join(idf_path,'LET_Definition.xml')
LoadInstrument(ws_name,idf_file, OverwriteSpectraMap=False)
LoadInstrument(ws_name,idf_file, RewriteSpectraMap=False)
#HACK<<<
RunDescriptor._logger("Loaded {0}".format(data_file),'information')
......
......@@ -438,7 +438,7 @@ def ChangeAngles(inWS,instr,theta):
def InstrParas(ws,instr,ana,refl):
idf_dir = config['instrumentDefinition.directory']
idf = idf_dir + instr + '_Definition.xml'
LoadInstrument(Workspace=ws, Filename=idf, OverwriteSpectraMap=False)
LoadInstrument(Workspace=ws, Filename=idf, RewriteSpectraMap=False)
ipf = idf_dir + instr + '_' + ana + '_' + refl + '_Parameters.xml'
LoadParameterFile(Workspace=ws, Filename=ipf)
......
......@@ -948,8 +948,8 @@ class LOQ(ISISInstrument):
Loads information about the setup used for LOQ transmission runs
"""
trans_definition_file = os.path.join(config.getString('instrumentDefinition.directory'), self._NAME+'_trans_Definition.xml')
LoadInstrument(Workspace=ws_trans,Filename= trans_definition_file, OverwriteSpectraMap=False)
LoadInstrument(Workspace=ws_direct, Filename = trans_definition_file, OverwriteSpectraMap=False)
LoadInstrument(Workspace=ws_trans,Filename= trans_definition_file, RewriteSpectraMap=False)
LoadInstrument(Workspace=ws_direct, Filename = trans_definition_file, RewriteSpectraMap=False)
def cur_detector_position(self, ws_name):
"""Return the position of the center of the detector bank"""
......
......@@ -42,7 +42,7 @@ class Instrument(object):
if not AnalysisDataService.doesExist(wrksp):
api.CreateWorkspace(OutputWorkspace=wrksp,DataX="1",DataY="1",DataE="1")
#read the information about the instrument that stored in its xml
api.LoadInstrument(Workspace=wrksp, InstrumentName=self._NAME, OverwriteSpectraMap=True)
api.LoadInstrument(Workspace=wrksp, InstrumentName=self._NAME, RewriteSpectraMap=True)
return AnalysisDataService.retrieve(wrksp).getInstrument()
......
......@@ -103,7 +103,7 @@ class DirectEnergyConversionTest(unittest.TestCase):
def test_diagnostics_wb(self):
wb_ws = CreateSampleWorkspace(NumBanks=1, BankPixelWidth=4, NumEvents=10000)
LoadInstrument(wb_ws,InstrumentName='MARI', OverwriteSpectraMap=True)
LoadInstrument(wb_ws,InstrumentName='MARI', RewriteSpectraMap=True)
tReducer = DirectEnergyConversion(wb_ws.getInstrument())
......@@ -117,7 +117,7 @@ class DirectEnergyConversionTest(unittest.TestCase):
def test_do_white_wb(self) :
wb_ws = CreateSampleWorkspace(NumBanks=1, BankPixelWidth=4, NumEvents=10000)
#LoadParameterFile(Workspace=wb_ws,ParameterXML = used_parameters)
LoadInstrument(wb_ws,InstrumentName='MARI', OverwriteSpectraMap=True)
LoadInstrument(wb_ws,InstrumentName='MARI', RewriteSpectraMap=True)
tReducer = DirectEnergyConversion(wb_ws.getInstrument())
......@@ -152,7 +152,7 @@ class DirectEnergyConversionTest(unittest.TestCase):
def test_get_abs_normalization_factor(self) :
mono_ws = CreateSampleWorkspace(NumBanks=1, BankPixelWidth=4, NumEvents=10000,XUnit='DeltaE',XMin=-5,XMax=15,BinWidth=0.1,function='Flat background')
LoadInstrument(mono_ws,InstrumentName='MARI', OverwriteSpectraMap=True)
LoadInstrument(mono_ws,InstrumentName='MARI', RewriteSpectraMap=True)
tReducer = DirectEnergyConversion(mono_ws.getInstrument())
tReducer.prop_man.incident_energy = 5.
......@@ -167,7 +167,7 @@ class DirectEnergyConversionTest(unittest.TestCase):
# check warning. WB spectra with 0 signal indicate troubles.
mono_ws = CreateSampleWorkspace(NumBanks=1, BankPixelWidth=4, NumEvents=10000,XUnit='DeltaE',XMin=-5,XMax=15,BinWidth=0.1,function='Flat background')
LoadInstrument(mono_ws,InstrumentName='MARI', OverwriteSpectraMap=True)
LoadInstrument(mono_ws,InstrumentName='MARI', RewriteSpectraMap=True)
sig = mono_ws.dataY(0)
sig[:]=0
......@@ -182,7 +182,7 @@ class DirectEnergyConversionTest(unittest.TestCase):
def test_dgreduce_works(self):
""" Test for old interface """
run_ws = CreateSampleWorkspace( Function='Multiple Peaks', NumBanks=1, BankPixelWidth=4, NumEvents=10000)
LoadInstrument(run_ws,InstrumentName='MARI', OverwriteSpectraMap=True)
LoadInstrument(run_ws,InstrumentName='MARI', RewriteSpectraMap=True)
#mono_ws = CloneWorkspace(run_ws)
wb_ws = CloneWorkspace(run_ws)
......@@ -204,7 +204,7 @@ class DirectEnergyConversionTest(unittest.TestCase):
def test_dgreduce_works_with_name(self):
""" Test for old interface """
run_ws = CreateSampleWorkspace( Function='Multiple Peaks', NumBanks=1, BankPixelWidth=4, NumEvents=10000)
LoadInstrument(run_ws,InstrumentName='MARI', OverwriteSpectraMap=True)
LoadInstrument(run_ws,InstrumentName='MARI', RewriteSpectraMap=True)
AddSampleLog(run_ws,LogName='run_number',LogText='200',LogType='Number')
#mono_ws = CloneWorkspace(run_ws)
wb_ws = CloneWorkspace(run_ws)
......@@ -273,7 +273,7 @@ class DirectEnergyConversionTest(unittest.TestCase):
def test_late_rebinning(self):
run_monitors=CreateSampleWorkspace(Function='Multiple Peaks', NumBanks=4, BankPixelWidth=1, NumEvents=100000, XUnit='Energy',
XMin=3, XMax=200, BinWidth=0.1)
LoadInstrument(run_monitors,InstrumentName='MARI', OverwriteSpectraMap=True)
LoadInstrument(run_monitors,InstrumentName='MARI', RewriteSpectraMap=True)
ConvertUnits(InputWorkspace='run_monitors', OutputWorkspace='run_monitors', Target='TOF')
run_monitors = mtd['run_monitors']
tof = run_monitors.dataX(3)
......@@ -281,7 +281,7 @@ class DirectEnergyConversionTest(unittest.TestCase):
tMax = tof[-1]
run = CreateSampleWorkspace( Function='Multiple Peaks',WorkspaceType='Event',NumBanks=8, BankPixelWidth=1, NumEvents=100000,
XUnit='TOF',xMin=tMin,xMax=tMax)
LoadInstrument(run,InstrumentName='MARI', OverwriteSpectraMap=True)
LoadInstrument(run,InstrumentName='MARI', RewriteSpectraMap=True)
wb_ws = Rebin(run,Params=[tMin,1,tMax],PreserveEvents=False)
# References used to test against ordinary reduction
......@@ -308,7 +308,7 @@ class DirectEnergyConversionTest(unittest.TestCase):
run=CreateSampleWorkspace(Function='Multiple Peaks', NumBanks=6, BankPixelWidth=1, NumEvents=10,\
XUnit='Energy', XMin=5, XMax=75, BinWidth=0.2)
LoadInstrument(run,InstrumentName='MARI', OverwriteSpectraMap=True)
LoadInstrument(run,InstrumentName='MARI', RewriteSpectraMap=True)
red = DirectEnergyConversion(run.getInstrument())
......@@ -354,7 +354,7 @@ class DirectEnergyConversionTest(unittest.TestCase):
# create test workspace
run_monitors=CreateSampleWorkspace(Function='Multiple Peaks', NumBanks=4, BankPixelWidth=1,\
NumEvents=100000,XUnit='Energy', XMin=3, XMax=200, BinWidth=0.1)
LoadInstrument(run_monitors,InstrumentName='MARI', OverwriteSpectraMap=True)
LoadInstrument(run_monitors,InstrumentName='MARI', RewriteSpectraMap=True)
ConvertUnits(InputWorkspace='run_monitors', OutputWorkspace='run_monitors', Target='TOF')
run_monitors = mtd['run_monitors']
tof = run_monitors.dataX(3)
......@@ -362,7 +362,7 @@ class DirectEnergyConversionTest(unittest.TestCase):
tMax = tof[-1]
run = CreateSampleWorkspace( Function='Multiple Peaks',WorkspaceType='Event',NumBanks=8, BankPixelWidth=1,\
NumEvents=100000, XUnit='TOF',xMin=tMin,xMax=tMax)
LoadInstrument(run,InstrumentName='MARI', OverwriteSpectraMap=True)
LoadInstrument(run,InstrumentName='MARI', RewriteSpectraMap=True)
MoveInstrumentComponent(Workspace='run', ComponentName='Detector', DetectorID=1102,Z=1)
# MoveInstrumentComponent(Workspace='run', ComponentName='Detector', DetectorID=1103,Z=4)
# MoveInstrumentComponent(Workspace='run', ComponentName='Detector', DetectorID=1104,Z=5)
......@@ -414,7 +414,7 @@ class DirectEnergyConversionTest(unittest.TestCase):
# create test workspace
run_monitors=CreateSampleWorkspace(Function='Multiple Peaks', NumBanks=4, BankPixelWidth=1,\
NumEvents=100000, XUnit='Energy', XMin=3, XMax=200, BinWidth=0.1)
LoadInstrument(run_monitors,InstrumentName='MARI', OverwriteSpectraMap=True)
LoadInstrument(run_monitors,InstrumentName='MARI', RewriteSpectraMap=True)
ConvertUnits(InputWorkspace='run_monitors', OutputWorkspace='run_monitors', Target='TOF')
run_monitors = mtd['run_monitors']
tof = run_monitors.dataX(3)
......@@ -422,7 +422,7 @@ class DirectEnergyConversionTest(unittest.TestCase):
tMax = tof[-1]
run = CreateSampleWorkspace( Function='Multiple Peaks',WorkspaceType='Event',NumBanks=8, BankPixelWidth=1,\
NumEvents=100000, XUnit='TOF',xMin=tMin,xMax=tMax)
LoadInstrument(run,InstrumentName='MARI', OverwriteSpectraMap=True)
LoadInstrument(run,InstrumentName='MARI', RewriteSpectraMap=True)
# build "monovanadium"
mono = CloneWorkspace(run)
......@@ -479,7 +479,7 @@ class DirectEnergyConversionTest(unittest.TestCase):
# create test workspace
run_monitors=CreateSampleWorkspace(Function='Multiple Peaks', NumBanks=4, BankPixelWidth=1,\
NumEvents=100000, XUnit='Energy', XMin=3, XMax=200, BinWidth=0.1)
LoadInstrument(run_monitors,InstrumentName='MARI', OverwriteSpectraMap=True)
LoadInstrument(run_monitors,InstrumentName='MARI', RewriteSpectraMap=True)
ConvertUnits(InputWorkspace='run_monitors', OutputWorkspace='run_monitors', Target='TOF')
run_monitors = mtd['run_monitors']
tof = run_monitors.dataX(3)
......@@ -487,7 +487,7 @@ class DirectEnergyConversionTest(unittest.TestCase):
tMax = tof[-1]
run = CreateSampleWorkspace( Function='Multiple Peaks',WorkspaceType='Event',NumBanks=8, BankPixelWidth=1,\
NumEvents=100000, XUnit='TOF',xMin=tMin,xMax=tMax)
LoadInstrument(run,InstrumentName='MARI', OverwriteSpectraMap=True)
LoadInstrument(run,InstrumentName='MARI', RewriteSpectraMap=True)
AddSampleLog(run,LogName='gd_prtn_chrg',LogText='1.',LogType='Number')
# build "monovanadium"
......
......@@ -389,7 +389,7 @@ class IndirectCommonTests(unittest.TestCase):
def load_instrument(self, ws, instrument, analyser='graphite', reflection='002'):
"""Load an instrument parameter from the ipf directory"""
LoadInstrument(ws, InstrumentName=instrument, OverwriteSpectraMap=True)
LoadInstrument(ws, InstrumentName=instrument, RewriteSpectraMap=True)
if config['default.facility'] != 'ILL':
parameter_file_name = '%s_%s_%s_Parameters.xml' % (instrument, analyser, reflection)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment