10#include "MantidDataHandling/DllConfig.h"
13#include <unordered_map>
16using ColumnMap = std::unordered_map<std::string, Column>;
20namespace DataHandling {
35 const std::string name()
const override;
36 const std::string summary()
const override;
37 int version()
const override;
38 const std::vector<std::string>
seeAlso()
const override {
return {
"SaveSESANS"}; }
39 const std::string category()
const override;
44 const std::string m_spinEchoLength =
"SpinEchoLength";
45 const std::string m_wavelength =
"Wavelength";
46 const std::string m_depolarisation =
"Depolarisation";
47 const std::string m_depolarisationError =
"Depolarisation_error";
48 const std::string m_beginData =
"BEGIN_DATA";
50 const std::vector<std::string> m_mandatoryAttributes{
51 "FileFormatVersion",
"DataFileTitle",
"Sample",
"Thickness",
"Thickness_unit",
52 "Theta_zmax",
"Theta_zmax_unit",
"Theta_ymax",
"Theta_ymax_unit",
"Orientation",
53 "SpinEchoLength_unit",
"Depolarisation_unit",
"Wavelength_unit"};
54 const std::vector<std::string> m_mandatoryColumnHeaders{m_spinEchoLength, m_wavelength, m_depolarisation,
55 m_depolarisationError};
56 const std::vector<std::string> m_fileExtensions{
".ses",
".SES",
".sesans",
".SESANS"};
62 AttributeMap consumeHeaders(std::ifstream &infile, std::string &line,
int &lineNum);
63 ColumnMap consumeData(std::ifstream &infile, std::string &line,
int &lineNum);
64 std::pair<std::string, std::string> splitHeader(
const std::string &line,
const int &lineNum);
66 void checkMandatoryHeaders(
const AttributeMap &attributes);
68 void throwFormatError(
const std::string &line,
const std::string &message,
const int &lineNum);
std::unordered_map< std::string, Column > ColumnMap
std::unordered_map< std::string, std::string > AttributeMap
std::vector< double > Column
Defines an interface to an algorithm that loads a file so that it can take part in the automatic sele...
LoadSESANS : Load a workspace in the SESANS file format.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Defines a wrapper around an open file.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.