19#include <Poco/DateTimeFormat.h>
20#include <Poco/DateTimeParser.h>
21#include <Poco/DirectoryIterator.h>
24#include <boost/algorithm/string.hpp>
35using namespace Kernel;
47 "The name of the workspace to which the log data will be removed");
49 "List(comma separated) of logs to be kept");
62 const std::vector<Mantid::Kernel::Property *> &logData = localWorkspace->run().getLogData();
63 std::vector<std::string> keepLogs =
getProperty(
"KeepLogs");
64 std::vector<std::string> logNames;
65 logNames.reserve(logData.size());
66 std::transform(logData.cbegin(), logData.cend(), std::back_inserter(logNames),
67 [](
const auto &property) { return property->name(); });
68 for (
const auto &
name : logNames) {
69 auto location = std::find(keepLogs.cbegin(), keepLogs.cend(),
name);
70 if (location == keepLogs.cend()) {
71 localWorkspace->mutableRun().removeLogData(
name);
#define DECLARE_ALGORITHM(classname)
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
A property class for workspaces.
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
void exec() override
Overwrites Algorithm method.
void init() override
Overwrites Algorithm method.
RemoveLogs()
Default constructor.
Support for a property that holds an array of values.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< Workspace2D > Workspace2D_sptr
shared pointer to Mantid::DataObjects::Workspace2D
@ InOut
Both an input & output workspace.
@ Input
An input workspace.