Skip to content

Commit

Permalink
Refs #5421 More updating bayes for GUI.
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Jackson committed Oct 24, 2013
1 parent 014b3c0 commit 29c6613
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Code/Mantid/MantidQt/CustomInterfaces/src/JumpFit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ namespace MantidQt
QString pyInput =
"from IndirectJumpFit import JumpRun\n";

pyInput += "JumpRun("+sample+","+fitFunction+","+widthTxt+","+QMin+","+QMax+","
pyInput += "JumpRun('"+sample+"','"+fitFunction+"',"+widthTxt+","+QMin+","+QMax+","
"Save="+save+", Plot='"+plot+"', Verbose="+verbose+")\n";

runPythonScript(pyInput);
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/MantidQt/CustomInterfaces/src/Stretch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ namespace MantidQt
if(m_uiForm.chkElasticPeak->isChecked()) { elasticPeak = "True"; }
if(m_uiForm.chkSequentialFit->isChecked()) { sequence = "True"; }

QString fitOps = "[" + elasticPeak + ", '" + background + "', 0, 0]";
QString fitOps = "[" + elasticPeak + ", '" + background + "', False, False]";

//Collect input from the properties browser
QString eMin = m_properties["EMin"]->valueText();
Expand Down
37 changes: 19 additions & 18 deletions Code/Mantid/scripts/Inelastic/IndirectBayes.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,10 +631,25 @@ def CheckBetSig(nbs):
sys.exit(error)
return Nbet,Nsig

def QuestRun(samWS,resWS,rsname,nbs,erange,nbins,Fit,Loop,Verbose,Plot,Save):
def QuestRun(samWS,resWS,nbs,erange,nbins,Fit,Loop,Verbose,Plot,Save):
StartTime('Quest')
#expand fit options
elastic, background, width, resnorm = Fit

#convert true/false to 1/0 for fortran
o_el = 1 if elastic else 0
o_w1 = 1 if width else 0
o_res = 1 if resnorm else 0

resnorm = (Fit[:3] == 1)
#fortran code uses background choices defined using the following numbers
if background == 'Sloping':
o_bgd = 2
elif background == 'Flat':
o_bgd = 1
elif background == 'Zero':
o_bgd = 0

fitOp = [o_el, o_bgd, o_w1, o_res]

workdir = config['defaultsave.directory']
array_len = 4096 # length of array in Fortran
Expand All @@ -645,22 +660,10 @@ def QuestRun(samWS,resWS,rsname,nbs,erange,nbins,Fit,Loop,Verbose,Plot,Save):
logger.notice('Resolution is ' + resWS)
CheckAnalysers(samWS,resWS,Verbose)
nsam,ntc = CheckHistZero(samWS)

if Loop != True:
nsam = 1
if Fit[0]:
elastic = True
o_el = 1
else:
elastic = False
o_el = 0
if Fit[1] == 'Sloping':
o_bgd = 2
if Fit[1] == 'Flat':
o_bgd = 1
if Fit[1] == 'Zero':
o_bgd = 0
background = Fit[1]
fitOp = [o_el, o_bgd, 0, 0]

efix = getEfixed(samWS)
theta,Q = GetThetaQ(samWS)
nres,ntr = CheckHistZero(resWS)
Expand All @@ -674,8 +677,6 @@ def QuestRun(samWS,resWS,rsname,nbs,erange,nbins,Fit,Loop,Verbose,Plot,Save):
logger.notice(' Number of spectra = '+str(nsam))
logger.notice(' Erange : '+str(erange[0])+' to '+str(erange[1]))

dtn,xsc = ReadNormFile(resnorm,rsname,nsam,Verbose)

fname = samWS[:-4] + '_'+ prog
wrks=workdir + samWS[:-4]
if Verbose:
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/scripts/Inelastic/IndirectJumpFit.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ def JumpRun(samWS,jumpFunc,width,qmin,qmax,Verbose=False,Plot=False,Save=False):
EndTime('Jump fit : '+jumpFunc+' ; ')

def JumpPlot(inputWS):
j_plot=mp.plotSpectrum(inputWS,[0,1,2],True)
mp.plotSpectrum(inputWS,[0,1,2],True)

0 comments on commit 29c6613

Please sign in to comment.