Newer
Older
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2010 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
Gigg, Martyn Anthony
committed
//---------------------------------------------------
// Includes
//---------------------------------------------------
#include "MantidAPI/IFileLoader.h"
#include "MantidKernel/FileDescriptor.h"

Zhou, Wenduo
committed
namespace Mantid {
namespace DataHandling {
Gigg, Martyn Anthony
committed
/**
Loads a file as saved by SaveGSS
@author Michael Whitty, ISIS Facility, Rutherford Appleton Laboratory
@date 01/09/2010
*/
class DLLExport LoadGSS : public API::IFileLoader<Kernel::FileDescriptor> {
Gigg, Martyn Anthony
committed
public:
/// Algorithm's name
const std::string name() const override { return "LoadGSS"; }
const std::string summary() const override {
return "Loads a GSS file such as that saved by SaveGSS. This is not a "
"lossless process, as SaveGSS truncates some data. There is no "
"instrument assosciated with the resulting workspace. 'Please "
"Note': Due to limitations of the GSS file format, the process of "
"going from Mantid to a GSS file and back is not perfect.";
}
Gigg, Martyn Anthony
committed
/// Algorithm's version
int version() const override { return (1); }
const std::vector<std::string> seeAlso() const override {
return {"LoadAscii", "SaveGSS", "LoadMultipleGSS"};
Gigg, Martyn Anthony
committed
/// Algorithm's category for identification
const std::string category() const override {
return "Diffraction\\DataHandling;DataHandling\\Text";
Gigg, Martyn Anthony
committed
/// Returns a confidence value that this algorithm can load a file
int confidence(Kernel::FileDescriptor &descriptor) const override;
Gigg, Martyn Anthony
committed
private:
/// Initialisation code
API::MatrixWorkspace_sptr loadGSASFile(const std::string &filename,
bool useBankAsSpectrum);
/// Convert a string (value+unit) to double (value)

Zhou, Wenduo
committed
double convertToDouble(std::string inputstring);
void createInstrumentGeometry(API::MatrixWorkspace_sptr workspace,
const std::string &instrumentname,
const double &primaryflightpath,
const std::vector<int> &detectorids,
const std::vector<double> &totalflightpaths,
const std::vector<double> &twothetas);
Gigg, Martyn Anthony
committed
};
} // namespace Mantid