Skip to content
Snippets Groups Projects
Commit 2d207364 authored by Federico Montesino Pouzols's avatar Federico Montesino Pouzols Committed by GitHub
Browse files

Merge pull request #16903 from mantidproject/16887_Elwin_inst_resolution_range_bars

Indirect Elwin - Use instrument resolution to initialise range bars
parents f8c5c755 618e232b
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,8 @@ private: ...@@ -19,7 +19,8 @@ private:
void run() override; void run() override;
bool validate() override; bool validate() override;
void loadSettings(const QSettings &settings) override; void loadSettings(const QSettings &settings) override;
void setDefaultResolution(Mantid::API::MatrixWorkspace_const_sptr ws); void setDefaultResolution(Mantid::API::MatrixWorkspace_const_sptr ws,
const QPair<double, double> &range);
void setDefaultSampleLog(Mantid::API::MatrixWorkspace_const_sptr ws); void setDefaultSampleLog(Mantid::API::MatrixWorkspace_const_sptr ws);
private slots: private slots:
......
...@@ -306,7 +306,8 @@ void Elwin::loadSettings(const QSettings &settings) { ...@@ -306,7 +306,8 @@ void Elwin::loadSettings(const QSettings &settings) {
m_uiForm.dsInputFiles->readSettings(settings.group()); m_uiForm.dsInputFiles->readSettings(settings.group());
} }
void Elwin::setDefaultResolution(Mantid::API::MatrixWorkspace_const_sptr ws) { void Elwin::setDefaultResolution(Mantid::API::MatrixWorkspace_const_sptr ws,
const QPair<double, double> &range) {
auto inst = ws->getInstrument(); auto inst = ws->getInstrument();
auto analyser = inst->getStringParameter("analyser"); auto analyser = inst->getStringParameter("analyser");
...@@ -322,6 +323,9 @@ void Elwin::setDefaultResolution(Mantid::API::MatrixWorkspace_const_sptr ws) { ...@@ -322,6 +323,9 @@ void Elwin::setDefaultResolution(Mantid::API::MatrixWorkspace_const_sptr ws) {
m_dblManager->setValue(m_properties["BackgroundStart"], -10 * res); m_dblManager->setValue(m_properties["BackgroundStart"], -10 * res);
m_dblManager->setValue(m_properties["BackgroundEnd"], -9 * res); m_dblManager->setValue(m_properties["BackgroundEnd"], -9 * res);
} else {
m_dblManager->setValue(m_properties["IntegrationStart"], range.first);
m_dblManager->setValue(m_properties["IntegrationEnd"], range.second);
} }
} }
} }
...@@ -423,22 +427,17 @@ void Elwin::plotInput() { ...@@ -423,22 +427,17 @@ void Elwin::plotInput() {
int specNo = m_uiForm.spPreviewSpec->value(); int specNo = m_uiForm.spPreviewSpec->value();
setDefaultResolution(ws);
setDefaultSampleLog(ws);
m_uiForm.ppPlot->clear();
m_uiForm.ppPlot->addSpectrum("Sample", ws, specNo);
try { try {
m_uiForm.ppPlot->clear();
m_uiForm.ppPlot->addSpectrum("Sample", ws, specNo);
QPair<double, double> range = m_uiForm.ppPlot->getCurveRange("Sample"); QPair<double, double> range = m_uiForm.ppPlot->getCurveRange("Sample");
// Set maximum range of Integration auto rangeSelector =
m_uiForm.ppPlot->getRangeSelector("ElwinIntegrationRange") m_uiForm.ppPlot->getRangeSelector("ElwinIntegrationRange");
->setRange(range.first, range.second); setPlotPropertyRange(rangeSelector, m_properties["IntegrationStart"],
// Set initial values m_properties["IntegrationEnd"], range);
m_uiForm.ppPlot->getRangeSelector("ElwinIntegrationRange")
->setMinimum(range.first); setDefaultResolution(ws, range);
m_uiForm.ppPlot->getRangeSelector("ElwinIntegrationRange") setDefaultSampleLog(ws);
->setMaximum(range.second);
} catch (std::invalid_argument &exc) { } catch (std::invalid_argument &exc) {
showMessageBox(exc.what()); showMessageBox(exc.what());
} }
......
...@@ -34,6 +34,7 @@ Improvements ...@@ -34,6 +34,7 @@ Improvements
- Algorithm :ref:`BASISReduction311 <algm-BASISReduction311>` has been included in algorithm :ref:`BASISReduction <algm-BASISReduction>`. - Algorithm :ref:`BASISReduction311 <algm-BASISReduction311>` has been included in algorithm :ref:`BASISReduction <algm-BASISReduction>`.
- Range bars colours in the *ISIS Calibration* interface have been updated to match the convention in the fit wizard. - Range bars colours in the *ISIS Calibration* interface have been updated to match the convention in the fit wizard.
- Vesuvio sigma_theta value updated for single and double differencing in both forward and back scattering. The new value is 0.016 for all. - Vesuvio sigma_theta value updated for single and double differencing in both forward and back scattering. The new value is 0.016 for all.
- The Elwin interface now uses the resolution of the instrument to create the range bars when possible
Bugfixes Bugfixes
......
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