Skip to content
Snippets Groups Projects
Commit 4c827da2 authored by McDonnell, Marshall's avatar McDonnell, Marshall
Browse files

Fixes and unit tests for AlignAndFocusPowder Refs #23888

parent 59cd2739
No related branches found
No related tags found
No related merge requests found
...@@ -86,6 +86,7 @@ set ( INC_FILES ...@@ -86,6 +86,7 @@ set ( INC_FILES
) )
set ( TEST_FILES set ( TEST_FILES
AlignAndFocusPowderTest.h
ExtractQENSMembersTest.h ExtractQENSMembersTest.h
IMuonAsymmetryCalculatorTest.h IMuonAsymmetryCalculatorTest.h
LoadEventAndCompressTest.h LoadEventAndCompressTest.h
......
...@@ -271,8 +271,12 @@ void AlignAndFocusPowder::exec() { ...@@ -271,8 +271,12 @@ void AlignAndFocusPowder::exec() {
m_inputW = getProperty("InputWorkspace"); m_inputW = getProperty("InputWorkspace");
m_inputEW = boost::dynamic_pointer_cast<EventWorkspace>(m_inputW); m_inputEW = boost::dynamic_pointer_cast<EventWorkspace>(m_inputW);
m_instName = m_inputW->getInstrument()->getName(); m_instName = m_inputW->getInstrument()->getName();
m_instName = try {
Kernel::ConfigService::Instance().getInstrument(m_instName).shortName(); m_instName =
Kernel::ConfigService::Instance().getInstrument(m_instName).shortName();
} catch (Exception::NotFoundError &) {
; // not noteworthy
}
std::string calFilename = getPropertyValue("CalFileName"); std::string calFilename = getPropertyValue("CalFileName");
std::string groupFilename = getPropertyValue("GroupFilename"); std::string groupFilename = getPropertyValue("GroupFilename");
m_calibrationWS = getProperty("CalibrationWorkspace"); m_calibrationWS = getProperty("CalibrationWorkspace");
...@@ -379,7 +383,7 @@ void AlignAndFocusPowder::exec() { ...@@ -379,7 +383,7 @@ void AlignAndFocusPowder::exec() {
} else { } else {
// workspace2D // workspace2D
if (m_outputW != m_inputW) { if (m_outputW != m_inputW) {
m_outputW = WorkspaceFactory::Instance().create(m_inputW); m_outputW = m_inputW->clone();
} }
} }
...@@ -720,7 +724,6 @@ void AlignAndFocusPowder::exec() { ...@@ -720,7 +724,6 @@ void AlignAndFocusPowder::exec() {
API::IAlgorithm_sptr compressAlg = createChildAlgorithm("CompressEvents"); API::IAlgorithm_sptr compressAlg = createChildAlgorithm("CompressEvents");
compressAlg->setProperty("InputWorkspace", m_outputEW); compressAlg->setProperty("InputWorkspace", m_outputEW);
compressAlg->setProperty("OutputWorkspace", m_outputEW); compressAlg->setProperty("OutputWorkspace", m_outputEW);
compressAlg->setProperty("OutputWorkspace", m_outputEW);
compressAlg->setProperty("Tolerance", tolerance); compressAlg->setProperty("Tolerance", tolerance);
if (!isEmpty(wallClockTolerance)) { if (!isEmpty(wallClockTolerance)) {
compressAlg->setProperty("WallClockTolerance", wallClockTolerance); compressAlg->setProperty("WallClockTolerance", wallClockTolerance);
...@@ -776,6 +779,13 @@ AlignAndFocusPowder::diffractionFocus(API::MatrixWorkspace_sptr ws) { ...@@ -776,6 +779,13 @@ AlignAndFocusPowder::diffractionFocus(API::MatrixWorkspace_sptr ws) {
return ws; return ws;
} }
if (m_maskWS) {
API::IAlgorithm_sptr maskAlg = createChildAlgorithm("MaskDetectors");
maskAlg->setProperty("Workspace", m_groupWS);
maskAlg->setProperty("MaskedWorkspace", m_maskWS);
maskAlg->executeAsChildAlg();
}
g_log.information() << "running DiffractionFocussing started at " g_log.information() << "running DiffractionFocussing started at "
<< Types::Core::DateAndTime::getCurrentTime() << "\n"; << Types::Core::DateAndTime::getCurrentTime() << "\n";
......
This diff is collapsed.
...@@ -105,6 +105,7 @@ Bugfixes ...@@ -105,6 +105,7 @@ Bugfixes
- Fixed a bug in `AlignAndFocusPowderFromFiles <algm-AlignAndFocusPowderFromFiles>` for using the passed on CompressTolerance and CompressWallClockTolerance in the child `CompressEvents <algm-CompressEvents>` algorithm instead of just in the child `AlignAndFocusPowder <algm-AlignAndFocusPowder>` algorithm. - Fixed a bug in `AlignAndFocusPowderFromFiles <algm-AlignAndFocusPowderFromFiles>` for using the passed on CompressTolerance and CompressWallClockTolerance in the child `CompressEvents <algm-CompressEvents>` algorithm instead of just in the child `AlignAndFocusPowder <algm-AlignAndFocusPowder>` algorithm.
- `ConvertToMD <algm-ConvertToMD>` now uses the time-average value for logs when using them as ``OtherDimensions`` - `ConvertToMD <algm-ConvertToMD>` now uses the time-average value for logs when using them as ``OtherDimensions``
- The input validator is fixed in :ref:`MostLikelyMean <algm-MostLikelyMean>` avoiding a segmentation fault. - The input validator is fixed in :ref:`MostLikelyMean <algm-MostLikelyMean>` avoiding a segmentation fault.
- Fixed a bug in `AlignAndFocusPowder <algm-AlignAndFocusPowder>` where a histogram input workspace did not clone propertly to the output workspace and properly masking a grouping workspace passed to `DiffractionFocussing <algm-DiffractionFocussing>`. Also adds initial unit tests for `AlignAndFocusPowder <algm-AlignAndFocusPowder>`.
Python Python
------ ------
......
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