Mantid
Loading...
Searching...
No Matches
LoadLog.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 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"
13#include "MantidAPI/Run.h"
14#include "MantidDataHandling/DllConfig.h"
15
16namespace Mantid {
17
18namespace DataHandling {
59class MANTID_DATAHANDLING_DLL LoadLog final : public API::Algorithm {
60public:
64 const std::string name() const override { return "LoadLog"; };
66 const std::string summary() const override { return "Load ISIS log file(s) into a workspace."; }
67
69 int version() const override { return 1; };
70 const std::vector<std::string> seeAlso() const override { return {"AddSampleLog", "LoadNexusLogs"}; }
72 const std::string category() const override { return "DataHandling\\Logs"; }
73
74private:
76 void init() override;
77
79 bool LoadSNSText();
80
82 void exec() override;
83
86 std::string m_filename;
87
89 enum kind { empty, string, number };
90
92 kind classify(const std::string &s) const;
93
95 std::string stringToLower(std::string strToConvert);
96
98 bool isAscii(const std::string &filename);
99
102 bool isDateTimeString(const std::string &str) const;
103
106 bool isOldDateTimeFormat(std::ifstream &logFileStream) const;
107
110 std::string extractLogName(const std::vector<std::string> &logName);
111
113 bool SNSTextFormatColumns(const std::string &input, std::vector<double> &out) const;
114
116 void loadThreeColumnLogFile(std::ifstream &logFileStream, const std::string &logFileName, API::Run &run);
117
119 void loadTwoColumnLogFile(std::ifstream &logFileStream, std::string logFileName, API::Run &run);
120
122 int countNumberColumns(std::ifstream &logFileStream, const std::string &logFileName);
123
125 std::shared_ptr<Kernel::Property> m_periods;
126};
127
128} // namespace DataHandling
129} // namespace Mantid
Kind kind
The kind of the point: either openning or closing the range.
Definition: FitMW.cpp:49
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
Load ISIS log file(s).
Definition: LoadLog.h:59
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition: LoadLog.h:64
std::string m_filename
The name and path of an input file.
Definition: LoadLog.h:86
const std::string summary() const override
Summary of algorithms purpose.
Definition: LoadLog.h:66
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition: LoadLog.h:69
LoadLog()
Default constructor.
std::shared_ptr< Kernel::Property > m_periods
TimeSeriesProperty<int> containing data periods. Created by LogParser.
Definition: LoadLog.h:125
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
Definition: LoadLog.h:72
kind
type returned by classify
Definition: LoadLog.h:89
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Definition: LoadLog.h:70
MANTID_GEOMETRY_DLL PointClassification classify(const Kernel::V2D &pt, const PolygonEdge &edge)
Helper function for classification.
Definition: PolygonEdge.cpp:47
Helper class which provides the Collimation Length for SANS instruments.