9#include "MantidNexusGeometry/NexusGeometrySave.h"
33 return "Saves intermediate, also known as 'processed' nexus file with data "
46 const std::string filename =
getProperty(
"Filename");
47 NexusGeometry::LogAdapter<Kernel::Logger> adapter(&
g_log);
54 if (!workspaces.empty()) {
55 for (
size_t entry = 0; entry < workspaces.size(); entry++) {
57 auto matrixWs = std::dynamic_pointer_cast<API::MatrixWorkspace>(ws);
59 throw std::runtime_error(
"SaveNexusESS::processGroups: workspace is not a MatrixWorkspace");
62 g_log.
information() <<
"Adding instrument to workspace at group index " << entry <<
"\n";
70 std::optional<size_t> entryNumber) {
73 NexusGeometry::LogAdapter<Kernel::Logger> adapter(&
g_log);
74 NexusGeometry::NexusGeometrySave::saveInstrument(ws, filename,
"mantid_workspace_", entryNumber, adapter,
true);
75 }
catch (std::exception &e) {
76 g_log.
error(std::string(e.what()) +
":\n Nexus Geometry may be absent or incomplete "
77 "from the processed Nexus file");
78 }
catch (H5::Exception &ex) {
79 g_log.
error(ex.getDetailMsg() +
":\n Nexus Geometry may be absent or incomplete "
80 "from the processed Nexus file");
105 const std::string filename =
getProperty(
"Filename");
106 auto matrixWs = std::dynamic_pointer_cast<API::MatrixWorkspace>(ws);
108 throw std::runtime_error(
"SaveNexusESS expects a MatrixWorkspace as input");
#define DECLARE_ALGORITHM(classname)
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
std::vector< WorkspaceVector > m_unrolledInputWorkspaces
One vector of workspaces for each input workspace property.
Base MatrixWorkspace Abstract Class.
A property class for workspaces.
SaveNexusESS : Save algorithm to save a NeXus organised hdf5 file containing data and geometry from r...
int version() const override
Algorithm's version for identification.
virtual bool saveLegacyInstrument() override
const std::string category() const override
Algorithm's category for identification.
void exec() override
Execute the algorithm.
void init() override
Initialize the algorithm's properties.
bool processGroups() override
SaveNexusESS::processGroups.
void saveNexusGeometry(const Mantid::API::MatrixWorkspace &ws, const std::string &filename, std::optional< size_t > entryNumber=std::optional< size_t >())
const std::string summary() const override
Algorithm's summary for use in the GUI and help.
void init() override
Overwrites Algorithm method.
bool processGroups() override
Override process groups.
void exec() override
Overwrites Algorithm method.
void error(const std::string &msg)
Logs at error level.
void information(const std::string &msg)
Logs at information level.
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
Describes the direction (within an algorithm) of a Property.