Skip to content
Snippets Groups Projects
Commit fec86027 authored by Peter Parker's avatar Peter Parker
Browse files

Merge remote-tracking branch 'origin/feature/7838_c2e_output_options'

parents 6b641222 ec1c9173
No related branches found
No related tags found
No related merge requests found
...@@ -606,6 +606,12 @@ void Indirect::createRESfile(const QString& file) ...@@ -606,6 +606,12 @@ void Indirect::createRESfile(const QString& file)
if ( m_uiForm.cal_ckPlotResult->isChecked() ) { pyInput += "plot = True\n"; } if ( m_uiForm.cal_ckPlotResult->isChecked() ) { pyInput += "plot = True\n"; }
else { pyInput += "plot = False\n"; } else { pyInput += "plot = False\n"; }
if ( m_uiForm.cal_ckVerbose->isChecked() ) { pyInput += "verbose = True\n"; }
else { pyInput += "verbose = False\n"; }
if ( m_uiForm.cal_ckSave->isChecked() ) { pyInput += "save = True\n"; }
else { pyInput += "save = False\n"; }
QString rebinParam = QString::number(m_calDblMng->value(m_calResProp["ELow"])) + "," + QString rebinParam = QString::number(m_calDblMng->value(m_calResProp["ELow"])) + "," +
QString::number(m_calDblMng->value(m_calResProp["EWidth"])) + "," + QString::number(m_calDblMng->value(m_calResProp["EWidth"])) + "," +
QString::number(m_calDblMng->value(m_calResProp["EHigh"])); QString::number(m_calDblMng->value(m_calResProp["EHigh"]));
...@@ -617,7 +623,7 @@ void Indirect::createRESfile(const QString& file) ...@@ -617,7 +623,7 @@ void Indirect::createRESfile(const QString& file)
"background = " + background + "\n" "background = " + background + "\n"
"rebinParam = '" + rebinParam + "'\n" "rebinParam = '" + rebinParam + "'\n"
"file = " + file + "\n" "file = " + file + "\n"
"ws = resolution(file, iconOpt, rebinParam, background, instrument, analyser, reflection, plotOpt = plot, factor="+scaleFactor+")\n" "ws = resolution(file, iconOpt, rebinParam, background, instrument, analyser, reflection, Verbose=verbose, Plot=plot, Save=save, factor="+scaleFactor+")\n"
"scaled = "+ scaled +"\n" "scaled = "+ scaled +"\n"
"scaleFactor = "+m_uiForm.cal_leIntensityScaleMultiplier->text()+"\n" "scaleFactor = "+m_uiForm.cal_leIntensityScaleMultiplier->text()+"\n"
"backStart = "+QString::number(m_calDblMng->value(m_calCalProp["BackMin"]))+"\n" "backStart = "+QString::number(m_calDblMng->value(m_calCalProp["BackMin"]))+"\n"
...@@ -1545,8 +1551,13 @@ void Indirect::calibCreate() ...@@ -1545,8 +1551,13 @@ void Indirect::calibCreate()
reducer += "calib.execute(None, None)\n" reducer += "calib.execute(None, None)\n"
"result = calib.result_workspace()\n" "result = calib.result_workspace()\n"
"print result\n" "print result\n";
"SaveNexus(InputWorkspace=result, Filename=result+'.nxs')\n";
if( m_uiForm.cal_ckSave->isChecked() )
{
reducer +=
"SaveNexus(InputWorkspace=result, Filename=result+'.nxs')\n";
}
if ( m_uiForm.cal_ckPlotResult->isChecked() ) if ( m_uiForm.cal_ckPlotResult->isChecked() )
{ {
...@@ -1817,6 +1828,11 @@ void Indirect::sOfQwClicked() ...@@ -1817,6 +1828,11 @@ void Indirect::sOfQwClicked()
if ( m_uiForm.sqw_ckSave->isChecked() ) if ( m_uiForm.sqw_ckSave->isChecked() )
{ {
pyInput += "SaveNexus(InputWorkspace=sqwOutput, Filename=sqwOutput+'.nxs')\n"; pyInput += "SaveNexus(InputWorkspace=sqwOutput, Filename=sqwOutput+'.nxs')\n";
if (m_uiForm.sqw_ckVerbose->isChecked())
{
pyInput += "logger.notice(\"Resolution file saved to default save directory.\")\n";
}
} }
if ( m_uiForm.sqw_cbPlotType->currentText() == "Contour" ) if ( m_uiForm.sqw_cbPlotType->currentText() == "Contour" )
......
...@@ -52,7 +52,7 @@ def createMappingFile(groupFile, ngroup, nspec, first): ...@@ -52,7 +52,7 @@ def createMappingFile(groupFile, ngroup, nspec, first):
def resolution(files, iconOpt, rebinParam, bground, def resolution(files, iconOpt, rebinParam, bground,
instrument, analyser, reflection, instrument, analyser, reflection,
plotOpt=False, Res=True, factor=None): Res=True, factor=None, Plot=False, Verbose=False, Save=False):
reducer = inelastic_indirect_reducer.IndirectReducer() reducer = inelastic_indirect_reducer.IndirectReducer()
reducer.set_instrument_name(instrument) reducer.set_instrument_name(instrument)
reducer.set_detector_range(iconOpt['first']-1,iconOpt['last']-1) reducer.set_detector_range(iconOpt['first']-1,iconOpt['last']-1)
...@@ -80,14 +80,17 @@ def resolution(files, iconOpt, rebinParam, bground, ...@@ -80,14 +80,17 @@ def resolution(files, iconOpt, rebinParam, bground,
CalculateFlatBackground(InputWorkspace=iconWS, OutputWorkspace=name, StartX=bground[0], EndX=bground[1], CalculateFlatBackground(InputWorkspace=iconWS, OutputWorkspace=name, StartX=bground[0], EndX=bground[1],
Mode='Mean', OutputMode='Subtract Background') Mode='Mean', OutputMode='Subtract Background')
Rebin(InputWorkspace=name, OutputWorkspace=name, Params=rebinParam) Rebin(InputWorkspace=name, OutputWorkspace=name, Params=rebinParam)
if Save:
if Verbose:
logger.notice("Resolution file saved to default save directory.")
SaveNexusProcessed(InputWorkspace=name, Filename=name+'.nxs')
SaveNexusProcessed(InputWorkspace=name, Filename=name+'.nxs') if Plot:
if plotOpt:
graph = mp.plotSpectrum(name, 0) graph = mp.plotSpectrum(name, 0)
return name return name
else: else:
if plotOpt: if Plot:
graph = mp.plotSpectrum(iconWS, 0) graph = mp.plotSpectrum(iconWS, 0)
return iconWS return iconWS
...@@ -194,7 +197,7 @@ def sliceProcessRawFile(rawFile, calibWsName, useCalib, xRange, useTwoRanges, sp ...@@ -194,7 +197,7 @@ def sliceProcessRawFile(rawFile, calibWsName, useCalib, xRange, useTwoRanges, sp
return sfile return sfile
def slice(inputfiles, calib, xRange, spec, suffix, Save=False, Verbose=True, Plot=False): def slice(inputfiles, calib, xRange, spec, suffix, Save=False, Verbose=False, Plot=False):
StartTime('Slice') StartTime('Slice')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment