| 1 | # Algorithm to start Bayes programs |
|---|
| 2 | from MantidFramework import * |
|---|
| 3 | from mantidsimple import * |
|---|
| 4 | from mantidplotpy import * |
|---|
| 5 | import IndirectTrans as Main |
|---|
| 6 | |
|---|
| 7 | class IDAtransmission(PythonAlgorithm): |
|---|
| 8 | |
|---|
| 9 | def PyInit(self): |
|---|
| 10 | self.declareProperty(Name='Instrument',DefaultValue='IRIS',Validator=ListValidator(['IRIS','OSIRIS'])) |
|---|
| 11 | self.declareProperty(Name='SamNumber',DefaultValue='',Validator=MandatoryValidator(),Description = 'Sample run number') |
|---|
| 12 | self.declareProperty(Name='CanNumber',DefaultValue='',Validator=MandatoryValidator(),Description = 'Resolution run number') |
|---|
| 13 | self.declareProperty('Verbose',DefaultValue='Yes',Validator=ListValidator(['Yes','No'])) |
|---|
| 14 | |
|---|
| 15 | def PyExec(self): |
|---|
| 16 | |
|---|
| 17 | self.log().information('IDA transmission input') |
|---|
| 18 | instr = self.getPropertyValue('Instrument') |
|---|
| 19 | if instr == 'IRIS': |
|---|
| 20 | prefix = 'irs' |
|---|
| 21 | if instr == 'OSIRIS': |
|---|
| 22 | prefix = 'osi' |
|---|
| 23 | sn = self.getPropertyValue('SamNumber') |
|---|
| 24 | cn = self.getPropertyValue('CanNumber') |
|---|
| 25 | |
|---|
| 26 | sam = prefix+sn |
|---|
| 27 | can = prefix+cn |
|---|
| 28 | |
|---|
| 29 | verbOp = self.getPropertyValue('Verbose') |
|---|
| 30 | Main.IDATransStart(sam,can,verbOp) |
|---|
| 31 | |
|---|
| 32 | mantid.registerPyAlgorithm(IDAtransmission()) # Register algorithm with Mantid |
|---|