|
Mantid
|
Functions | |
| EXPORT_OPT_MANTIDQT_COMMON std::vector< std::string > | attachPrefix (std::vector< std::string > const &strings, std::string const &prefix) |
| EXPORT_OPT_MANTIDQT_COMMON bool | doAllWsExistInADS (std::vector< std::string > const &workspaceNames) |
| EXPORT_OPT_MANTIDQT_COMMON bool | doesExistInADS (std::string const &workspaceName) |
| EXPORT_OPT_MANTIDQT_COMMON std::unordered_map< std::string, size_t > | extractAxisLabels (const Mantid::API::MatrixWorkspace_const_sptr &workspace, const size_t &axisIndex) |
| template<typename T = Mantid::API::MatrixWorkspace> | |
| std::shared_ptr< T > | getADSWorkspace (std::string const &workspaceName) |
| template EXPORT_OPT_MANTIDQT_COMMON std::shared_ptr< Mantid::API::MatrixWorkspace_sptr > | getADSWorkspace (std::string const &workspaceName) |
| EXPORT_OPT_MANTIDQT_COMMON std::optional< double > | getEFixed (const Mantid::API::MatrixWorkspace_sptr &ws) |
| Gets the eFixed value from the workspace using the instrument parameters. | |
| EXPORT_OPT_MANTIDQT_COMMON std::string | getEMode (const Mantid::API::MatrixWorkspace_sptr &ws) |
| Gets the energy mode from a workspace based on the X unit. | |
| std::string | getIndexString (const MatrixWorkspace_sptr &workspace) |
| EXPORT_OPT_MANTIDQT_COMMON std::string | getIndexString (const std::string &workspaceName) |
| EXPORT_OPT_MANTIDQT_COMMON bool | getResolutionRangeFromWs (const Mantid::API::MatrixWorkspace_const_sptr &workspace, std::pair< double, double > &res) |
| Checks the workspace's instrument for a resolution parameter to use as a default for the energy range on the mini plot. | |
| EXPORT_OPT_MANTIDQT_COMMON bool | getResolutionRangeFromWs (const std::string &workspace, std::pair< double, double > &res) |
| Checks the workspace's instrument for a resolution parameter to use as a default for the energy range on the mini plot. | |
| EXPORT_OPT_MANTIDQT_COMMON std::string | getWorkspaceBasename (const std::string &wsName) |
| Returns the basename of a workspace (i.e. | |
| EXPORT_OPT_MANTIDQT_COMMON std::string | getWorkspaceSuffix (const std::string &wsName) |
| Gets the suffix of a workspace (i.e. | |
| EXPORT_OPT_MANTIDQT_COMMON std::pair< double, double > | getXRangeFromWorkspace (const Mantid::API::MatrixWorkspace_const_sptr &workspace, double precision=0.00001, std::size_t wsIndex=0) |
| EXPORT_OPT_MANTIDQT_COMMON std::pair< double, double > | getXRangeFromWorkspace (std::string const &workspaceName, double precision=0.000001) |
| EXPORT_OPT_MANTIDQT_COMMON std::optional< std::size_t > | maximumIndex (const Mantid::API::MatrixWorkspace_sptr &workspace) |
| Gets the maximum number of histograms for a 2D Workspace. | |
| EXPORT_OPT_MANTIDQT_COMMON std::string | parseRunNumbers (std::vector< std::string > const &workspaceNames) |
Checks the name of the input workspace against a regexp for prefixes in the form instrName\#runNumber_..., where #runNumber is a number indicating the specific instrument run number that the workspace refers to. | |
| EXPORT_OPT_MANTIDQT_COMMON void | removeADSWorkspace (std::string const &workspaceName) |
| template<typename T , typename Predicate > | |
| void | removeElementsIf (std::vector< T > &vector, Predicate const &filter) |
| EXPORT_OPT_MANTIDQT_COMMON void | setNumericQAxis (std::string const &workspaceName) |
| Ensures the vertical (spectrum) axis of the named workspace is a numeric axis, and labels it with the MomentumTransfer unit if it does not already have a meaningful one. | |
| template<typename Iterator , typename Functor > | |
| std::vector< std::string > | transformElements (Iterator const fromIter, Iterator const toIter, Functor const &functor) |
| std::vector< std::string > MantidQt::MantidWidgets::WorkspaceUtils::attachPrefix | ( | std::vector< std::string > const & | strings, |
| std::string const & | prefix | ||
| ) |
Definition at line 268 of file WorkspaceUtils.cpp.
References transformElements().
| bool MantidQt::MantidWidgets::WorkspaceUtils::doAllWsExistInADS | ( | std::vector< std::string > const & | workspaceNames | ) |
Definition at line 223 of file WorkspaceUtils.cpp.
| bool MantidQt::MantidWidgets::WorkspaceUtils::doesExistInADS | ( | std::string const & | workspaceName | ) |
Definition at line 219 of file WorkspaceUtils.cpp.
Referenced by removeADSWorkspace(), MantidQt::MantidWidgets::AddWorkspaceDialog::selectAllSpectra(), and setNumericQAxis().
| std::unordered_map< std::string, size_t > MantidQt::MantidWidgets::WorkspaceUtils::extractAxisLabels | ( | const Mantid::API::MatrixWorkspace_const_sptr & | workspace, |
| const size_t & | axisIndex | ||
| ) |
Definition at line 99 of file WorkspaceUtils.cpp.
References Mantid::API::Axis::isText(), and workspace.
| template EXPORT_OPT_MANTIDQT_COMMON std::shared_ptr< Mantid::API::ITableWorkspace_sptr > MantidQt::MantidWidgets::WorkspaceUtils::getADSWorkspace | ( | std::string const & | workspaceName | ) |
Definition at line 48 of file WorkspaceUtils.h.
Referenced by MantidQt::CustomInterfaces::UserInputValidator::checkWorkspaceNumberOfBins(), MantidQt::CustomInterfaces::UserInputValidator::checkWorkspaceNumberOfHistograms(), getIndexString(), setNumericQAxis(), and MantidQt::MantidWidgets::AddWorkspaceDialog::workspaceChanged().
| template EXPORT_OPT_MANTIDQT_COMMON std::shared_ptr< Mantid::API::MatrixWorkspace_sptr > MantidQt::MantidWidgets::WorkspaceUtils::getADSWorkspace | ( | std::string const & | workspaceName | ) |
| std::optional< double > MantidQt::MantidWidgets::WorkspaceUtils::getEFixed | ( | const Mantid::API::MatrixWorkspace_sptr & | ws | ) |
Gets the eFixed value from the workspace using the instrument parameters.
| ws | Pointer to the workspace |
Definition at line 139 of file WorkspaceUtils.cpp.
| std::string MantidQt::MantidWidgets::WorkspaceUtils::getEMode | ( | const Mantid::API::MatrixWorkspace_sptr & | ws | ) |
Gets the energy mode from a workspace based on the X unit.
Units of dSpacing typically denote diffraction, hence Elastic. All other units default to spectroscopy, therefore Indirect.
| ws | Pointer to the workspace |
Definition at line 122 of file WorkspaceUtils.cpp.
References Mantid::Kernel::Logger::debug(), Mantid::API::g_log, and Mantid::API::Axis::unit().
| std::string MantidQt::MantidWidgets::WorkspaceUtils::getIndexString | ( | const MatrixWorkspace_sptr & | workspace | ) |
Definition at line 53 of file WorkspaceUtils.cpp.
References maximumIndex(), std::to_string(), and workspace.
| std::string MantidQt::MantidWidgets::WorkspaceUtils::getIndexString | ( | const std::string & | workspaceName | ) |
Definition at line 60 of file WorkspaceUtils.cpp.
References getADSWorkspace(), and getIndexString().
Referenced by MantidQt::MantidWidgets::WorkspaceMultiSelector::addItem(), getIndexString(), MantidQt::MantidWidgets::WorkspaceMultiSelector::renameItem(), MantidQt::MantidWidgets::WorkspaceMultiSelector::resetIndexRangeToDefault(), MantidQt::MantidWidgets::AddWorkspaceDialog::selectAllSpectra(), and MantidQt::MantidWidgets::AddWorkspaceDialog::setWorkspace().
| bool MantidQt::MantidWidgets::WorkspaceUtils::getResolutionRangeFromWs | ( | const Mantid::API::MatrixWorkspace_const_sptr & | workspace, |
| std::pair< double, double > & | res | ||
| ) |
Checks the workspace's instrument for a resolution parameter to use as a default for the energy range on the mini plot.
| workspace | :: Name of the workspace to use |
| res | :: The retrieved values for the resolution parameter (if one was found) |
Definition at line 180 of file WorkspaceUtils.cpp.
References workspace.
| bool MantidQt::MantidWidgets::WorkspaceUtils::getResolutionRangeFromWs | ( | const std::string & | workspace, |
| std::pair< double, double > & | res | ||
| ) |
Checks the workspace's instrument for a resolution parameter to use as a default for the energy range on the mini plot.
| workspace | :: Name of the workspace to use |
| res | :: The retrieved values for the resolution parameter (if one was found) |
Definition at line 167 of file WorkspaceUtils.cpp.
References getResolutionRangeFromWs(), and workspace.
Referenced by getResolutionRangeFromWs().
| std::string MantidQt::MantidWidgets::WorkspaceUtils::getWorkspaceBasename | ( | const std::string & | wsName | ) |
Returns the basename of a workspace (i.e.
the part before the last underscore)
e.g. basename of irs26176_graphite002_red is irs26176_graphite002
| wsName | Name of workspace |
Definition at line 84 of file WorkspaceUtils.cpp.
| std::string MantidQt::MantidWidgets::WorkspaceUtils::getWorkspaceSuffix | ( | const std::string & | wsName | ) |
Gets the suffix of a workspace (i.e.
part after last underscore (red, sqw)).
| wsName | Name of workspace |
Definition at line 68 of file WorkspaceUtils.cpp.
| std::pair< double, double > MantidQt::MantidWidgets::WorkspaceUtils::getXRangeFromWorkspace | ( | const Mantid::API::MatrixWorkspace_const_sptr & | workspace, |
| double | precision = 0.00001, |
||
| std::size_t | wsIndex = 0 |
||
| ) |
Definition at line 210 of file WorkspaceUtils.cpp.
References workspace.
Referenced by getXRangeFromWorkspace().
| std::pair< double, double > MantidQt::MantidWidgets::WorkspaceUtils::getXRangeFromWorkspace | ( | std::string const & | workspaceName, |
| double | precision = 0.000001 |
||
| ) |
Definition at line 203 of file WorkspaceUtils.cpp.
References getXRangeFromWorkspace().
| std::optional< std::size_t > MantidQt::MantidWidgets::WorkspaceUtils::maximumIndex | ( | const Mantid::API::MatrixWorkspace_sptr & | workspace | ) |
Gets the maximum number of histograms for a 2D Workspace.
| workspace | Workspace pointer |
Definition at line 44 of file WorkspaceUtils.cpp.
References workspace.
Referenced by getIndexString().
| std::string MantidQt::MantidWidgets::WorkspaceUtils::parseRunNumbers | ( | std::vector< std::string > const & | workspaceNames | ) |
Checks the name of the input workspace against a regexp for prefixes in the form instrName\#runNumber_..., where #runNumber is a number indicating the specific instrument run number that the workspace refers to.
As output, it returns a single string with format instrName#firstRunNumber-#finalRunNumber_..., if run numbers are found.
| workspaceNames | :: a vector of strings containing a series of workspace names |
Definition at line 281 of file WorkspaceUtils.cpp.
References name, std::to_string(), and transformElements().
| void MantidQt::MantidWidgets::WorkspaceUtils::removeADSWorkspace | ( | std::string const & | workspaceName | ) |
Definition at line 227 of file WorkspaceUtils.cpp.
References doesExistInADS().
| void MantidQt::MantidWidgets::WorkspaceUtils::removeElementsIf | ( | std::vector< T > & | vector, |
| Predicate const & | filter | ||
| ) |
Definition at line 69 of file WorkspaceUtils.h.
| void MantidQt::MantidWidgets::WorkspaceUtils::setNumericQAxis | ( | std::string const & | workspaceName | ) |
Ensures the vertical (spectrum) axis of the named workspace is a numeric axis, and labels it with the MomentumTransfer unit if it does not already have a meaningful one.
This is needed before running some Q-conversion algorithms (e.g. SofQWMoments, or multi-domain fitting across Q) on a workspace whose vertical axis has no physical unit set, such as one loaded from a text file. It is a no-op if the workspace does not exist, or if its vertical axis already has a unit other than "Empty" or "Label" (i.e. an existing, genuine unit is never overwritten).
| workspaceName | :: Name of the workspace in the ADS to update. |
Definition at line 243 of file WorkspaceUtils.cpp.
References doesExistInADS(), and getADSWorkspace().
| std::vector< std::string > MantidQt::MantidWidgets::WorkspaceUtils::transformElements | ( | Iterator const | fromIter, |
| Iterator const | toIter, | ||
| Functor const & | functor | ||
| ) |
Definition at line 62 of file WorkspaceUtils.h.
Referenced by attachPrefix(), and parseRunNumbers().