Mantid
Loading...
Searching...
No Matches
AddSampleLog.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2009 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include "MantidAPI/Algorithm.h"
14#include "MantidAPI/Run.h"
15#include "MantidAlgorithms/DllConfig.h"
16
17namespace Mantid {
18namespace Algorithms {
34class MANTID_ALGORITHMS_DLL AddSampleLog final : public API::Algorithm {
35public:
37 const std::string name() const override { return "AddSampleLog"; }
39 const std::string summary() const override { return "Used to insert a value into the sample logs in a workspace."; }
40
42 int version() const override { return (1); }
43 const std::vector<std::string> seeAlso() const override {
44 return {"AddSampleLogMultiple", "AddTimeSeriesLog", "DeleteLog", "LoadLog"};
45 }
47 const std::string category() const override { return "DataHandling\\Logs"; }
48
49private:
51 void init() override;
53 void exec() override;
54
55 void addStringLog(API::Run &theRun, const std::string &propName, const std::string &propValue,
56 const std::string &propUnit);
57
58 void addTimeSeriesProperty(API::Run &run_obj, const std::string &prop_name, const std::string &prop_value,
59 const std::string &prop_unit, const std::string &prop_number_type);
60
61 void addSingleValueProperty(API::Run &theRun, const std::string &propName, const std::string &propValue,
62 const std::string &propUnit, const std::string &propNumberType);
63
66 void setTimeSeriesData(API::Run &run_obj, const std::string &property_name, bool value_is_int);
67
69 Types::Core::DateAndTime getRunStart(const API::Run &run_obj);
70
72 std::vector<int> getIntValues(const API::MatrixWorkspace_const_sptr &dataws, int workspace_index);
73
75 std::vector<double> getDblValues(const API::MatrixWorkspace_const_sptr &dataws, int workspace_index);
76
78 std::vector<Types::Core::DateAndTime> getTimes(const API::MatrixWorkspace_const_sptr &dataws, int workspace_index,
79 bool is_epoch, bool is_second, API::Run &run_obj);
80
82 void getMetaData(const API::MatrixWorkspace_const_sptr &dataws, bool &epochtime, std::string &timeunit);
83};
84
85} // namespace Algorithms
86} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
This class stores information regarding an experimental run as a series of log entries.
Definition: Run.h:38
Used to insert a single string into the sample in a workspace.
Definition: AddSampleLog.h:34
const std::string name() const override
Algorithm's name.
Definition: AddSampleLog.h:37
int version() const override
Algorithm's version.
Definition: AddSampleLog.h:42
const std::string summary() const override
Summary of algorithms purpose.
Definition: AddSampleLog.h:39
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
Definition: AddSampleLog.h:43
const std::string category() const override
Algorithm's category for identification.
Definition: AddSampleLog.h:47
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
Helper class which provides the Collimation Length for SANS instruments.