Skip to content
Snippets Groups Projects
Commit ca58be06 authored by Martyn Gigg's avatar Martyn Gigg Committed by GitHub
Browse files

Merge pull request #19107 from mantidproject/AlignAndFocus_POLARIS

AlignAndFocus POLARIS
parents d86cc56d a158c623
No related branches found
No related tags found
No related merge requests found
...@@ -115,26 +115,26 @@ private: ...@@ -115,26 +115,26 @@ private:
API::ITableWorkspace_sptr m_calibrationWS; API::ITableWorkspace_sptr m_calibrationWS;
DataObjects::MaskWorkspace_sptr m_maskWS; DataObjects::MaskWorkspace_sptr m_maskWS;
DataObjects::GroupingWorkspace_sptr m_groupWS; DataObjects::GroupingWorkspace_sptr m_groupWS;
double m_l1; double m_l1{0.0};
std::vector<int32_t> specids; std::vector<int32_t> specids;
std::vector<double> l2s; std::vector<double> l2s;
std::vector<double> tths; std::vector<double> tths;
std::vector<double> phis; std::vector<double> phis;
std::string m_instName; std::string m_instName;
std::vector<double> m_params; std::vector<double> m_params;
int m_resampleX; int m_resampleX{0};
std::vector<double> m_dmins; std::vector<double> m_dmins;
std::vector<double> m_dmaxs; std::vector<double> m_dmaxs;
bool dspace; bool dspace{false};
double xmin; double xmin{0.0};
double xmax; double xmax{0.0};
double LRef; double LRef{0.0};
double DIFCref; double DIFCref{0.0};
double minwl; double minwl{0.0};
double maxwl; double maxwl{0.0};
double tmin; double tmin{0.0};
double tmax; double tmax{0.0};
bool m_preserveEvents; bool m_preserveEvents{false};
void doSortEvents(Mantid::API::Workspace_sptr ws); void doSortEvents(Mantid::API::Workspace_sptr ws);
/// Low resolution TOF matrix workspace /// Low resolution TOF matrix workspace
...@@ -142,11 +142,11 @@ private: ...@@ -142,11 +142,11 @@ private:
/// Low resolution TOF event workspace /// Low resolution TOF event workspace
DataObjects::EventWorkspace_sptr m_lowResEW; DataObjects::EventWorkspace_sptr m_lowResEW;
/// Flag to process low resolution workspace /// Flag to process low resolution workspace
bool m_processLowResTOF; bool m_processLowResTOF{false};
/// Offset to low resolution TOF spectra /// Offset to low resolution TOF spectra
size_t m_lowResSpecOffset; size_t m_lowResSpecOffset{0};
API::Progress *m_progress; ///< Progress reporting API::Progress *m_progress{nullptr}; ///< Progress reporting
}; };
} // namespace WorkflowAlgorithm } // namespace WorkflowAlgorithm
......
...@@ -34,11 +34,7 @@ using API::FileProperty; ...@@ -34,11 +34,7 @@ using API::FileProperty;
// Register the class into the algorithm factory // Register the class into the algorithm factory
DECLARE_ALGORITHM(AlignAndFocusPowder) DECLARE_ALGORITHM(AlignAndFocusPowder)
AlignAndFocusPowder::AlignAndFocusPowder() AlignAndFocusPowder::AlignAndFocusPowder() : API::DataProcessorAlgorithm() {}
: API::DataProcessorAlgorithm(), m_l1(0.0), m_resampleX(0), dspace(false),
xmin(0.0), xmax(0.0), LRef(0.0), DIFCref(0.0), minwl(0.0), maxwl(0.),
tmin(0.0), tmax(0.0), m_preserveEvents(false), m_processLowResTOF(false),
m_lowResSpecOffset(0), m_progress(nullptr) {}
AlignAndFocusPowder::~AlignAndFocusPowder() { AlignAndFocusPowder::~AlignAndFocusPowder() {
if (m_progress) if (m_progress)
...@@ -77,7 +73,7 @@ void AlignAndFocusPowder::init() { ...@@ -77,7 +73,7 @@ void AlignAndFocusPowder::init() {
"grouping data"); "grouping data");
declareProperty(Kernel::make_unique<FileProperty>( declareProperty(Kernel::make_unique<FileProperty>(
"GroupFilename", "", FileProperty::OptionalLoad, "GroupFilename", "", FileProperty::OptionalLoad,
std::vector<std::string>{".xml"}), std::vector<std::string>{".xml", ".cal"}),
"Overrides grouping from CalFileName"); "Overrides grouping from CalFileName");
declareProperty( declareProperty(
make_unique<WorkspaceProperty<GroupingWorkspace>>( make_unique<WorkspaceProperty<GroupingWorkspace>>(
...@@ -933,12 +929,28 @@ void AlignAndFocusPowder::loadCalFile(const std::string &calFilename, ...@@ -933,12 +929,28 @@ void AlignAndFocusPowder::loadCalFile(const std::string &calFilename,
if (loadMask && !groupFilename.empty()) { if (loadMask && !groupFilename.empty()) {
g_log.information() << "Loading Grouping file \"" << groupFilename g_log.information() << "Loading Grouping file \"" << groupFilename
<< "\"\n"; << "\"\n";
IAlgorithm_sptr alg = createChildAlgorithm("LoadDetectorsGroupingFile"); if (groupFilename.find(".cal") != std::string::npos) {
alg->setProperty("InputFile", groupFilename); IAlgorithm_sptr alg = createChildAlgorithm("LoadDiffCal");
alg->executeAsChildAlg(); alg->setProperty("InputWorkspace", m_inputW);
alg->setPropertyValue("Filename", groupFilename);
alg->setProperty<bool>("MakeCalWorkspace", false);
alg->setProperty<bool>("MakeGroupingWorkspace", true);
alg->setProperty<bool>("MakeMaskWorkspace", false);
alg->setPropertyValue("WorkspaceName", m_instName);
alg->executeAsChildAlg();
// get the workspace
m_groupWS = alg->getProperty("OutputGroupingWorkspace");
} else {
IAlgorithm_sptr alg = createChildAlgorithm("LoadDetectorsGroupingFile");
alg->setProperty("InputFile", groupFilename);
alg->executeAsChildAlg();
// get the workspace
m_groupWS = alg->getProperty("OutputWorkspace");
}
// get and rename the workspace // register the workspace with the ADS
m_groupWS = alg->getProperty("OutputWorkspace");
const std::string name = m_instName + "_group"; const std::string name = m_instName + "_group";
AnalysisDataService::Instance().addOrReplace(name, m_groupWS); AnalysisDataService::Instance().addOrReplace(name, m_groupWS);
this->setPropertyValue("GroupingWorkspace", name); this->setPropertyValue("GroupingWorkspace", name);
......
...@@ -17,6 +17,7 @@ Engineering Diffraction ...@@ -17,6 +17,7 @@ Engineering Diffraction
Powder Diffraction Powder Diffraction
------------------ ------------------
- :ref:`AlignAndFocusPowder <algm-AlignAndFocusPowder>` Now supports supplying an a second ``.cal`` file for the ``GroupingFilename``.
- Bugfix in :ref:`SNAPReduce <algm-SNAPReduce>` with loading previous normalizations - Bugfix in :ref:`SNAPReduce <algm-SNAPReduce>` with loading previous normalizations
Single Crystal Diffraction Single Crystal Diffraction
......
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