diff --git a/Code/Mantid/Framework/Algorithms/src/AlignDetectors.cpp b/Code/Mantid/Framework/Algorithms/src/AlignDetectors.cpp index dbf2bb614f8adc949b3e8c55035ad1a37432a2dd..fc48aea5099443b63d8ff87b02ae539afd326274 100644 --- a/Code/Mantid/Framework/Algorithms/src/AlignDetectors.cpp +++ b/Code/Mantid/Framework/Algorithms/src/AlignDetectors.cpp @@ -236,55 +236,42 @@ std::map<std::string, std::string> AlignDetectors::validateInputs() { return result; } -bool endswith(const std::string& str, const std::string &ending) { - if (ending.size() > str.size()) { - return false; - } - - return std::equal(str.begin() + str.size() - ending.size(), - str.end(), ending.begin()); -} - void AlignDetectors::loadCalFile(MatrixWorkspace_sptr inputWS, const std::string & filename) { - IAlgorithm_sptr alg; - if (endswith(filename, ".cal")) { - // Load the .cal file - alg = createChildAlgorithm("LoadCalFile"); - alg->setPropertyValue("CalFilename", filename); - alg->setProperty("InputWorkspace", inputWS); - alg->setProperty<bool>("MakeOffsetsWorkspace", true); - } else if (endswith(filename, ".h5") || endswith(filename, ".hd5") || endswith(filename, ".hdf")) { - alg = createChildAlgorithm("LoadDiffCal"); - alg->setPropertyValue("Filename", filename); - alg->setProperty<bool>("MakeCalWorkspace", true); - } else { - std::stringstream msg; - msg << "Do not know how to load cal file: " << filename; - throw std::runtime_error(msg.str()); - } + IAlgorithm_sptr alg = createChildAlgorithm("LoadDiffCal"); + alg->setProperty("InputWorkspace", inputWS); + alg->setPropertyValue("Filename", filename); + alg->setProperty<bool>("MakeCalWorkspace", true); alg->setProperty<bool>("MakeGroupingWorkspace", false); alg->setProperty<bool>("MakeMaskWorkspace", false); alg->setPropertyValue("WorkspaceName", "temp"); alg->executeAsChildAlg(); + m_calibrationWS = alg->getProperty("OutputCalWorkspace"); } void AlignDetectors::getCalibrationWS(MatrixWorkspace_sptr inputWS) { - const std::string calFileName = getPropertyValue("CalibrationFile"); - if (!calFileName.empty()) { - progress(0.0, "Reading calibration file"); - loadCalFile(inputWS, calFileName); - } else { - m_calibrationWS = getProperty("CalibrationWorkspace"); - if (!m_calibrationWS) { - OffsetsWorkspace_sptr offsetsWS = getProperty("OffsetsWorkspace"); - auto alg = createChildAlgorithm("ConvertDiffCal"); - alg->setProperty("OffsetsWorkspace", offsetsWS); - alg->executeAsChildAlg(); - m_calibrationWS = alg->getProperty("OutputWorkspace"); - m_calibrationWS->setTitle(offsetsWS->getTitle()); - } - } + m_calibrationWS = getProperty("CalibrationWorkspace"); + if (m_calibrationWS) + return; // nothing more to do + + OffsetsWorkspace_sptr offsetsWS = getProperty("OffsetsWorkspace"); + if (offsetsWS) { + auto alg = createChildAlgorithm("ConvertDiffCal"); + alg->setProperty("OffsetsWorkspace", offsetsWS); + alg->executeAsChildAlg(); + m_calibrationWS = alg->getProperty("OutputWorkspace"); + m_calibrationWS->setTitle(offsetsWS->getTitle()); + return; + } + + const std::string calFileName = getPropertyValue("CalibrationFile"); + if (!calFileName.empty()) { + progress(0.0, "Reading calibration file"); + loadCalFile(inputWS, calFileName); + return; + } + + throw std::runtime_error("Failed to determine calibration information"); } void setXAxisUnits(API::MatrixWorkspace_sptr outputWS) { diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadCalFile.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadCalFile.h index 473d5a2a45a612366708fd4babd2b050246f0f7b..5768b9268a7da06aae3d8af34fe1b7d5f894c846 100644 --- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadCalFile.h +++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadCalFile.h @@ -43,6 +43,7 @@ public: static Geometry::Instrument_const_sptr getInstrument3Ways(API::Algorithm *alg); + static bool instrumentIsSpecified(API::Algorithm *alg); static void readCalFile(const std::string &calFileName, Mantid::DataObjects::GroupingWorkspace_sptr groupWS, diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadDiffCal.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadDiffCal.h index 3eb16c6b5588722af3d403da25044b744e659894..b87f447041e61a7922d4c7904e4ab4600691bbd9 100644 --- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadDiffCal.h +++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadDiffCal.h @@ -51,6 +51,7 @@ private: void getInstrument(H5::H5File &file); std::vector<int32_t> readInt32Array(H5::Group &group, const std::string &name); std::vector<double> readDoubleArray(H5::Group &group, const std::string &name); + void runLoadCalFile(); void makeGroupingWorkspace(const std::vector<int32_t> &detids, const std::vector<int32_t> &groups); void makeMaskWorkspace(const std::vector<int32_t> &detids, const std::vector<int32_t> &use); void makeCalWorkspace(const std::vector<int32_t> &detids, const std::vector<double> &difc, diff --git a/Code/Mantid/Framework/DataHandling/src/LoadCalFile.cpp b/Code/Mantid/Framework/DataHandling/src/LoadCalFile.cpp index 51db52d914d753debb9b4251f6e1f0224424c776..78019310c0b5e1f16e201408c40c4bb7a4fc3198 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadCalFile.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadCalFile.cpp @@ -59,6 +59,22 @@ void LoadCalFile::getInstrument3WaysInit(Algorithm *alg) { alg->setPropertyGroup("InstrumentFilename", grpName); } +bool LoadCalFile::instrumentIsSpecified(API::Algorithm *alg) { + MatrixWorkspace_sptr inWS = alg->getProperty("InputWorkspace"); + if (bool(inWS)) + return true; + + std::string InstrumentName = alg->getPropertyValue("InstrumentName"); + if (!InstrumentName.empty()) + return true; + + std::string InstrumentFilename = alg->getPropertyValue("InstrumentFilename"); + if (!InstrumentFilename.empty()) + return true; + + return false; +} + //---------------------------------------------------------------------------------------------- /** Get a pointer to an instrument in one of 3 ways: InputWorkspace, * InstrumentName, InstrumentFilename diff --git a/Code/Mantid/Framework/DataHandling/src/LoadDiffCal.cpp b/Code/Mantid/Framework/DataHandling/src/LoadDiffCal.cpp index 259be0c3e5fa3edc6ed3f69d9c63a1c2e0d10962..36db1c26b4fe7001fa5eba108f6a29d13f84a9a7 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadDiffCal.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadDiffCal.cpp @@ -4,6 +4,7 @@ #include "MantidAPI/MatrixWorkspace.h" #include "MantidAPI/Progress.h" #include "MantidAPI/TableRow.h" +#include "MantidDataHandling/LoadCalFile.h" #include "MantidDataObjects/GroupingWorkspace.h" #include "MantidDataObjects/MaskWorkspace.h" #include "MantidDataObjects/TableWorkspace.h" @@ -65,10 +66,14 @@ const std::string LoadDiffCal::summary() const { /** Initialize the algorithm's properties. */ void LoadDiffCal::init() { + // 3 properties for getting the right instrument + LoadCalFile::getInstrument3WaysInit(this); + std::vector<std::string> exts; exts.push_back(".h5"); exts.push_back(".hd5"); exts.push_back(".hdf"); + exts.push_back(".cal"); declareProperty(new FileProperty("Filename", "", FileProperty::Load, exts), "Path to the .h5 file."); @@ -133,6 +138,42 @@ std::vector<NumT> readArrayCoerce(DataSet &dataset, const DataType &desiredDataT return result; } +bool endswith(const std::string &str, const std::string &ending) { + if (ending.size() > str.size()) { + return false; + } + + return std::equal(str.begin() + str.size() - ending.size(), str.end(), + ending.begin()); +} + +void setGroupWSProperty(API::Algorithm *alg, const std::string &prefix, + GroupingWorkspace_sptr wksp) { + alg->declareProperty( + new WorkspaceProperty<DataObjects::GroupingWorkspace>( + "OutputGroupingWorkspace", prefix + "_group", Direction::Output), + "Set the the output GroupingWorkspace, if any."); + alg->setProperty("OutputGroupingWorkspace", wksp); +} + +void setMaskWSProperty(API::Algorithm *alg, const std::string &prefix, + MaskWorkspace_sptr wksp) { + alg->declareProperty( + new WorkspaceProperty<DataObjects::MaskWorkspace>( + "OutputMaskWorkspace", prefix + "_mask", Direction::Output), + "Set the the output MaskWorkspace, if any."); + alg->setProperty("OutputMaskWorkspace", wksp); +} + +void setCalWSProperty(API::Algorithm *alg, const std::string &prefix, + ITableWorkspace_sptr wksp) { + alg->declareProperty( + new WorkspaceProperty<ITableWorkspace>( + "OutputCalWorkspace", prefix + "_cal", Direction::Output), + "Set the output Diffraction Calibration workspace, if any."); + alg->setProperty("OutputCalWorkspace", wksp); +} + } // anonymous namespace std::vector<double> LoadDiffCal::readDoubleArray(Group & group, const std::string &name) { @@ -184,6 +225,11 @@ void LoadDiffCal::getInstrument(H5File &file) { bool makeGrouping = getProperty("MakeGroupingWorkspace"); if ((!makeMask) & (!makeGrouping)) return; + // see if the user specified the instrument independently + if (LoadCalFile::instrumentIsSpecified(this)) { + m_instrument = LoadCalFile::getInstrument3Ways(this); + return; + } std::string idf = readString(file, "/calibration/instrument/instrument_source"); std::string instrumentName = readString(file, "/calibration/instrument/name"); @@ -230,11 +276,7 @@ void LoadDiffCal::makeGroupingWorkspace(const std::vector<int32_t> &detids, cons progress.report(); } - declareProperty(new WorkspaceProperty<DataObjects::GroupingWorkspace>( - "OutputGroupingWorkspace", m_workspaceName + "_group", - Direction::Output), - "Set the the output GroupingWorkspace, if any."); - setProperty("OutputGroupingWorkspace", wksp); + setGroupWSProperty(this, m_workspaceName, wksp); } void LoadDiffCal::makeMaskWorkspace(const std::vector<int32_t> &detids, const std::vector<int32_t> &use) { @@ -261,11 +303,7 @@ void LoadDiffCal::makeMaskWorkspace(const std::vector<int32_t> &detids, const st progress.report(); } - declareProperty( - new WorkspaceProperty<DataObjects::MaskWorkspace>( - "OutputMaskWorkspace", m_workspaceName + "_mask", Direction::Output), - "Set the the output MaskWorkspace, if any."); - setProperty("OutputMaskWorkspace", wksp); + setMaskWSProperty(this, m_workspaceName, wksp); } void LoadDiffCal::makeCalWorkspace(const std::vector<int32_t> &detids, const std::vector<double> &difc, @@ -306,11 +344,42 @@ void LoadDiffCal::makeCalWorkspace(const std::vector<int32_t> &detids, const std progress.report(); } - declareProperty( - new WorkspaceProperty<ITableWorkspace>( - "OutputCalWorkspace", m_workspaceName + "_cal", Direction::Output), - "Set the output Diffraction Calibration workspace, if any."); - setProperty("OutputCalWorkspace", wksp); + setCalWSProperty(this, m_workspaceName, wksp); +} + +void LoadDiffCal::runLoadCalFile() { + bool makeCalWS = getProperty("MakeCalWorkspace"); + bool makeMaskWS = getProperty("MakeMaskWorkspace"); + bool makeGroupWS = getProperty("MakeGroupingWorkspace"); + + auto alg = createChildAlgorithm("LoadCalFile", 0., 1.); + alg->setPropertyValue("CalFilename", m_filename); + alg->setPropertyValue("InputWorkspace", getPropertyValue("InputWorkspace")); + alg->setPropertyValue("InstrumentName", getPropertyValue("InstrumentName")); + alg->setPropertyValue("InstrumentFilename", + getPropertyValue("InstrumentFilename")); + alg->setProperty<bool>("MakeOffsetsWorkspace", makeCalWS); + alg->setProperty<bool>("MakeGroupingWorkspace", makeMaskWS); + alg->setProperty<bool>("MakeMaskWorkspace", makeGroupWS); + alg->setPropertyValue("WorkspaceName", m_workspaceName); + alg->executeAsChildAlg(); + + if (makeCalWS) { + ITableWorkspace_sptr wksp = alg->getProperty("OutputCalWorkspace"); + setCalWSProperty(this, m_workspaceName, wksp); + } + + if (makeMaskWS) { + MatrixWorkspace_sptr wksp = alg->getProperty("OutputMaskWorkspace"); + setMaskWSProperty( + this, m_workspaceName, + boost::dynamic_pointer_cast<DataObjects::MaskWorkspace>(wksp)); + } + + if (makeGroupWS) { + GroupingWorkspace_sptr wksp = alg->getProperty("OutputGroupingWorkspace"); + setGroupWSProperty(this, m_workspaceName, wksp); + } } //---------------------------------------------------------------------------------------------- @@ -320,6 +389,11 @@ void LoadDiffCal::exec() { m_filename = getPropertyValue("Filename"); m_workspaceName = getPropertyValue("WorkspaceName"); + if (endswith(m_filename, ".cal")) { + runLoadCalFile(); + return; + } + // read in everything from the file H5File file(m_filename, H5F_ACC_RDONLY); H5::Exception::dontPrint(); diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/SNSPowderReduction.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/SNSPowderReduction.py index 258cb9a7ef33b6a59fee536555484829260de959..dff1ce6410cdea96bf51872796008f2502e727f9 100644 --- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/SNSPowderReduction.py +++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/SNSPowderReduction.py @@ -83,7 +83,7 @@ class SNSPowderReduction(DataProcessorAlgorithm): self.declareProperty("VanadiumBackgroundNumber", defaultValue=0, validator=IntBoundedValidator(lower=-1), doc="If specified overrides value in CharacterizationRunsFile. If -1 turns off correction.") self.declareProperty(FileProperty(name="CalibrationFile",defaultValue="",action=FileAction.Load,\ - extensions = ["cal"])) + extensions = [".h5", ".hd5", ".hdf", ".cal"])) self.declareProperty(FileProperty(name="CharacterizationRunsFile",defaultValue="",action=FileAction.OptionalLoad,\ extensions = ["txt"]),"File with characterization runs denoted") self.declareProperty("UnwrapRef", 0., diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/AlignAndFocusPowder.h b/Code/Mantid/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/AlignAndFocusPowder.h index bb54c406bd171fe72dba7eff64808c93bc60c188..996726c698075a1bda1c5813a6fc5590df1c1b5e 100644 --- a/Code/Mantid/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/AlignAndFocusPowder.h +++ b/Code/Mantid/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/AlignAndFocusPowder.h @@ -103,7 +103,7 @@ private: std::vector<specid_t> specids, std::vector<double> l2s, std::vector<double> phis); - + void convertOffsetsToCal(DataObjects::OffsetsWorkspace_sptr &offsetsWS); double getVecPropertyFromPmOrSelf(const std::string &name, std::vector<double> &avec); @@ -112,8 +112,8 @@ private: API::MatrixWorkspace_sptr m_outputW; DataObjects::EventWorkspace_sptr m_inputEW; DataObjects::EventWorkspace_sptr m_outputEW; - DataObjects::OffsetsWorkspace_sptr m_offsetsWS; - API::MatrixWorkspace_sptr m_maskWS; + API::ITableWorkspace_sptr m_calibrationWS; + DataObjects::MaskWorkspace_sptr m_maskWS; DataObjects::GroupingWorkspace_sptr m_groupWS; double m_l1; std::vector<int32_t> specids; diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/AlignAndFocusPowder.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/AlignAndFocusPowder.cpp index 938a744746401eb0b948ee58a896beed65671b87..02feddb23dc59d7acb86e8629b31cc030b462bb9 100644 --- a/Code/Mantid/Framework/WorkflowAlgorithms/src/AlignAndFocusPowder.cpp +++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/AlignAndFocusPowder.cpp @@ -71,21 +71,32 @@ void AlignAndFocusPowder::init() { // Direction::Output, PropertyMode::Optional), // "The name of the workspace containing the filtered low resolution TOF // data."); + std::vector<std::string> exts; + exts.push_back(".h5"); + exts.push_back(".hd5"); + exts.push_back(".hdf"); + exts.push_back(".cal"); declareProperty( - new FileProperty("CalFileName", "", FileProperty::OptionalLoad, ".cal"), + new FileProperty("CalFileName", "", FileProperty::OptionalLoad, exts), "The name of the CalFile with offset, masking, and grouping data"); declareProperty( new WorkspaceProperty<GroupingWorkspace>( "GroupingWorkspace", "", Direction::Input, PropertyMode::Optional), "Optional: A GroupingWorkspace giving the grouping info."); + + declareProperty( + new WorkspaceProperty<ITableWorkspace>( + "CalibrationWorkspace", "", Direction::Input, PropertyMode::Optional), + "Optional: A Workspace containing the calibration information. Either " + "this or CalibrationFile needs to be specified."); declareProperty( new WorkspaceProperty<OffsetsWorkspace>( "OffsetsWorkspace", "", Direction::Input, PropertyMode::Optional), "Optional: An OffsetsWorkspace giving the detector calibration values."); - declareProperty( - new WorkspaceProperty<MatrixWorkspace>( - "MaskWorkspace", "", Direction::Input, PropertyMode::Optional), - "Optional: A workspace giving which detectors are masked."); + declareProperty(new WorkspaceProperty<MaskWorkspace>("MaskWorkspace", "", + Direction::Input, + PropertyMode::Optional), + "Optional: A workspace giving which detectors are masked."); declareProperty(new WorkspaceProperty<TableWorkspace>("MaskBinTable", "", Direction::Input, PropertyMode::Optional), @@ -223,7 +234,7 @@ void AlignAndFocusPowder::exec() { m_instName = Kernel::ConfigService::Instance().getInstrument(m_instName).shortName(); std::string calFileName = getPropertyValue("CalFileName"); - m_offsetsWS = getProperty("OffsetsWorkspace"); + m_calibrationWS = getProperty("CalibrationWorkspace"); m_maskWS = getProperty("MaskWorkspace"); m_groupWS = getProperty("GroupingWorkspace"); DataObjects::TableWorkspace_sptr maskBinTableWS = getProperty("MaskBinTable"); @@ -439,12 +450,12 @@ void AlignAndFocusPowder::exec() { m_outputW = rebin(m_outputW); m_progress->report(); - if (m_offsetsWS) { + if (m_calibrationWS) { g_log.information() << "running AlignDetectors\n"; API::IAlgorithm_sptr alignAlg = createChildAlgorithm("AlignDetectors"); alignAlg->setProperty("InputWorkspace", m_outputW); alignAlg->setProperty("OutputWorkspace", m_outputW); - alignAlg->setProperty("OffsetsWorkspace", m_offsetsWS); + alignAlg->setProperty("CalibrationWorkspace", m_calibrationWS); alignAlg->executeAsChildAlg(); m_outputW = alignAlg->getProperty("OutputWorkspace"); } else { @@ -832,6 +843,21 @@ AlignAndFocusPowder::conjoinWorkspaces(API::MatrixWorkspace_sptr ws1, return outws; } +void AlignAndFocusPowder::convertOffsetsToCal( + DataObjects::OffsetsWorkspace_sptr &offsetsWS) { + if (!offsetsWS) + return; + + IAlgorithm_sptr alg = createChildAlgorithm("ConvertDiffCal"); + alg->setProperty("OffsetsWorkspace", offsetsWS); + alg->setPropertyValue("OutputWorkspace", m_instName + "_cal"); + alg->executeAsChildAlg(); + + m_calibrationWS = alg->getProperty("OutputWorkspace"); + AnalysisDataService::Instance().addOrReplace(m_instName + "_cal", + m_calibrationWS); +} + //---------------------------------------------------------------------------------------------- /** * Loads the .cal file if necessary. @@ -848,18 +874,33 @@ void AlignAndFocusPowder::loadCalFile(const std::string &calFileName) { ; // not noteworthy } } - if ((!m_offsetsWS) && (!calFileName.empty())) { - try { - m_offsetsWS = - AnalysisDataService::Instance().retrieveWS<OffsetsWorkspace>( - m_instName + "_offsets"); - } catch (Exception::NotFoundError &) { - ; // not noteworthy + if ((!m_calibrationWS) && (!calFileName.empty())) { + OffsetsWorkspace_sptr offsetsWS = getProperty("OffsetsWorkspace"); + if (offsetsWS) { + convertOffsetsToCal(offsetsWS); + } else { + try { + m_calibrationWS = + AnalysisDataService::Instance().retrieveWS<ITableWorkspace>( + m_instName + "_cal"); + } catch (Exception::NotFoundError &) { + ; // not noteworthy + } + if (!m_calibrationWS) { + try { + OffsetsWorkspace_sptr offsetsWS = + AnalysisDataService::Instance().retrieveWS<OffsetsWorkspace>( + m_instName + "_offsets"); + convertOffsetsToCal(offsetsWS); + } catch (Exception::NotFoundError &) { + ; // not noteworthy + } + } } } if ((!m_maskWS) && (!calFileName.empty())) { try { - m_maskWS = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>( + m_maskWS = AnalysisDataService::Instance().retrieveWS<MaskWorkspace>( m_instName + "_mask"); } catch (Exception::NotFoundError &) { ; // not noteworthy @@ -867,7 +908,7 @@ void AlignAndFocusPowder::loadCalFile(const std::string &calFileName) { } // see if everything exists to exit early - if (m_groupWS && m_offsetsWS && m_maskWS) + if (m_groupWS && m_calibrationWS && m_maskWS) return; // see if the calfile is specified @@ -878,18 +919,16 @@ void AlignAndFocusPowder::loadCalFile(const std::string &calFileName) { // bunch of booleans to keep track of things bool loadGrouping = !m_groupWS; - bool loadOffsets = !m_offsetsWS; + bool loadCalibration = !m_calibrationWS; bool loadMask = !m_maskWS; - // Load the .cal file - IAlgorithm_sptr alg = createChildAlgorithm("LoadCalFile"); - alg->setPropertyValue("CalFilename", calFileName); + IAlgorithm_sptr alg = createChildAlgorithm("LoadDiffCal"); alg->setProperty("InputWorkspace", m_inputW); - alg->setProperty<std::string>("WorkspaceName", m_instName); - alg->setProperty("MakeGroupingWorkspace", loadGrouping); - alg->setProperty("MakeOffsetsWorkspace", loadOffsets); - alg->setProperty("MakeMaskWorkspace", loadMask); - alg->setLogging(true); + alg->setPropertyValue("Filename", calFileName); + alg->setProperty<bool>("MakeCalWorkspace", loadCalibration); + alg->setProperty<bool>("MakeGroupingWorkspace", loadGrouping); + alg->setProperty<bool>("MakeMaskWorkspace", loadMask); + alg->setPropertyValue("WorkspaceName", m_instName); alg->executeAsChildAlg(); // replace workspaces as appropriate @@ -898,10 +937,10 @@ void AlignAndFocusPowder::loadCalFile(const std::string &calFileName) { AnalysisDataService::Instance().addOrReplace(m_instName + "_group", m_groupWS); } - if (loadOffsets) { - m_offsetsWS = alg->getProperty("OutputOffsetsWorkspace"); - AnalysisDataService::Instance().addOrReplace(m_instName + "_offsets", - m_offsetsWS); + if (loadCalibration) { + m_calibrationWS = alg->getProperty("OutputCalWorkspace"); + AnalysisDataService::Instance().addOrReplace(m_instName + "_cal", + m_calibrationWS); } if (loadMask) { m_maskWS = alg->getProperty("OutputMaskWorkspace");