Skip to content

Commit

Permalink
refs #6072 Added the changes that accommodate long & short file names
Browse files Browse the repository at this point in the history
  • Loading branch information
DereckKachere committed Nov 1, 2012
1 parent 7f08239 commit 70e379b
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 60 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Algorithm to start Bayes programs
from MantidFramework import *
from mantidsimple import *
from mantidplotpy import *
import IndirectTrans as Main

class IDAtransmission(PythonAlgorithm):

def PyInit(self):
self.declareProperty(Name='Instrument',DefaultValue='IRIS',Validator=ListValidator(['IRIS','OSIRIS']))
self.declareProperty(Name='Instrument',DefaultValue='iris',Validator=ListValidator(['irs','iris','osi','osiris']),Description = 'Instrument')
self.declareProperty(Name='SamNumber',DefaultValue='',Validator=MandatoryValidator(),Description = 'Sample run number')
self.declareProperty(Name='CanNumber',DefaultValue='',Validator=MandatoryValidator(),Description = 'Resolution run number')
self.declareProperty('Verbose',DefaultValue='Yes',Validator=ListValidator(['Yes','No']))
Expand All @@ -15,11 +16,7 @@ def PyInit(self):
def PyExec(self):

self.log().information('IDA transmission input')
instr = self.getPropertyValue('Instrument')
if instr == 'IRIS':
prefix = 'irs'
if instr == 'OSIRIS':
prefix = 'osi'
prefix = self.getPropertyValue('Instrument')
sn = self.getPropertyValue('SamNumber')
cn = self.getPropertyValue('CanNumber')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def category(self):

def PyInit(self):
self.declareProperty(Name='InputType',DefaultValue='File',Validator=ListValidator(['File','Workspace']),Description = 'Origin of data input - File (*.nxs) or Workspace')
self.declareProperty(Name='Instrument',DefaultValue='IRIS',Validator=ListValidator(['IRIS','OSIRIS']),Description = 'Instrument name')
self.declareProperty(Name='Instrument',DefaultValue='iris',Validator=ListValidator(['irs','iris','osi','osiris']),Description = 'Instrument')
self.declareProperty(Name='Analyser',DefaultValue='graphite002',Validator=ListValidator(['graphite002','graphite004']),Description = 'Analyser & reflection')
self.declareProperty(Name='QLprogram',DefaultValue='QLr',Validator=ListValidator(['QLr','QLd']),Description = 'QL output from Res or Data')
self.declareProperty(Name='Fit',DefaultValue='CE',Validator=ListValidator(['CE','SS']),Description = 'Chudley-Elliott or Singwi-Sjolander')
Expand All @@ -27,11 +27,7 @@ def PyExec(self):

self.log().information('Jump input')
inType = self.getPropertyValue('InputType')
instr = self.getPropertyValue('Instrument')
if instr == 'IRIS':
prefix = 'irs'
if instr == 'OSIRIS':
prefix = 'osi'
prefix = self.getPropertyValue('Instrument')
ana = self.getPropertyValue('Analyser')
prog = self.getPropertyValue('QLprogram')
jump = self.getPropertyValue('Fit')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def category(self):

def PyInit(self):
self.declareProperty(Name='InputType',DefaultValue='File',Validator=ListValidator(['File','Workspace']),Description = 'Origin of data input - File or Workspace')
self.declareProperty(Name='Instrument',DefaultValue='IRIS',Validator=ListValidator(['IRIS','OSIRIS']),Description = 'Instrument')
self.declareProperty(Name='Instrument',DefaultValue='iris',Validator=ListValidator(['irs','iris','osi','osiris']),Description = 'Instrument')
self.declareProperty(Name='Analyser',DefaultValue='graphite002',Validator=ListValidator(['graphite002','graphite004']),Description = 'Analyser & reflection')
self.declareProperty(Name='SamNumber',DefaultValue='',Validator=MandatoryValidator(),Description = 'Sample run number')
self.declareProperty(Name='EnergyMin', DefaultValue=-0.5,Description = 'Minimum energy for fit. Default=-0.5')
Expand All @@ -23,11 +23,7 @@ def PyExec(self):

self.log().information('Moments calculation')
inType = self.getPropertyValue('InputType')
instr = self.getPropertyValue('Instrument')
if instr == 'IRIS':
prefix = 'irs'
if instr == 'OSIRIS':
prefix = 'osi'
prefix = self.getPropertyValue('Instrument')
ana = self.getPropertyValue('Analyser')
sn = self.getPropertyValue('SamNumber')
sam = prefix+sn+'_'+ana+'_sqw'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def category(self):
return "Workflow\\MIDAS;PythonAlgorithms"

def PyInit(self):
self.declareProperty(Name='Instrument',DefaultValue='IRIS',Validator=ListValidator(['IRIS','OSIRIS']))
self.declareProperty(Name='Instrument',DefaultValue='iris',Validator=ListValidator(['irs','iris','osi','osiris']),Description = 'Instrument')
self.declareProperty(Name='Analyser',DefaultValue='graphite002',Validator=ListValidator(['graphite002','graphite004']))
self.declareProperty(Name='Geom',DefaultValue='Flat',Validator=ListValidator(['Flat','Cyl']),Description = 'Sample geometry')
self.declareProperty(Name='SamNumber',DefaultValue='',Validator=MandatoryValidator(),Description = 'Sample data run number')
Expand All @@ -35,11 +35,7 @@ def PyExec(self):
run_f2py_compatibility_test()

self.log().information('Muscat input')
instr = self.getPropertyValue('Instrument')
if instr == 'IRIS':
prefix = 'irs'
if instr == 'OSIRIS':
prefix = 'osi'
prefix = self.getPropertyValue('Instrument')
ana = self.getPropertyValue('Analyser')
geom = self.getPropertyValue('Geom')
sam = self.getPropertyValue('SamNumber')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def category(self):
return "Workflow\\MIDAS;PythonAlgorithms"

def PyInit(self):
self.declareProperty(Name='Instrument',DefaultValue='IRIS',Validator=ListValidator(['IRIS','OSIRIS']))
self.declareProperty(Name='Instrument',DefaultValue='iris',Validator=ListValidator(['irs','iris','osi','osiris']),Description = 'Instrument')
self.declareProperty(Name='Analyser',DefaultValue='graphite002',Validator=ListValidator(['graphite002','graphite004']))
self.declareProperty(Name='Geom',DefaultValue='Flat',Validator=ListValidator(['Flat','Cyl']),Description = '')
self.declareProperty(Name='Dispersion',DefaultValue='Poly',Validator=ListValidator(['Poly','CE','SS']),Description = '')
Expand Down Expand Up @@ -44,11 +44,7 @@ def PyExec(self):
run_f2py_compatibility_test()

self.log().information('Muscat input')
instr = self.getPropertyValue('Instrument')
if instr == 'IRIS':
prefix = 'irs'
if instr == 'OSIRIS':
prefix = 'osi'
prefix = self.getPropertyValue('Instrument')
ana = self.getPropertyValue('Analyser')
geom = self.getPropertyValue('Geom')
disp = self.getPropertyValue('Dispersion')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def category(self):

def PyInit(self):
self.declareProperty(Name='InputType',DefaultValue='File',Validator=ListValidator(['File','Workspace']),Description = 'Origin of data input - File (*.nxs) or Workspace')
self.declareProperty(Name='Instrument',DefaultValue='IRIS',Validator=ListValidator(['IRIS','OSIRIS']),Description = 'Instrument')
self.declareProperty(Name='Instrument',DefaultValue='iris',Validator=ListValidator(['irs','iris','osi','osiris']),Description = 'Instrument')
self.declareProperty(Name='Analyser',DefaultValue='graphite002',Validator=ListValidator(['graphite002','graphite004']),Description = 'Analyser & reflection')
self.declareProperty(Name='Program',DefaultValue='QL',Validator=ListValidator(['QL','QSe']),Description = 'Name of program to run')
self.declareProperty(Name='SamNumber',DefaultValue='',Validator=MandatoryValidator(),Description = 'Sample run number')
Expand All @@ -38,11 +38,7 @@ def PyExec(self):

self.log().information('QLines input')
inType = self.getPropertyValue('InputType')
instr = self.getPropertyValue('Instrument')
if instr == 'IRIS':
prefix = 'irs'
if instr == 'OSIRIS':
prefix = 'osi'
prefix = self.getPropertyValue('Instrument')
ana = self.getPropertyValue('Analyser')
prog = self.getPropertyValue('Program')
sam = self.getPropertyValue('SamNumber')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def category(self):

def PyInit(self):
self.declareProperty(Name='InputType',DefaultValue='File',Validator=ListValidator(['File','Workspace']),Description = 'Origin of data input - File (*.nxs) or Workspace')
self.declareProperty(Name='Instrument',DefaultValue='IRIS',Validator=ListValidator(['IRIS','OSIRIS']),Description = 'Instrument')
self.declareProperty(Name='Instrument',DefaultValue='iris',Validator=ListValidator(['irs','iris','osi','osiris']),Description = 'Instrument')
self.declareProperty(Name='Analyser',DefaultValue='graphite002',Validator=ListValidator(['graphite002','graphite004']),Description = 'Analyser & reflection')
self.declareProperty(Name='SamNumber',DefaultValue='',Validator=MandatoryValidator(),Description = 'Sample run number')
self.declareProperty(Name='ResInputType',DefaultValue='File',Validator=ListValidator(['File','Workspace']),Description = 'Origin of res input - File (*_res.nxs) or Workspace')
Expand All @@ -33,11 +33,7 @@ def PyExec(self):

self.log().information('Quest input')
inType = self.getPropertyValue('InputType')
instr = self.getPropertyValue('Instrument')
if instr == 'IRIS':
prefix = 'irs'
if instr == 'OSIRIS':
prefix = 'osi'
prefix = self.getPropertyValue('Instrument')
ana = self.getPropertyValue('Analyser')
sam = self.getPropertyValue('SamNumber')
rinType = self.getPropertyValue('ResInputType')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def category(self):

def PyInit(self):
self.declareProperty(Name='InputType',DefaultValue='File',Validator=ListValidator(['File','Workspace']),Description = 'Origin of data input - File (*.nxs) or Workspace')
self.declareProperty(Name='Instrument',DefaultValue='IRIS',Validator=ListValidator(['IRIS','OSIRIS']),Description = 'Instrument')
self.declareProperty(Name='Instrument',DefaultValue='iris',Validator=ListValidator(['irs','iris','osi','osiris']),Description = 'Instrument')
self.declareProperty(Name='Analyser',DefaultValue='graphite002',Validator=ListValidator(['graphite002','graphite004']),Description = 'Analyser & reflection')
self.declareProperty(Name='VanNumber',DefaultValue='',Validator=MandatoryValidator(),Description = 'Sample run number')
self.declareProperty(Name='ResInputType',DefaultValue='File',Validator=ListValidator(['File','Workspace']),Description = 'Origin of res input - File (*_res.nxs) or Workspace')
Expand All @@ -29,11 +29,7 @@ def PyExec(self):

self.log().information('ResNorm input')
inType = self.getPropertyValue('InputType')
instr = self.getPropertyValue('Instrument')
if instr == 'IRIS':
prefix = 'irs'
if instr == 'OSIRIS':
prefix = 'osi'
prefix = self.getPropertyValue('Instrument')
ana = self.getPropertyValue('Analyser')
van = self.getPropertyValue('VanNumber')
rinType = self.getPropertyValue('ResInputType')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def category(self):

def PyInit(self):
self.declareProperty(Name='InputType',DefaultValue='File',Validator=ListValidator(['File','Workspace']),Description = 'Origin of data input - File (_red.nxs) or Workspace')
self.declareProperty(Name='Instrument',DefaultValue='IRIS',Validator=ListValidator(['IRIS','OSIRIS']),Description = 'Instrument')
self.declareProperty(Name='Instrument',DefaultValue='iris',Validator=ListValidator(['irs','iris','osi','osiris']),Description = 'Instrument')
self.declareProperty(Name='Analyser',DefaultValue='graphite002',Validator=ListValidator(['graphite002','graphite004']),Description = 'Analyser & reflection')
self.declareProperty(Name='SamNumber',DefaultValue='',Validator=MandatoryValidator(),Description = 'Sample run number')
self.declareProperty(Name='Xcut',DefaultValue='',Validator=MandatoryValidator(),Description = 'X cutoff value')
Expand All @@ -21,11 +21,7 @@ def PyExec(self):

self.log().information('Symmetrise')
inType = self.getPropertyValue('InputType')
instr = self.getPropertyValue('Instrument')
if instr == 'IRIS':
prefix = 'irs'
if instr == 'OSIRIS':
prefix = 'osi'
prefix = self.getPropertyValue('Instrument')
ana = self.getPropertyValue('Analyser')
sn = self.getPropertyValue('SamNumber')
sam = prefix+sn+'_'+ana+'_red'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def category(self):

def PyInit(self):
self.declareProperty(Name='InputType',DefaultValue='File',Validator=ListValidator(['File','Workspace']),Description = 'Origin of data input - File (_red.nxs) or Workspace')
self.declareProperty(Name='Instrument',DefaultValue='IRIS',Validator=ListValidator(['IRIS','OSIRIS']),Description = 'Instrument')
self.declareProperty(Name='Instrument',DefaultValue='iris',Validator=ListValidator(['irs','iris','osi','osiris']),Description = 'Instrument')
self.declareProperty(Name='Analyser',DefaultValue='graphite002',Validator=ListValidator(['graphite002','graphite004']),Description = 'Analyser & reflection')
self.declareProperty(Name='InNumber',DefaultValue='',Validator=MandatoryValidator(),Description = 'Sample run number')
self.declareProperty(Name='MultiplyBy',DefaultValue='',Validator=MandatoryValidator(),Description = 'Multiplicative scale factor')
Expand All @@ -21,11 +21,7 @@ def PyExec(self):
self.log().information('Scale input')
workdir = config['defaultsave.directory']
inType = self.getPropertyValue('InputType')
instr = self.getPropertyValue('Instrument')
if instr == 'IRIS':
prefix = 'irs'
if instr == 'OSIRIS':
prefix = 'osi'
prefix = self.getPropertyValue('Instrument')
ana = self.getPropertyValue('Analyser')
InNumb = self.getPropertyValue('InNumber')
inWS = prefix+InNumb+'_'+ana+'_red'
Expand Down

0 comments on commit 70e379b

Please sign in to comment.