Mantid
Loading...
Searching...
No Matches
ExportTimeSeriesLog.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2011 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
11#include "MantidAlgorithms/DllConfig.h"
14
15namespace Mantid {
16namespace Algorithms {
17
23class MANTID_ALGORITHMS_DLL ExportTimeSeriesLog final : public API::Algorithm {
24public:
25 const std::string name() const override { return "ExportTimeSeriesLog"; };
26
27 int version() const override { return 1; };
28 const std::vector<std::string> seeAlso() const override { return {"GetTimeSeriesLogInformation"}; }
29
30 const std::string category() const override { return "Diffraction\\DataHandling;Events\\EventFiltering"; };
31
33 const std::string summary() const override { return "Read a TimeSeries log and return information"; }
34
35private:
38
39 std::vector<int64_t> mSETimes;
40 std::vector<double> mSEValues;
41
42 Types::Core::DateAndTime mRunStartTime;
43 Types::Core::DateAndTime mFilterT0;
44 Types::Core::DateAndTime mFilterTf;
45
46 void init() override;
47
48 void exec() override;
49
50 bool calculateTimeSeriesRangeByTime(std::vector<Types::Core::DateAndTime> &vec_times, const double &rel_start_time,
51 size_t &i_start, const double &rel_stop_time, size_t &i_stop,
52 const double &time_factor);
53
54 void exportLog(const std::string &logname, const std::string &timeunit, const double &starttime,
55 const double &stoptime, const bool exportepoch, bool outputeventws, int numentries,
56 bool cal_first_deriv);
57
58 void setupEventWorkspace(const size_t &start_index, const size_t &stop_index, int numentries,
59 std::vector<Types::Core::DateAndTime> &times, std::vector<double> values,
60 const bool &epochtime);
61
62 void setupWorkspace2D(const size_t &start_index, const size_t &stop_index, int numentries,
63 std::vector<Types::Core::DateAndTime> &times, std::vector<double> values, const bool &epochtime,
64 const double &timeunitfactor, size_t nspec);
65
66 void calculateFirstDerivative(bool is_event_ws);
67
68 void setupMetaData(const std::string &log_name, const std::string &time_unit, const bool &export_epoch);
69};
70
71} // namespace Algorithms
72} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
ExportTimeSeriesLog : Read a TimeSeries log and return some information required by users.
int version() const override
function to return a version of the algorithm, must be overridden in all algorithms
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
const std::string category() const override
function to return a category of the algorithm.
const std::string summary() const override
Summary of algorithms purpose.
const std::string name() const override
function to return a name of the algorithm, must be overridden in all algorithms
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.