Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/7841_minor_res_updates'
Browse files Browse the repository at this point in the history
  • Loading branch information
jawrainey committed Oct 18, 2013
2 parents 2e44a02 + fb99eb8 commit 095bb6f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1890,13 +1890,6 @@ Later steps in the process (saving, renaming) will not be done.</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cal_pbPlotEnergy">
<property name="text">
<string>Plot Energy</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
Expand Down
21 changes: 19 additions & 2 deletions Code/Mantid/MantidQt/CustomInterfaces/src/Indirect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ void Indirect::initLayout()
// "Calibration" tab
connect(m_uiForm.cal_leRunNo, SIGNAL(filesFound()), this, SLOT(calPlotRaw()));
connect(m_uiForm.cal_pbPlot, SIGNAL(clicked()), this, SLOT(calPlotRaw()));
connect(m_uiForm.cal_pbPlotEnergy, SIGNAL(clicked()), this, SLOT(calPlotEnergy()));
connect(m_uiForm.cal_ckRES, SIGNAL(toggled(bool)), this, SLOT(resCheck(bool)));
connect(m_uiForm.cal_ckIntensityScaleMultiplier, SIGNAL(toggled(bool)), this, SLOT(intensityScaleMultiplierCheck(bool)));
connect(m_uiForm.cal_leIntensityScaleMultiplier, SIGNAL(textChanged(const QString &)), this, SLOT(calibValidateIntensity(const QString &)));
Expand Down Expand Up @@ -607,11 +606,27 @@ void Indirect::createRESfile(const QString& file)

QString background = "[ " +QString::number(m_calDblMng->value(m_calResProp["Start"]))+ ", " +QString::number(m_calDblMng->value(m_calResProp["End"]))+"]";

QString scaled = m_uiForm.cal_ckIntensityScaleMultiplier->isChecked() ? "True" : "False";
pyInput +=
"background = " + background + "\n"
"rebinParam = '" + rebinParam + "'\n"
"file = " + file + "\n"
"resolution(file, iconOpt, rebinParam, background, instrument, analyser, reflection, plotOpt = plot, factor="+scaleFactor+")\n";
"ws = resolution(file, iconOpt, rebinParam, background, instrument, analyser, reflection, plotOpt = plot, factor="+scaleFactor+")\n"
"scaled = "+ scaled +"\n"
"scaleFactor = "+m_uiForm.cal_leIntensityScaleMultiplier->text()+"\n"
"backStart = "+QString::number(m_calDblMng->value(m_calCalProp["BackMin"]))+"\n"
"backEnd = "+QString::number(m_calDblMng->value(m_calCalProp["BackMax"]))+"\n"
"rebinLow = "+QString::number(m_calDblMng->value(m_calResProp["ELow"]))+"\n"
"rebinWidth = "+QString::number(m_calDblMng->value(m_calResProp["EWidth"]))+"\n"
"rebinHigh = "+QString::number(m_calDblMng->value(m_calResProp["EHigh"]))+"\n"
"AddSampleLog(Workspace=ws, LogName='scale', LogType='String', LogText=str(scaled))\n"
"if scaled:"
" AddSampleLog(Workspace=ws, LogName='scale_factor', LogType='Number', LogText=str(scaleFactor))\n"
"AddSampleLog(Workspace=ws, LogName='back_start', LogType='Number', LogText=str(backStart))\n"
"AddSampleLog(Workspace=ws, LogName='back_end', LogType='Number', LogText=str(backEnd))\n"
"AddSampleLog(Workspace=ws, LogName='rebin_low', LogType='Number', LogText=str(rebinLow))\n"
"AddSampleLog(Workspace=ws, LogName='rebin_width', LogType='Number', LogText=str(rebinWidth))\n"
"AddSampleLog(Workspace=ws, LogName='rebin_high', LogType='Number', LogText=str(rebinHigh))\n";

QString pyOutput = runPythonCode(pyInput).trimmed();

Expand Down Expand Up @@ -1603,6 +1618,8 @@ void Indirect::calPlotRaw()
// Replot
m_calCalPlot->replot();

// also replot the energy
calPlotEnergy();
}

void Indirect::calPlotEnergy()
Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/scripts/Inelastic/IndirectEnergyConversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def resolution(files, iconOpt, rebinParam, bground,
CalculateFlatBackground(InputWorkspace=iconWS, OutputWorkspace=name, StartX=bground[0], EndX=bground[1],
Mode='Mean', OutputMode='Subtract Background')
Rebin(InputWorkspace=name, OutputWorkspace=name, Params=rebinParam)
DeleteWorkspace(iconWS)

SaveNexusProcessed(InputWorkspace=name, Filename=name+'.nxs')

Expand Down

0 comments on commit 095bb6f

Please sign in to comment.