Mantid
Loading...
Searching...
No Matches
LoadGSASInstrumentFile.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2014 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"
12
13namespace Poco {
14namespace XML {
15class Document;
16class Element;
17} // namespace XML
18} // namespace Poco
19
20namespace Mantid {
21namespace DataHandling {
22
25class MANTID_DATAHANDLING_DLL LoadGSASInstrumentFile final : public API::Algorithm {
26public:
28 const std::string name() const override { return "LoadGSASInstrumentFile"; }
30 const std::string summary() const override { return "Load parameters from a GSAS Instrument file."; }
31
33 int version() const override { return 1; }
34 const std::vector<std::string> seeAlso() const override {
35 return {"SaveGSASInstrumentFile", "LoadGSS", "FixGSASInstrumentFile"};
36 }
37
39 const std::string category() const override { return "Diffraction\\DataHandling"; }
40
41private:
43 void init() override;
45 void exec() override;
46
48 void loadFile(const std::string &filename, std::vector<std::string> &lines);
49
51 std::string getHistogramType(const std::vector<std::string> &lines);
52
54 size_t getNumberOfBanks(const std::vector<std::string> &lines);
55
57 void scanBanks(const std::vector<std::string> &lines, std::vector<size_t> &bankStartIndex);
58
60 void parseBank(std::map<std::string, double> &parammap, const std::vector<std::string> &lines, size_t bankid,
61 size_t startlineindex);
62
64 size_t findINSPRCFLine(const std::vector<std::string> &lines, size_t lineIndex, double &param1, double &param2,
65 double &param3, double &param4);
66
68 DataObjects::TableWorkspace_sptr genTableWorkspace(std::map<size_t, std::map<std::string, double>> bankparammap);
69};
70
71} // namespace DataHandling
72} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
LoadGSASInstrumentFile : Load GSAS instrument file to TableWorkspace(s)
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
int version() const override
Algorithm's version for identification overriding a virtual method.
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
const std::string summary() const override
Summary of algorithms purpose.
std::shared_ptr< TableWorkspace > TableWorkspace_sptr
shared pointer to Mantid::DataObjects::TableWorkspace
Helper class which provides the Collimation Length for SANS instruments.
Definition: Algorithm.h:30