|
Mantid
|
Data processor algorithm to be used as a parent to workflow algorithms. More...
#include <DataProcessorAlgorithm.h>
Public Member Functions | |
| GenericDataProcessorAlgorithm () | |
| Constructor. | |
| Kernel::IPropertyManager::TypedValue | getProperty (const std::string &name) const override |
| Get the property held by this object. | |
| std::string | getPropertyValue (const std::string &name) const override |
| Get the property held by this object. | |
Protected Member Functions | |
| void | copyProperty (const API::Algorithm_sptr &alg, const std::string &name) |
| Copy a property from an existing algorithm. | |
| std::shared_ptr< Algorithm > | createChildAlgorithm (const std::string &name, const double startProgress=-1., const double endProgress=-1., const bool enableLogging=true, const int &version=-1) override |
| Create a Child Algorithm. | |
| virtual ITableWorkspace_sptr | determineChunk (const std::string &filename) |
| MatrixWorkspace_sptr | divide (const MatrixWorkspace_sptr lhs, const double &rhsValue) |
| Divide a matrix workspace by a single value. | |
| MatrixWorkspace_sptr | divide (const MatrixWorkspace_sptr lhs, const MatrixWorkspace_sptr rhs) |
| Divide a matrix workspace by another matrix workspace. | |
| void | forwardProperties () |
| std::shared_ptr< Kernel::PropertyManager > | getProcessProperties (const std::string &propertyManager=std::string()) const |
| Get the property manager object of a given name from the property manager data service, or create a new one. | |
| Workspace_sptr | load (const std::string &inputData, const bool loadQuiet=false) |
| Determine what kind of input data we have and load it. | |
| virtual MatrixWorkspace_sptr | loadChunk (const size_t rowIndex) |
| void | mapPropertyName (const std::string &nameInProp, const std::string &nameInPropManager) |
| Declare mapping of property name to name in the PropertyManager. | |
| MatrixWorkspace_sptr | minus (const MatrixWorkspace_sptr lhs, const double &rhsValue) |
| Subract a single value from a matrix workspace. | |
| MatrixWorkspace_sptr | minus (const MatrixWorkspace_sptr lhs, const MatrixWorkspace_sptr rhs) |
| Subract a matrix workspace by another matrix workspace. | |
| MatrixWorkspace_sptr | multiply (const MatrixWorkspace_sptr lhs, const double &rhsValue) |
| Multiply a matrix workspace by a single value. | |
| MatrixWorkspace_sptr | multiply (const MatrixWorkspace_sptr lhs, const MatrixWorkspace_sptr rhs) |
| Multiply a matrix workspace by another matrix workspace. | |
| MatrixWorkspace_sptr | plus (const MatrixWorkspace_sptr lhs, const double &rhsValue) |
| Add a single value to a matrix workspace. | |
| MatrixWorkspace_sptr | plus (const MatrixWorkspace_sptr lhs, const MatrixWorkspace_sptr rhs) |
| Add a matrix workspace to another matrix workspace. | |
| void | saveNexus (const std::string &outputWSName, const std::string &outputFile) |
| Save a workspace as a nexus file, with check for which thread we are executing in. | |
| void | setAccumAlg (const std::string &alg) |
| void | setLoadAlg (const std::string &alg) |
| void | setLoadAlgFileProp (const std::string &filePropName) |
| void | setPropManagerPropName (const std::string &propName) |
| std::vector< std::string > | splitInput (const std::string &input) |
Private Member Functions | |
| MatrixWorkspace_sptr | createWorkspaceSingleValue (const double &rhsValue) |
| Create a matrix workspace from a single number. | |
| template<typename LHSType , typename RHSType , typename ResultType > | |
| ResultType | executeBinaryAlgorithm (const std::string &algorithmName, const LHSType lhs, const RHSType rhs) |
| void | visualStudioC4661Workaround () |
| MANTID_API_DLL void | visualStudioC4661Workaround () |
| MANTID_API_DLL void | visualStudioC4661Workaround () |
Private Attributes | |
| std::string | m_accumulateAlg |
| The name of the algorithm to invoke when accumulating data chunks. | |
| std::string | m_loadAlg |
| The name of the algorithm to invoke when loading data. | |
| std::string | m_loadAlgFileProp |
| An alternate filename property for the load algorithm. | |
| std::map< std::string, std::string > | m_nameToPMName |
| Map property names to names in supplied properties manager. | |
| std::string | m_propertyManagerPropertyName |
| The name of the parameter that names the property manager. | |
Data processor algorithm to be used as a parent to workflow algorithms.
This algorithm provides utility methods to load and process data.
Definition at line 26 of file DataProcessorAlgorithm.h.
| Mantid::API::GenericDataProcessorAlgorithm< Base >::GenericDataProcessorAlgorithm | ( | ) |
Constructor.
Definition at line 32 of file DataProcessorAlgorithm.cpp.
|
protected |
Copy a property from an existing algorithm.
| alg | |
| name |
| std::runtime_error | If you ask to copy a non-existent property |
Definition at line 123 of file DataProcessorAlgorithm.cpp.
References name.
Referenced by Mantid::PythonInterface::DataProcessorAdapter< Base >::copyPropertiesProxy(), Mantid::Algorithms::CarpenterSampleCorrection::init(), Mantid::MDAlgorithms::LoadGaussCube::init(), and Mantid::WorkflowAlgorithms::LoadEventAndCompress::init().
|
overrideprotected |
Create a Child Algorithm.
A call to this method creates a child algorithm object. Using this mechanism instead of creating daughter algorithms directly via the new operator is prefered since then the framework can take care of all of the necessary book-keeping.
Overrides the method of the same name in Algorithm to enable history tracking by default.
| name | :: The concrete algorithm class of the Child Algorithm |
| startProgress | :: The percentage progress value of the overall algorithm where this child algorithm starts |
| endProgress | :: The percentage progress value of the overall algorithm where this child algorithm ends |
| enableLogging | :: Set to false to disable logging from the child algorithm |
| version | :: The version of the child algorithm to create. By default gives the latest version. |
Definition at line 61 of file DataProcessorAlgorithm.cpp.
References Mantid::API::Algorithm::createChildAlgorithm(), and name.
Referenced by Mantid::CurveFitting::Algorithms::QENSFitSequential::addAdditionalLogs(), Mantid::CurveFitting::Algorithms::QENSFitSequential::addFitRangeLogs(), Mantid::MDAlgorithms::CreateMD::addSampleLog(), Mantid::Algorithms::ExtractQENSMembers::appendSpectra(), Mantid::WorkflowAlgorithms::MuonProcess::applyDTC(), Mantid::Algorithms::CarpenterSampleCorrection::calculateCorrection(), Mantid::WorkflowAlgorithms::AlignAndFocusPowder::compressEventsOutputWS(), Mantid::WorkflowAlgorithms::AlignAndFocusPowder::conjoinWorkspaces(), Mantid::WorkflowAlgorithms::AlignAndFocusPowder::convertOffsetsToCal(), Mantid::WorkflowAlgorithms::SofTwoThetaTOF::convertToConstantL2(), Mantid::MDAlgorithms::CreateMD::convertToMD(), Mantid::WorkflowAlgorithms::SofTwoThetaTOF::convertToTwoTheta(), Mantid::WorkflowAlgorithms::AlignAndFocusPowder::convertUnits(), Mantid::CurveFitting::Algorithms::QENSFitSequential::copyLogs(), Mantid::CurveFitting::Algorithms::QENSFitSequential::copyLogs(), Mantid::WorkflowAlgorithms::MuonProcess::correctWorkspace(), Mantid::MDAlgorithms::AccumulateMD::createMDWorkspace(), Mantid::CurveFitting::Algorithms::QENSFitSequential::deleteTemporaryWorkspaces(), Mantid::Algorithms::CalculateCarpenterSampleCorrection::deleteWorkspace(), Mantid::WorkflowAlgorithms::LoadEventAndCompress::determineChunk(), Mantid::WorkflowAlgorithms::AlignAndFocusPowder::diffractionFocus(), Mantid::WorkflowAlgorithms::AlignAndFocusPowder::diffractionFocusRaggedRebinInDspace(), Mantid::WorkflowAlgorithms::AlignAndFocusPowder::editInstrument(), Mantid::Algorithms::PerformIndexOperations::exec(), Mantid::Algorithms::SofQW::exec(), Mantid::Algorithms::StripVanadiumPeaks2::exec(), Mantid::MDAlgorithms::AccumulateMD::exec(), Mantid::MDAlgorithms::CutMD::exec(), Mantid::MDAlgorithms::IntegrateEllipsoids::exec(), Mantid::WorkflowAlgorithms::AlignAndFocusPowder::exec(), Mantid::WorkflowAlgorithms::ComputeSensitivity::exec(), Mantid::WorkflowAlgorithms::DgsReduction::exec(), Mantid::WorkflowAlgorithms::LoadEventAndCompress::exec(), Mantid::WorkflowAlgorithms::SANSBeamFluxCorrection::exec(), Mantid::Algorithms::ExtractQENSMembers::extractSpectrum(), Mantid::WorkflowAlgorithms::AlignAndFocusPowder::filterResonances(), Mantid::Algorithms::ExtractQENSMembers::getQValues(), Mantid::WorkflowAlgorithms::SofTwoThetaTOF::groupByTwoTheta(), Mantid::WorkflowAlgorithms::MuonProcess::groupWorkspaces(), Mantid::Algorithms::ExtractQENSMembers::groupWorkspaces(), Mantid::WorkflowAlgorithms::AlignAndFocusPowder::loadCalFile(), Mantid::WorkflowAlgorithms::LoadEventAndCompress::loadChunk(), Mantid::WorkflowAlgorithms::DgsReduction::loadGroupingFile(), Mantid::WorkflowAlgorithms::DgsReduction::loadHardMask(), Mantid::WorkflowAlgorithms::DgsReduction::loadInputData(), Mantid::WorkflowAlgorithms::SANSBeamFluxCorrection::loadReference(), Mantid::MDAlgorithms::CreateMD::loadWs(), Mantid::WorkflowAlgorithms::SofTwoThetaTOF::maskEmptyBins(), Mantid::MDAlgorithms::CreateMD::merge_runs(), Mantid::Algorithms::CarpenterSampleCorrection::minus(), Mantid::Algorithms::CarpenterSampleCorrection::multiply(), Mantid::CurveFitting::Algorithms::QENSFitSequential::performFit(), Mantid::CurveFitting::Algorithms::QENSFitSequential::processIndirectFitParameters(), Mantid::WorkflowAlgorithms::AlignAndFocusPowder::rebin(), Mantid::WorkflowAlgorithms::AlignAndFocusPowder::rebinRagged(), Mantid::WorkflowAlgorithms::SofTwoThetaTOF::rebinToNonRagged(), Mantid::CurveFitting::Algorithms::QENSFitSequential::renameWorkspaces(), Mantid::CurveFitting::Algorithms::QENSFitSequential::renameWorkspaces(), Mantid::MDAlgorithms::CreateMD::setGoniometer(), Mantid::MDAlgorithms::CreateMD::setUB(), and Mantid::Algorithms::CalculateCarpenterSampleCorrection::setUncertainties().
|
private |
Create a matrix workspace from a single number.
Create a workspace that contains just a single Y value.
| rhsValue | :: the value to convert to a single value matrix workspace |
Definition at line 421 of file DataProcessorAlgorithm.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance().
|
protectedvirtual |
Reimplemented in Mantid::WorkflowAlgorithms::LoadEventAndCompress.
Definition at line 189 of file DataProcessorAlgorithm.cpp.
References UNUSED_ARG.
Referenced by Mantid::PythonInterface::DataProcessorAdapter< Base >::determineChunkProxy().
|
protected |
Divide a matrix workspace by a single value.
| lhs | :: the workspace on the left hand side of the divide symbol |
| rhsValue | :: the value on the right hand side of the divide symbol |
Definition at line 327 of file DataProcessorAlgorithm.cpp.
References Mantid::API::createWorkspaceSingleValue().
|
protected |
Divide a matrix workspace by another matrix workspace.
| lhs | :: the workspace on the left hand side of the divide symbol |
| rhs | :: the workspace on the right hand side of the divide symbol |
Definition at line 314 of file DataProcessorAlgorithm.cpp.
References rhs.
Referenced by Mantid::WorkflowAlgorithms::DgsReduction::exec().
|
inlineprivate |
Definition at line 73 of file DataProcessorAlgorithm.h.
References rhs.
|
protected |
Definition at line 299 of file DataProcessorAlgorithm.cpp.
Referenced by Mantid::PythonInterface::DataProcessorAdapter< Base >::forwardPropertiesProxy().
|
protected |
Get the property manager object of a given name from the property manager data service, or create a new one.
If the PropertyManager name is missing (default) this will look at m_propertyManagerPropertyName to get the correct value;
| propertyManager | :: Name of the property manager to retrieve. |
Definition at line 271 of file DataProcessorAlgorithm.cpp.
Referenced by Mantid::WorkflowAlgorithms::ComputeSensitivity::exec(), Mantid::WorkflowAlgorithms::SANSBeamFluxCorrection::exec(), and Mantid::PythonInterface::DataProcessorAdapter< Base >::getProcessPropertiesProxy().
|
override |
Get the property held by this object.
If the value is the default see if it contained in the PropertyManager.
| name |
Definition at line 169 of file DataProcessorAlgorithm.cpp.
References Mantid::API::Algorithm::getProperty(), and name.
Referenced by Mantid::CurveFitting::Algorithms::QENSFitSequential::addFitRangeLogs(), Mantid::WorkflowAlgorithms::SofTwoThetaTOF::clarifyAngleStep(), Mantid::WorkflowAlgorithms::MuonProcess::correctWorkspace(), Mantid::WorkflowAlgorithms::LoadEventAndCompress::determineChunk(), Mantid::Algorithms::CalculateCarpenterSampleCorrection::exec(), Mantid::Algorithms::CarpenterSampleCorrection::exec(), Mantid::Algorithms::PerformIndexOperations::exec(), Mantid::Algorithms::SofQW::exec(), Mantid::Algorithms::StripVanadiumPeaks2::exec(), Mantid::CurveFitting::Algorithms::QENSFitSequential::exec(), Mantid::MDAlgorithms::AccumulateMD::exec(), Mantid::MDAlgorithms::CreateMD::exec(), Mantid::MDAlgorithms::CutMD::exec(), Mantid::MDAlgorithms::IntegrateEllipsoids::exec(), Mantid::MDAlgorithms::LoadGaussCube::exec(), Mantid::WorkflowAlgorithms::AlignAndFocusPowder::exec(), Mantid::WorkflowAlgorithms::DgsReduction::exec(), Mantid::Algorithms::ExtractQENSMembers::exec(), Mantid::WorkflowAlgorithms::LoadEventAndCompress::exec(), Mantid::WorkflowAlgorithms::MuonProcess::exec(), Mantid::WorkflowAlgorithms::SANSBeamFluxCorrection::exec(), Mantid::WorkflowAlgorithms::SofTwoThetaTOF::exec(), Mantid::CurveFitting::Algorithms::QENSFitSequential::extractMembersAlgorithm(), Mantid::CurveFitting::Algorithms::QENSFitSequential::getAdditionalLogStrings(), Mantid::CurveFitting::Algorithms::QENSFitSequential::getDatasetGrouping(), Mantid::CurveFitting::Algorithms::QENSFitSequential::getInputString(), Mantid::Algorithms::ExtractQENSMembers::getInputWorkspaces(), Mantid::WorkflowAlgorithms::DgsReduction::getParameter(), Mantid::CurveFitting::Algorithms::QENSFitSequential::getUniqueParameterNames(), Mantid::WorkflowAlgorithms::AlignAndFocusPowder::getVecPropertyFromPmOrSelf(), Mantid::CurveFitting::Algorithms::QENSFitSequential::getWorkspaces(), Mantid::WorkflowAlgorithms::SofTwoThetaTOF::groupByTwoTheta(), Mantid::WorkflowAlgorithms::AlignAndFocusPowder::loadCalFile(), Mantid::WorkflowAlgorithms::LoadEventAndCompress::loadChunk(), Mantid::WorkflowAlgorithms::DgsReduction::loadGroupingFile(), Mantid::WorkflowAlgorithms::DgsReduction::loadHardMask(), Mantid::WorkflowAlgorithms::DgsReduction::loadInputData(), Mantid::CurveFitting::Algorithms::QENSFitSequential::performFit(), Mantid::CurveFitting::Algorithms::QENSFitSequential::processIndirectFitParameters(), Mantid::CurveFitting::Algorithms::QENSFitSequential::validateInputs(), Mantid::MDAlgorithms::AccumulateMD::validateInputs(), Mantid::MDAlgorithms::CreateMD::validateInputs(), Mantid::MDAlgorithms::LoadGaussCube::validateInputs(), Mantid::WorkflowAlgorithms::AlignAndFocusPowder::validateInputs(), Mantid::Algorithms::ExtractQENSMembers::validateInputs(), and Mantid::WorkflowAlgorithms::MuonProcess::validateInputs().
|
override |
Get the property held by this object.
If the value is the default see if it is contained in the PropertyManager.
| name |
Definition at line 142 of file DataProcessorAlgorithm.cpp.
References Mantid::API::Algorithm::getPropertyValue(), and name.
Referenced by Mantid::WorkflowAlgorithms::AlignAndFocusPowder::compressEventsOutputWS(), Mantid::MDAlgorithms::AccumulateMD::createMDWorkspace(), Mantid::Algorithms::CalculateCarpenterSampleCorrection::exec(), Mantid::CurveFitting::Algorithms::QENSFitSequential::exec(), Mantid::MDAlgorithms::LoadGaussCube::exec(), Mantid::WorkflowAlgorithms::AlignAndFocusPowder::exec(), Mantid::WorkflowAlgorithms::ComputeSensitivity::exec(), Mantid::WorkflowAlgorithms::DgsReduction::exec(), Mantid::WorkflowAlgorithms::LoadEventAndCompress::exec(), Mantid::WorkflowAlgorithms::AlignAndFocusPowder::filterResonances(), Mantid::CurveFitting::Algorithms::QENSFitSequential::getAdditionalLogStrings(), Mantid::CurveFitting::Algorithms::QENSFitSequential::getDatasetGrouping(), Mantid::CurveFitting::Algorithms::QENSFitSequential::getInputString(), Mantid::CurveFitting::Algorithms::QENSFitSequential::getOutputBaseName(), Mantid::CurveFitting::Algorithms::QENSFitSequential::getWorkspaces(), Mantid::WorkflowAlgorithms::DgsReduction::loadInputData(), Mantid::WorkflowAlgorithms::SANSBeamFluxCorrection::loadReference(), Mantid::CurveFitting::Algorithms::QENSFitSequential::performFit(), Mantid::CurveFitting::Algorithms::QENSFitSequential::validateInputs(), and Mantid::WorkflowAlgorithms::AlignAndFocusPowder::validateInputs().
|
protected |
Determine what kind of input data we have and load it.
| inputData | :: File path or workspace name |
| loadQuiet | :: If true then the output is not stored in the ADS |
Definition at line 223 of file DataProcessorAlgorithm.cpp.
References Mantid::Kernel::FacilityInfo::extensions().
Referenced by Mantid::WorkflowAlgorithms::DgsReduction::loadInputData(), and Mantid::PythonInterface::DataProcessorAdapter< Base >::loadProxy().
|
protectedvirtual |
Reimplemented in Mantid::WorkflowAlgorithms::LoadEventAndCompress.
Definition at line 195 of file DataProcessorAlgorithm.cpp.
References UNUSED_ARG.
Referenced by Mantid::PythonInterface::DataProcessorAdapter< Base >::loadChunkProxy().
|
protected |
Declare mapping of property name to name in the PropertyManager.
This is used by getPropertyValue(const string &) and getProperty(const string&).
| nameInProp | Name of the property as declared in Algorithm::init(). |
| nameInPropManager | Name of the property in the PropertyManager. |
Definition at line 106 of file DataProcessorAlgorithm.cpp.
|
protected |
Subract a single value from a matrix workspace.
| lhs | :: the workspace on the left hand side of the subtraction symbol |
| rhsValue | :: the workspace on the right hand side of the subtraction symbol |
Definition at line 409 of file DataProcessorAlgorithm.cpp.
References Mantid::API::createWorkspaceSingleValue().
|
protected |
Subract a matrix workspace by another matrix workspace.
Subract a matrix workspace from another matrix workspace.
| lhs | :: the workspace on the left hand side of the subtraction symbol |
| rhs | :: the workspace on the right hand side of the subtraction symbol |
Definition at line 395 of file DataProcessorAlgorithm.cpp.
References rhs.
|
protected |
Multiply a matrix workspace by a single value.
| lhs | :: the workspace on the left hand side of the multiplication symbol |
| rhsValue | :: the value on the right hand side of the multiplication symbol |
Definition at line 357 of file DataProcessorAlgorithm.cpp.
References Mantid::API::createWorkspaceSingleValue().
|
protected |
Multiply a matrix workspace by another matrix workspace.
| lhs | :: the workspace on the left hand side of the multiplication symbol |
| rhs | :: the workspace on the right hand side of the multiplication symbol |
Definition at line 342 of file DataProcessorAlgorithm.cpp.
References rhs.
|
protected |
Add a single value to a matrix workspace.
Add a single value to another matrix workspace.
| lhs | :: the workspace on the left hand side of the addition symbol |
| rhsValue | :: the value on the right hand side of the addition symbol |
Definition at line 383 of file DataProcessorAlgorithm.cpp.
References Mantid::API::createWorkspaceSingleValue().
|
protected |
Add a matrix workspace to another matrix workspace.
| lhs | :: the workspace on the left hand side of the addition symbol |
| rhs | :: the workspace on the right hand side of the addition symbol |
Definition at line 370 of file DataProcessorAlgorithm.cpp.
References rhs.
|
protected |
Save a workspace as a nexus file, with check for which thread we are executing in.
| outputWSName | :: Name of the workspace to save |
| outputFile | :: Path to the Nexus file to save |
Definition at line 208 of file DataProcessorAlgorithm.cpp.
Referenced by Mantid::PythonInterface::DataProcessorAdapter< Base >::saveNexusProxy().
|
protected |
Definition at line 87 of file DataProcessorAlgorithm.cpp.
Referenced by Mantid::PythonInterface::DataProcessorAdapter< Base >::setAccumAlgProxy().
|
protected |
Definition at line 74 of file DataProcessorAlgorithm.cpp.
Referenced by Mantid::WorkflowAlgorithms::DgsReduction::loadInputData(), and Mantid::PythonInterface::DataProcessorAdapter< Base >::setLoadAlgProxy().
|
protected |
Definition at line 80 of file DataProcessorAlgorithm.cpp.
Referenced by Mantid::PythonInterface::DataProcessorAdapter< Base >::setLoadAlgFilePropProxy().
|
protected |
Definition at line 93 of file DataProcessorAlgorithm.cpp.
|
protected |
Definition at line 294 of file DataProcessorAlgorithm.cpp.
References UNUSED_ARG.
Referenced by Mantid::PythonInterface::DataProcessorAdapter< Base >::splitInputProxy().
|
private |
Definition at line 428 of file DataProcessorAlgorithm.cpp.
|
private |
|
private |
Definition at line 432 of file DataProcessorAlgorithm.cpp.
|
private |
The name of the algorithm to invoke when accumulating data chunks.
Definition at line 96 of file DataProcessorAlgorithm.h.
|
private |
The name of the algorithm to invoke when loading data.
Definition at line 94 of file DataProcessorAlgorithm.h.
|
private |
An alternate filename property for the load algorithm.
Definition at line 98 of file DataProcessorAlgorithm.h.
|
private |
Map property names to names in supplied properties manager.
Definition at line 103 of file DataProcessorAlgorithm.h.
|
private |
The name of the parameter that names the property manager.
The default value is "ReductionProperties".
Definition at line 101 of file DataProcessorAlgorithm.h.