Mantid
Loading...
Searching...
No Matches
LoadPDFgetNFile.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2012 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
10#include "MantidDataHandling/DllConfig.h"
13
14namespace Mantid {
15namespace DataHandling {
16
19class MANTID_DATAHANDLING_DLL LoadPDFgetNFile : public API::IFileLoader<Kernel::FileDescriptor> {
20public:
22 const std::string name() const override { return "LoadPDFgetNFile"; }
24 const std::string summary() const override { return "Types of PDFgetN data files include .sqa, .sq, .gr, and etc."; }
25
27 int version() const override { return 1; }
28 const std::vector<std::string> seeAlso() const override { return {"LoadAscii"}; }
29
31 const std::string category() const override { return "Diffraction\\DataHandling;DataHandling\\Text"; }
32
33private:
35 void init() override;
37 void exec() override;
39 int confidence(Kernel::FileDescriptor &descriptor) const override;
40
42 void parseDataFile(const std::string &filename);
43
45 bool startsWith(const std::string &s, const std::string &header) const;
46
48 void parseColumnNameLine(std::string line);
49
51 void parseDataLine(std::string line);
52
55
57 std::vector<std::vector<double>> mData;
58
60 std::vector<std::string> mColumnNames;
61
63 void generateDataWorkspace();
64
66 void setUnit(const DataObjects::Workspace2D_sptr &ws);
67
68 void checkSameSize(const std::vector<size_t> &numptsvec, size_t numsets);
69};
70
71} // namespace DataHandling
72} // namespace Mantid
Defines an interface to an algorithm that loads a file so that it can take part in the automatic sele...
Definition: IFileLoader.h:19
LoadPDFgetNFile : TODO: DESCRIPTION.
const std::string summary() const override
Summary of algorithms purpose.
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
std::vector< std::string > mColumnNames
Names of the columns of the data.
DataObjects::Workspace2D_sptr outWS
Output data workspace.
std::vector< std::vector< double > > mData
Data structure to hold input: Size = Number of columns in input file.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
int version() const override
Algorithm's version for identification overriding a virtual method.
Defines a wrapper around an open file.
bool startsWith(const string &str, const string &prefix)
Returns true if str starts with prefix.
std::shared_ptr< Workspace2D > Workspace2D_sptr
shared pointer to Mantid::DataObjects::Workspace2D
Helper class which provides the Collimation Length for SANS instruments.