-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5330f1f
commit 99d18a6
Showing
16 changed files
with
1,485 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Algorithm to start Force | ||
from MantidFramework import * | ||
import IndirectForce as Main | ||
|
||
class ForCE(PythonAlgorithm): | ||
|
||
def PyInit(self): | ||
self.declareProperty('Mode','ASCII',ListValidator(['ASCII','INX'])) | ||
self.declareProperty('Instrument','IN10',ListValidator(['IN10','IN16'])) | ||
self.declareProperty('RunName', DefaultValue='', Validator = MandatoryValidator()) | ||
self.declareProperty(Name='Verbose',DefaultValue='Yes',Validator=ListValidator(['No','Yes'])) | ||
self.declareProperty(Name='Plot',DefaultValue='None',Validator=ListValidator(['None','Spectrum','Contour','Both'])) | ||
|
||
def PyExec(self): | ||
|
||
self.log().information('ForCE input') | ||
mode = self.getPropertyValue('Mode') | ||
instr = self.getPropertyValue('Instrument') | ||
run = self.getPropertyValue('RunName') | ||
verbOp = self.getPropertyValue('Verbose') | ||
plotOp = self.getPropertyValue('Plot') | ||
|
||
if mode == 'ASCII': | ||
Main.IbackStart(instr,run,verbOp,plotOp) | ||
if mode == 'INX': | ||
Main.InxStart(instr,run,verbOp,plotOp) | ||
|
||
mantid.registerPyAlgorithm(ForCE()) # Register algorithm with Mantid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Algorithm to start Jump fit programs | ||
from MantidFramework import * | ||
from mantidsimple import * | ||
from mantidplotpy import * | ||
from IndirectCommon import runF2PyCheck, inF2PyCompatibleEnv | ||
if inF2PyCompatibleEnv(): | ||
import IndirectBayes as Main | ||
|
||
class Jump(PythonAlgorithm): | ||
|
||
def PyInit(self): | ||
self.declareProperty(Name='Instrument',DefaultValue='IRIS',Validator=ListValidator(['IRIS','OSIRIS'])) | ||
self.declareProperty(Name='QLprogram',DefaultValue='QLr',Validator=ListValidator(['QLr','QLd'])) | ||
self.declareProperty(Name='Fit',DefaultValue='CE',Validator=ListValidator(['CE','SS'])) | ||
self.declareProperty(Name='Width',DefaultValue='FW11',Validator=ListValidator(['FW11','FW21','FW22'])) | ||
self.declareProperty(Name='SamNumber',DefaultValue='',Validator=MandatoryValidator(),Description = 'Sample run number') | ||
self.declareProperty(Name='Verbose',DefaultValue='Yes',Validator=ListValidator(['Yes','No'])) | ||
self.declareProperty('Plot',DefaultValue='No',Validator=ListValidator(['Yes','No'])) | ||
|
||
def PyExec(self): | ||
runF2PyCheck() | ||
|
||
self.log().information('Jump input') | ||
instr = self.getPropertyValue('Instrument') | ||
if instr == 'IRIS': | ||
prefix = 'irs' | ||
if instr == 'OSIRIS': | ||
prefix = 'osi' | ||
prog = self.getPropertyValue('QLprogram') | ||
jump = self.getPropertyValue('Fit') | ||
fw = self.getPropertyValue('Width') | ||
sam = self.getPropertyValue('SamNumber') | ||
|
||
sname = prefix+sam | ||
verbOp = self.getPropertyValue('Verbose') | ||
plotOp = self.getPropertyValue('Plot') | ||
Main.JumpStart(sname,jump,prog,fw,verbOp,plotOp) | ||
|
||
mantid.registerPyAlgorithm(Jump()) # Register algorithm with Mantid |
84 changes: 84 additions & 0 deletions
84
Code/Mantid/Framework/PythonAPI/PythonAlgorithms/QLines.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Algorithm to start Bayes programs | ||
from MantidFramework import * | ||
from mantidsimple import * | ||
from mantidplotpy import * | ||
from IndirectCommon import runF2PyCheck, inF2PyCompatibleEnv | ||
if inF2PyCompatibleEnv(): | ||
import IndirectBayes as Main | ||
|
||
class QLines(PythonAlgorithm): | ||
|
||
def PyInit(self): | ||
self.declareProperty(Name='Instrument',DefaultValue='IRIS',Validator=ListValidator(['IRIS','OSIRIS'])) | ||
self.declareProperty(Name='Analyser',DefaultValue='graphite002',Validator=ListValidator(['graphite002','graphite004'])) | ||
self.declareProperty(Name='Program',DefaultValue='QL',Validator=ListValidator(['QL','QSe']),Description = 'Name of program to run') | ||
self.declareProperty(Name='ResType',DefaultValue='Res',Validator=ListValidator(['Res','Data']),Description = 'Format of Resolution file') | ||
self.declareProperty(Name='SamNumber',DefaultValue='',Validator=MandatoryValidator(),Description = 'Sample run number') | ||
self.declareProperty(Name='ResNumber',DefaultValue='',Validator=MandatoryValidator(),Description = 'Resolution run number') | ||
self.declareProperty(Name='ElasticOption',DefaultValue='Yes',Validator=ListValidator(['Yes','No']),Description = 'Include elastic peak in fit') | ||
self.declareProperty(Name='BackgroundOption',DefaultValue='Sloping',Validator=ListValidator(['Sloping','Flat','Zero']),Description = 'Form of background to fit') | ||
self.declareProperty(Name='FixWidth',DefaultValue='No',Validator=ListValidator(['No','Yes']),Description = 'Fix one of the widths') | ||
self.declareProperty(Name='WidthFile', DefaultValue='',Description = 'Name of file containing fixed width values') | ||
self.declareProperty(Name='ResNorm',DefaultValue='No',Validator=ListValidator(['No','Yes']),Description = 'Use ResNorm output file') | ||
self.declareProperty(Name='ResNormNumber', DefaultValue='',Description = 'Name of file containing fixed width values') | ||
self.declareProperty(Name='EnergyMin', DefaultValue=-0.5) | ||
self.declareProperty(Name='EnergyMax', DefaultValue=0.5) | ||
self.declareProperty(Name='SamBinning', DefaultValue=1,Description = 'Binning value for sample') | ||
self.declareProperty(Name='ResBinning', DefaultValue=1,Description = 'Binning value for resolution - QLd only') | ||
self.declareProperty(Name='Verbose',DefaultValue='Yes',Validator=ListValidator(['No','Yes'])) | ||
self.declareProperty(Name='Plot',DefaultValue='None',Validator=ListValidator(['None','ProbBeta','Intensity','FwHm','Fit','All'])) | ||
|
||
def PyExec(self): | ||
runF2PyCheck() | ||
|
||
self.log().information('QLines input') | ||
instr = self.getPropertyValue('Instrument') | ||
if instr == 'IRIS': | ||
prefix = 'irs' | ||
if instr == 'OSIRIS': | ||
prefix = 'osi' | ||
ana = self.getPropertyValue('Analyser') | ||
prog = self.getPropertyValue('Program') | ||
rtype = self.getPropertyValue('ResType') | ||
sam = self.getPropertyValue('SamNumber') | ||
res = self.getPropertyValue('ResNumber') | ||
elastic = self.getPropertyValue('ElasticOption') | ||
bgd = self.getPropertyValue('BackgroundOption') | ||
width = self.getPropertyValue('FixWidth') | ||
wfile = self.getPropertyValue('WidthFile') | ||
resnorm = self.getPropertyValue('ResNorm') | ||
resn = self.getPropertyValue('ResNormNumber') | ||
emin = self.getPropertyValue('EnergyMin') | ||
emax = self.getPropertyValue('EnergyMax') | ||
nbin = self.getPropertyValue('SamBinning') | ||
nrbin = self.getPropertyValue('ResBinning') | ||
nbins = [nbin, nrbin] | ||
|
||
sname = prefix+sam | ||
rname = prefix+res | ||
rsname = prefix +resn | ||
erange = [emin, emax] | ||
if elastic == 'Yes': | ||
o_el = 1 | ||
if elastic == 'No': | ||
o_el = 0 | ||
if bgd == 'Sloping': | ||
o_bgd = 2 | ||
if bgd == 'Flat': | ||
o_bgd = 1 | ||
if bgd == 'Zero': | ||
o_bgd = 0 | ||
if width == 'Yes': | ||
o_w1 = 1 | ||
if width == 'No': | ||
o_w1 = 0 | ||
if resnorm == 'Yes': | ||
o_res = 1 | ||
if resnorm == 'No': | ||
o_res = 0 | ||
fitOp = [o_el, o_bgd, o_w1, o_res] | ||
verbOp = self.getPropertyValue('Verbose') | ||
plotOp = self.getPropertyValue('Plot') | ||
Main.QLStart(prog,ana,sname,rname,rtype,rsname,erange,nbins,fitOp,wfile,verbOp,plotOp) | ||
|
||
mantid.registerPyAlgorithm(QLines()) # Register algorithm with Mantid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Algorithm to start Bayes programs | ||
from MantidFramework import * | ||
from mantidsimple import * | ||
from mantidplotpy import * | ||
from IndirectCommon import runF2PyCheck, inF2PyCompatibleEnv | ||
if inF2PyCompatibleEnv(): | ||
import IndirectBayes as Main | ||
|
||
class Quest(PythonAlgorithm): | ||
|
||
def PyInit(self): | ||
self.declareProperty(Name='Instrument',DefaultValue='IRIS',Validator=ListValidator(['IRIS','OSIRIS'])) | ||
self.declareProperty(Name='Analyser',DefaultValue='graphite002',Validator=ListValidator(['graphite002','graphite004'])) | ||
self.declareProperty(Name='SamNumber',DefaultValue='',Validator=MandatoryValidator(),Description = 'Sample run number') | ||
self.declareProperty(Name='ResNumber',DefaultValue='',Validator=MandatoryValidator(),Description = 'Resolution run number') | ||
self.declareProperty(Name='ElasticOption',DefaultValue='Yes',Validator=ListValidator(['Yes','No']),Description = 'Include elastic peak in fit') | ||
self.declareProperty(Name='BackgroundOption',DefaultValue='Sloping',Validator=ListValidator(['Sloping','Flat','Zero']),Description = 'Form of background to fit') | ||
self.declareProperty(Name='EnergyMin', DefaultValue=-0.5) | ||
self.declareProperty(Name='EnergyMax', DefaultValue=0.5) | ||
self.declareProperty(Name='SamBinning', DefaultValue=1,Description = 'Binning value for sample') | ||
self.declareProperty(Name='NumberSigma', DefaultValue=50,Description = 'Number of sigma values - Quest only') | ||
self.declareProperty(Name='NumberBeta', DefaultValue=30,Description = 'Number of beta values - Quest only') | ||
self.declareProperty(Name='Verbose',DefaultValue='Yes',Validator=ListValidator(['Yes','No'])) | ||
self.declareProperty(Name='Plot',DefaultValue='None',Validator=ListValidator(['None','Sigma','Beta','All'])) | ||
|
||
def PyExec(self): | ||
runF2PyCheck() | ||
|
||
self.log().information('Quest input') | ||
instr = self.getPropertyValue('Instrument') | ||
if instr == 'IRIS': | ||
prefix = 'irs' | ||
if instr == 'OSIRIS': | ||
prefix = 'osi' | ||
ana = self.getPropertyValue('Analyser') | ||
sam = self.getPropertyValue('SamNumber') | ||
res = self.getPropertyValue('ResNumber') | ||
elastic = self.getPropertyValue('ElasticOption') | ||
bgd = self.getPropertyValue('BackgroundOption') | ||
emin = self.getPropertyValue('EnergyMin') | ||
emax = self.getPropertyValue('EnergyMax') | ||
nbin = self.getPropertyValue('SamBinning') | ||
nbins = [nbin, 1] | ||
nbet = self.getPropertyValue('NumberBeta') | ||
nsig = self.getPropertyValue('NumberSigma') | ||
nbs = [nbet, nsig] | ||
nbs = [ 30,50] | ||
|
||
sname = prefix+sam | ||
rname = prefix+res | ||
erange = [emin, emax] | ||
if elastic == 'Yes': | ||
o_el = 1 | ||
if elastic == 'No': | ||
o_el = 0 | ||
if bgd == 'Sloping': | ||
o_bgd = 2 | ||
if bgd == 'Flat': | ||
o_bgd = 1 | ||
if bgd == 'Zero': | ||
o_bgd = 0 | ||
fitOp = [o_el, o_bgd, 0, 0] | ||
verbOp = self.getPropertyValue('Verbose') | ||
plotOp = self.getPropertyValue('Plot') | ||
Main.QuestStart(ana,sname,rname,nbs,erange,nbins,fitOp,verbOp,plotOp) | ||
|
||
mantid.registerPyAlgorithm(Quest()) # Register algorithm with Mantid |
45 changes: 45 additions & 0 deletions
45
Code/Mantid/Framework/PythonAPI/PythonAlgorithms/ResNorm.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Algorithm to start Bayes programs | ||
from MantidFramework import * | ||
from mantidsimple import * | ||
from mantidplotpy import * | ||
from IndirectCommon import runF2PyCheck, inF2PyCompatibleEnv | ||
if inF2PyCompatibleEnv(): | ||
import IndirectBayes as Main | ||
|
||
class ResNorm(PythonAlgorithm): | ||
|
||
def PyInit(self): | ||
self.declareProperty(Name='Instrument',DefaultValue='IRIS',Validator=ListValidator(['IRIS','OSIRIS'])) | ||
self.declareProperty(Name='Analyser',DefaultValue='graphite002',Validator=ListValidator(['graphite002','graphite004'])) | ||
self.declareProperty(Name='VanNumber',DefaultValue='',Validator=MandatoryValidator(),Description = 'Sample run number') | ||
self.declareProperty(Name='ResNumber',DefaultValue='',Validator=MandatoryValidator(),Description = 'Resolution run number') | ||
self.declareProperty(Name='EnergyMin', DefaultValue=-0.2) | ||
self.declareProperty(Name='EnergyMax', DefaultValue=0.2) | ||
self.declareProperty(Name='VanBinning', DefaultValue=1,Description = 'Binning value for sample') | ||
self.declareProperty(Name='Verbose',DefaultValue='Yes',Validator=ListValidator(['Yes','No'])) | ||
self.declareProperty('Plot',DefaultValue='None',Validator=ListValidator(['None','Intensity','Stretch','Fit','All'])) | ||
|
||
def PyExec(self): | ||
runF2PyCheck() | ||
|
||
self.log().information('ResNorm input') | ||
instr = self.getPropertyValue('Instrument') | ||
if instr == 'IRIS': | ||
prefix = 'irs' | ||
if instr == 'OSIRIS': | ||
prefix = 'osi' | ||
ana = self.getPropertyValue('Analyser') | ||
van = self.getPropertyValue('VanNumber') | ||
res = self.getPropertyValue('ResNumber') | ||
emin = self.getPropertyValue('EnergyMin') | ||
emax = self.getPropertyValue('EnergyMax') | ||
nbin = self.getPropertyValue('VanBinning') | ||
|
||
vname = prefix+van | ||
rname = prefix+res | ||
erange = [emin, emax] | ||
verbOp = self.getPropertyValue('Verbose') | ||
plotOp = self.getPropertyValue('Plot') | ||
Main.ResNormStart(ana,vname,rname,erange,nbin,verbOp,plotOp) | ||
|
||
mantid.registerPyAlgorithm(ResNorm()) # Register algorithm with Mantid |
Binary file not shown.
Oops, something went wrong.