Skip to content
Snippets Groups Projects
Commit c456cea7 authored by Federico Montesino Pouzols's avatar Federico Montesino Pouzols
Browse files

Merge remote-tracking branch 'origin/bugfix/10604_idr_calib_new_run_numbers'

parents f6b5f123 f28e7cf2
No related merge requests found
...@@ -380,8 +380,6 @@ namespace CustomInterfaces ...@@ -380,8 +380,6 @@ namespace CustomInterfaces
QString files = m_uiForm.cal_leRunNo->getFilenames().join(","); QString files = m_uiForm.cal_leRunNo->getFilenames().join(",");
QFileInfo fi(m_uiForm.cal_leRunNo->getFirstFilename()); QFileInfo fi(m_uiForm.cal_leRunNo->getFirstFilename());
QString outWS = fi.baseName() + "_" + m_uiForm.cbAnalyser->currentText() +
m_uiForm.cbReflection->currentText() + "_red";
QString detRange = QString::number(m_dblManager->value(m_properties["ResSpecMin"])) + "," QString detRange = QString::number(m_dblManager->value(m_properties["ResSpecMin"])) + ","
+ QString::number(m_dblManager->value(m_properties["ResSpecMax"])); + QString::number(m_dblManager->value(m_properties["ResSpecMax"]));
...@@ -396,18 +394,35 @@ namespace CustomInterfaces ...@@ -396,18 +394,35 @@ namespace CustomInterfaces
reductionAlg->setProperty("DetectorRange", detRange.toStdString()); reductionAlg->setProperty("DetectorRange", detRange.toStdString());
reductionAlg->execute(); reductionAlg->execute();
Mantid::API::MatrixWorkspace_sptr input = boost::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>( if(!reductionAlg->isExecuted())
Mantid::API::AnalysisDataService::Instance().retrieve(outWS.toStdString())); {
g_log.warning("Could not generate energy preview plot.");
return;
}
const Mantid::MantidVec & dataX = input->readX(0); WorkspaceGroup_sptr reductionOutputGroup = AnalysisDataService::Instance().retrieveWS<WorkspaceGroup>("__IndirectCalibration_reduction");
if(reductionOutputGroup->size() == 0)
{
g_log.warning("No result workspaces, cannot plot energy preview.");
return;
}
MatrixWorkspace_sptr energyWs = boost::dynamic_pointer_cast<MatrixWorkspace>(reductionOutputGroup->getItem(0));
if(!energyWs)
{
g_log.warning("No result workspaces, cannot plot energy preview.");
return;
}
const Mantid::MantidVec & dataX = energyWs->readX(0);
std::pair<double, double> range(dataX.front(), dataX.back()); std::pair<double, double> range(dataX.front(), dataX.back());
setPlotRange("ResBackground", m_properties["ResStart"], m_properties["ResEnd"], range); setPlotRange("ResBackground", m_properties["ResStart"], m_properties["ResEnd"], range);
plotMiniPlot(input, 0, "ResPlot", "ResCurve"); plotMiniPlot(energyWs, 0, "ResPlot", "ResCurve");
setXAxisToCurve("ResPlot", "ResCurve"); setXAxisToCurve("ResPlot", "ResCurve");
calSetDefaultResolution(input); calSetDefaultResolution(energyWs);
replot("ResPlot"); replot("ResPlot");
} }
......
...@@ -401,12 +401,22 @@ namespace CustomInterfaces ...@@ -401,12 +401,22 @@ namespace CustomInterfaces
if(filenames.size() < 1) if(filenames.size() < 1)
return; return;
QString filename = filenames[0].toLower(); WorkspaceGroup_sptr sliceOutputGroup = AnalysisDataService::Instance().retrieveWS<WorkspaceGroup>("IndirectDiagnostics_Workspaces");
QFileInfo rawFileInfo(filename); if(sliceOutputGroup->size() == 0)
QString wsName = rawFileInfo.baseName() + "_" + m_uiForm.cbAnalyser->currentText() + m_uiForm.cbReflection->currentText() + "_slice"; {
g_log.warning("No result workspaces, cannot plot preview.");
return;
}
MatrixWorkspace_sptr sliceWs = boost::dynamic_pointer_cast<MatrixWorkspace>(sliceOutputGroup->getItem(0));
if(!sliceWs)
{
g_log.warning("No result workspaces, cannot plot preview.");
return;
}
// Plot result spectrum // Plot result spectrum
plotMiniPlot(wsName, 0, "SlicePreviewPlot", "SlicePreviewCurve"); plotMiniPlot(sliceWs, 0, "SlicePreviewPlot", "SlicePreviewCurve");
// Set X range to data range // Set X range to data range
setXAxisToCurve("SlicePreviewPlot", "SlicePreviewCurve"); setXAxisToCurve("SlicePreviewPlot", "SlicePreviewCurve");
......
...@@ -83,10 +83,10 @@ namespace CustomInterfaces ...@@ -83,10 +83,10 @@ namespace CustomInterfaces
load->setProperty("OutputWorkspace", outputName.toStdString()); load->setProperty("OutputWorkspace", outputName.toStdString());
if(specMin != -1) if(specMin != -1)
load->setProperty("SpectrumMin", specMin); load->setPropertyValue("SpectrumMin", boost::lexical_cast<std::string>(specMin));
if(specMax != -1) if(specMax != -1)
load->setProperty("SpectrumMax", specMax); load->setPropertyValue("SpectrumMax", boost::lexical_cast<std::string>(specMax));
load->execute(); load->execute();
......
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