Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
Mantid::Algorithms::ExtractQENSMembers Class Reference

ExtractQENSMembers : Extracts the fit members from a QENS fit. More...

#include <ExtractQENSMembers.h>

Inheritance diagram for Mantid::Algorithms::ExtractQENSMembers:
Mantid::API::GenericDataProcessorAlgorithm< Base >

Public Member Functions

const std::string category () const override
 Algorithm's category for identification. More...
 
const std::string name () const override
 Algorithms name for identification. More...
 
const std::string summary () const override
 Algorithm's summary for use in the GUI and help. More...
 
int version () const override
 Algorithm's version for identification. More...
 
- Public Member Functions inherited from Mantid::API::GenericDataProcessorAlgorithm< Base >
 GenericDataProcessorAlgorithm ()
 Constructor. More...
 
Kernel::IPropertyManager::TypedValue getProperty (const std::string &name) const override
 Get the property held by this object. More...
 
std::string getPropertyValue (const std::string &name) const override
 Get the property held by this object. More...
 

Private Member Functions

std::vector< std::string > addMembersToADS (const std::vector< std::string > &members, const std::vector< Mantid::API::MatrixWorkspace_sptr > &memberWorkspaces, const std::string &outputWSName)
 Adds the specified member workspaces to the analysis data service. More...
 
Mantid::API::MatrixWorkspace_sptr appendSpectra (const Mantid::API::MatrixWorkspace_sptr &inputWS, const Mantid::API::MatrixWorkspace_sptr &spectraWorkspace)
 Appends the spectra of a specified workspace to another specified input workspace. More...
 
void appendToMembers (const Mantid::API::MatrixWorkspace_sptr &resultWS, std::vector< Mantid::API::MatrixWorkspace_sptr > &members)
 Appends the n-th spectra in the specified result workspace to the n-th specified member workspace. More...
 
std::vector< Mantid::API::MatrixWorkspace_sptrcreateMembersWorkspaces (const Mantid::API::MatrixWorkspace_sptr &initialWS, const std::vector< std::string > &members)
 Creates the member workspaces from an initial result workspace and the member names. More...
 
void exec () override
 
Mantid::API::MatrixWorkspace_sptr extractSpectrum (const Mantid::API::MatrixWorkspace_sptr &inputWS, size_t spectrum)
 Extracts the specified spectrum from the specified spectrum. More...
 
std::vector< std::string > getAxisLabels (const Mantid::API::MatrixWorkspace_sptr &workspace, size_t axisIndex) const
 Retrieves the axis labels from the axis with the specified index, in the specified workspace. More...
 
std::vector< Mantid::API::MatrixWorkspace_sptrgetInputWorkspaces () const
 
std::vector< double > getQValues (const std::vector< Mantid::API::MatrixWorkspace_sptr > &workspaces)
 Extracts the Q-Values from the specified workspace. More...
 
Mantid::API::WorkspaceGroup_sptr groupWorkspaces (const std::vector< std::string > &workspaceNames)
 Groups the workspaces with the specified name. More...
 
void init () override
 Initialize the algorithm's properties. More...
 
std::vector< std::string > renameConvolvedMembers (const std::vector< std::string > &members, const std::vector< std::string > &newNames) const
 Renames the convolved members in the specified vector of members, to the respective names in the specified new names vector. More...
 
void setNumericAxis (const std::vector< Mantid::API::MatrixWorkspace_sptr > &workspaces, const std::vector< double > &values, size_t axisIndex) const
 Creates and sets a numeric axis, filled with the specified values, on each of the specified workspaces at the specified axis index. More...
 
std::map< std::string, std::string > validateInputs () override
 

Additional Inherited Members

- Protected Member Functions inherited from Mantid::API::GenericDataProcessorAlgorithm< Base >
Workspace_sptr assemble (const std::string &partialWSName, const std::string &outputWSName)
 Assemble the partial workspaces from all MPI processes. More...
 
Workspace_sptr assemble (Workspace_sptr partialWS)
 Assemble the partial workspaces from all MPI processes. More...
 
void copyProperty (const API::Algorithm_sptr &alg, const std::string &name)
 Copy a property from an existing algorithm. More...
 
std::shared_ptr< AlgorithmcreateChildAlgorithm (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. More...
 
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. More...
 
MatrixWorkspace_sptr divide (const MatrixWorkspace_sptr lhs, const MatrixWorkspace_sptr rhs)
 Divide a matrix workspace by another matrix workspace. More...
 
void forwardProperties ()
 
int getNThreads ()
 Return the number of MPI processes running. More...
 
std::shared_ptr< Kernel::PropertyManagergetProcessProperties (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. More...
 
bool isMainThread ()
 Return true if we are running on the main thread. More...
 
Workspace_sptr load (const std::string &inputData, const bool loadQuiet=false)
 Determine what kind of input data we have and load it. More...
 
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. More...
 
MatrixWorkspace_sptr minus (const MatrixWorkspace_sptr lhs, const double &rhsValue)
 Subract a single value from a matrix workspace. More...
 
MatrixWorkspace_sptr minus (const MatrixWorkspace_sptr lhs, const MatrixWorkspace_sptr rhs)
 Subract a matrix workspace by another matrix workspace. More...
 
MatrixWorkspace_sptr multiply (const MatrixWorkspace_sptr lhs, const double &rhsValue)
 Multiply a matrix workspace by a single value. More...
 
MatrixWorkspace_sptr multiply (const MatrixWorkspace_sptr lhs, const MatrixWorkspace_sptr rhs)
 Multiply a matrix workspace by another matrix workspace. More...
 
MatrixWorkspace_sptr plus (const MatrixWorkspace_sptr lhs, const double &rhsValue)
 Add a single value to a matrix workspace. More...
 
MatrixWorkspace_sptr plus (const MatrixWorkspace_sptr lhs, const MatrixWorkspace_sptr rhs)
 Add a matrix workspace to another matrix workspace. More...
 
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. More...
 
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)
 
- Protected Attributes inherited from Mantid::API::GenericDataProcessorAlgorithm< Base >
bool m_useMPI
 MPI option. If false, we will use one job event if MPI is available. More...
 

Detailed Description

ExtractQENSMembers : Extracts the fit members from a QENS fit.

Definition at line 18 of file ExtractQENSMembers.h.

Member Function Documentation

◆ addMembersToADS()

std::vector< std::string > Mantid::Algorithms::ExtractQENSMembers::addMembersToADS ( const std::vector< std::string > &  members,
const std::vector< Mantid::API::MatrixWorkspace_sptr > &  memberWorkspaces,
const std::string &  outputWSName 
)
private

Adds the specified member workspaces to the analysis data service.

Parameters
membersThe name of the members; corresponds to each member workspace.
memberWorkspacesThe member workspaces.
outputWSNameThe name of the output workspace; used as a prefix.
Returns
A vector containing the names of the added workspaces.

Definition at line 283 of file ExtractQENSMembers.cpp.

References count, Mantid::Kernel::SingletonHolder< T >::Instance(), name(), and std::to_string().

Referenced by exec().

◆ appendSpectra()

MatrixWorkspace_sptr Mantid::Algorithms::ExtractQENSMembers::appendSpectra ( const Mantid::API::MatrixWorkspace_sptr inputWS,
const Mantid::API::MatrixWorkspace_sptr spectraWorkspace 
)
private

Appends the spectra of a specified workspace to another specified input workspace.

Parameters
inputWSThe input workspace to append to.
spectraWorkspaceThe workspace whose spectra to append.

Definition at line 198 of file ExtractQENSMembers.cpp.

References Mantid::API::GenericDataProcessorAlgorithm< Base >::createChildAlgorithm().

Referenced by appendToMembers().

◆ appendToMembers()

void Mantid::Algorithms::ExtractQENSMembers::appendToMembers ( const Mantid::API::MatrixWorkspace_sptr resultWS,
std::vector< Mantid::API::MatrixWorkspace_sptr > &  members 
)
private

Appends the n-th spectra in the specified result workspace to the n-th specified member workspace.

Parameters
resultWSThe result workspace.
membersA vector containing the member workspaces.

Definition at line 246 of file ExtractQENSMembers.cpp.

References appendSpectra(), and extractSpectrum().

Referenced by exec().

◆ category()

const std::string Mantid::Algorithms::ExtractQENSMembers::category ( ) const
override

Algorithm's category for identification.

See also
Algorithm::category

Definition at line 38 of file ExtractQENSMembers.cpp.

◆ createMembersWorkspaces()

std::vector< MatrixWorkspace_sptr > Mantid::Algorithms::ExtractQENSMembers::createMembersWorkspaces ( const Mantid::API::MatrixWorkspace_sptr initialWS,
const std::vector< std::string > &  members 
)
private

Creates the member workspaces from an initial result workspace and the member names.

Parameters
initialWSThe initial result workspace.
membersA vector of the member names.
Returns
A vector of the created members workspaces.

Definition at line 230 of file ExtractQENSMembers.cpp.

References extractSpectrum().

Referenced by exec().

◆ exec()

void Mantid::Algorithms::ExtractQENSMembers::exec ( )
overrideprivate

◆ extractSpectrum()

MatrixWorkspace_sptr Mantid::Algorithms::ExtractQENSMembers::extractSpectrum ( const Mantid::API::MatrixWorkspace_sptr inputWS,
size_t  spectrum 
)
private

Extracts the specified spectrum from the specified spectrum.

Parameters
inputWSThe workspace whose spectrum to extract.
spectrumThe spectrum to extract.
Returns
A workspace containing the extracted spectrum.

Definition at line 181 of file ExtractQENSMembers.cpp.

References Mantid::API::GenericDataProcessorAlgorithm< Base >::createChildAlgorithm().

Referenced by appendToMembers(), and createMembersWorkspaces().

◆ getAxisLabels()

std::vector< std::string > Mantid::Algorithms::ExtractQENSMembers::getAxisLabels ( const Mantid::API::MatrixWorkspace_sptr workspace,
size_t  axisIndex 
) const
private

Retrieves the axis labels from the axis with the specified index, in the specified workspace.

Parameters
workspaceThe workspace whose axis labels to retrieve.
axisIndexThe index of the axis whose labels retrieve.
Returns
The retrieved axis labels.

Definition at line 140 of file ExtractQENSMembers.cpp.

References workspace.

Referenced by exec().

◆ getInputWorkspaces()

std::vector< MatrixWorkspace_sptr > Mantid::Algorithms::ExtractQENSMembers::getInputWorkspaces ( ) const
private

◆ getQValues()

std::vector< double > Mantid::Algorithms::ExtractQENSMembers::getQValues ( const std::vector< Mantid::API::MatrixWorkspace_sptr > &  workspaces)
private

Extracts the Q-Values from the specified workspace.

Parameters
workspacesThe workspaces whose Q-Values to extract.
Returns
The extracted Q-Values.

Definition at line 119 of file ExtractQENSMembers.cpp.

References Mantid::API::GenericDataProcessorAlgorithm< Base >::createChildAlgorithm(), and workspace.

Referenced by exec().

◆ groupWorkspaces()

WorkspaceGroup_sptr Mantid::Algorithms::ExtractQENSMembers::groupWorkspaces ( const std::vector< std::string > &  workspaceNames)
private

Groups the workspaces with the specified name.

Parameters
workspaceNamesA vector of the names of the workspaces to group.
Returns
The group workspace.

Definition at line 214 of file ExtractQENSMembers.cpp.

References Mantid::API::GenericDataProcessorAlgorithm< Base >::createChildAlgorithm().

Referenced by exec().

◆ init()

void Mantid::Algorithms::ExtractQENSMembers::init ( )
overrideprivate

Initialize the algorithm's properties.

Definition at line 46 of file ExtractQENSMembers.cpp.

References Mantid::Kernel::Direction::Input, Mantid::API::PropertyMode::Optional, and Mantid::Kernel::Direction::Output.

◆ name()

const std::string Mantid::Algorithms::ExtractQENSMembers::name ( ) const
override

Algorithms name for identification.

See also
Algorithm::name

Definition at line 32 of file ExtractQENSMembers.cpp.

Referenced by addMembersToADS(), and getInputWorkspaces().

◆ renameConvolvedMembers()

std::vector< std::string > Mantid::Algorithms::ExtractQENSMembers::renameConvolvedMembers ( const std::vector< std::string > &  members,
const std::vector< std::string > &  newNames 
) const
private

Renames the convolved members in the specified vector of members, to the respective names in the specified new names vector.

Parameters
membersA vector of the members.
newNamesThe names to use in renaming.
Returns
A vector of the members, with the convolved members renamed.

Definition at line 159 of file ExtractQENSMembers.cpp.

References index.

Referenced by exec().

◆ setNumericAxis()

void Mantid::Algorithms::ExtractQENSMembers::setNumericAxis ( const std::vector< Mantid::API::MatrixWorkspace_sptr > &  workspaces,
const std::vector< double > &  values,
size_t  axisIndex 
) const
private

Creates and sets a numeric axis, filled with the specified values, on each of the specified workspaces at the specified axis index.

Parameters
workspacesThe workspaces whose axis to set.
valuesThe values used to create the numeric axis.
axisIndexThe index of the axis to set.

Definition at line 260 of file ExtractQENSMembers.cpp.

References workspace.

Referenced by exec().

◆ summary()

const std::string Mantid::Algorithms::ExtractQENSMembers::summary ( ) const
override

Algorithm's summary for use in the GUI and help.

See also
Algorithm::summary

Definition at line 41 of file ExtractQENSMembers.cpp.

◆ validateInputs()

std::map< std::string, std::string > Mantid::Algorithms::ExtractQENSMembers::validateInputs ( )
overrideprivate

◆ version()

int Mantid::Algorithms::ExtractQENSMembers::version ( ) const
override

Algorithm's version for identification.

See also
Algorithm::version

Definition at line 35 of file ExtractQENSMembers.cpp.


The documentation for this class was generated from the following files: