13#include "MantidDataHandling/DllConfig.h"
16#include "MantidHistogramData/HistogramX.h"
18#include "MantidTypes/Core/DateAndTime.h"
19#include "MantidTypes/SpectrumDefinition.h"
31class SpectrumDetectorMapping;
34namespace DataHandling {
46 const std::string
name()
const override {
return "LoadRawHelper"; }
48 int version()
const override {
return 1; }
50 const std::string
summary()
const override {
return "Helper class for LoadRaw algorithms."; }
52 FILE *openRawFile(
const std::string &fileName);
60 static std::list<std::string> searchForLogFiles(
const std::filesystem::path &pathToRawFile);
62 static bool isExcludeMonitors(
const std::string &monitorOption);
64 static bool isSeparateMonitors(
const std::string &monitorOption);
66 static bool isIncludeMonitors(
const std::string &monitorOption);
68 static void ProcessLoadMonitorOptions(
bool &bincludeMonitors,
bool &bseparateMonitors,
bool &bexcludeMonitors,
74 const int64_t nwsSpecs,
const int64_t numberOfPeriods,
const int64_t lengthIn,
81 int64_t nVectors = -1, int64_t xLengthIn = -1,
82 int64_t yLengthIn = -1);
86 const std::string &title);
89 static void setWorkspaceProperty(
const std::string &propertyName,
const std::string &title,
107 void init()
override;
109 void readTitle(FILE *file, std::string &title);
111 void readworkspaceParameters(
specnum_t &numberOfSpectra,
int &numberOfPeriods, int64_t &lengthIn,
112 int64_t &noTimeRegimes);
115 void skipData(FILE *file,
int hist);
116 void skipData(FILE *file, int64_t hist);
119 void ioRaw(FILE *file,
bool from_file);
122 bool readData(FILE *file,
int hist);
123 bool readData(FILE *file, int64_t hist);
126 std::vector<std::shared_ptr<HistogramData::HistogramX>> getTimeChannels(
const int64_t ®imes,
127 const int64_t &lengthIn);
145 const std::vector<std::shared_ptr<HistogramData::HistogramX>> &timeChannelsVec, int64_t wsIndex,
146 specnum_t nspecNum, int64_t noTimeRegimes, int64_t lengthIn, int64_t binStart);
149 float getProtonCharge()
const;
151 void setProtonCharge(
API::Run &run);
156 int getNumberofTimeRegimes();
163 void setOptionalProperties(
const int &spec_min,
const int &spec_max,
const std::vector<int> &spec_list);
165 void checkOptionalProperties();
169 void calculateWorkspacesizes(
const std::vector<specnum_t> &monitorSpecList,
specnum_t &normalwsSpecs,
173 const std::vector<std::shared_ptr<HistogramData::HistogramX>> &);
190 void exec()
override;
192 static std::string convertMonthLabelToIntStr(std::string month);
219 std::string extractLogName(
const std::string &path);
Base class from which all concrete algorithm classes should be derived.
Defines an interface to an algorithm that loads a file so that it can take part in the automatic sele...
This class stores information regarding an experimental run as a series of log entries.
A minimal class to hold the mapping between the spectrum number and its related detector ID numbers f...
Helper class for LoadRaw algorithms.
bool m_interval
Have the spectrum_min/max properties been set?
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
specnum_t m_total_specs
the total nuumber of spectra
std::unique_ptr< API::ISISRunLogs > m_logCreator
A ptr to the log creator.
std::map< specnum_t, specnum_t > m_specTimeRegimes
A map for storing the time regime for each spectrum.
int version() const override
Algorithm's version for identification overriding a virtual method.
specnum_t m_spec_max
The value of the spectrum_max property.
bool m_bmspeclist
boolean for list spectra options
double m_prog
The current value of the progress counter.
std::vector< specnum_t > m_spec_list
The value of the spectrum_list property.
std::vector< std::string > m_cache_options
Allowed values for the cache property.
std::unique_ptr< ISISRAW2 > m_isis_raw
ISISRAW class instance which does raw file reading.
specnum_t m_spec_min
The value of the spectrum_min property.
specnum_t m_numberOfSpectra
number of spectra
~LoadRawHelper() override
Destructor.
bool m_list
Has the spectrum_list property been set?
const std::string summary() const override
Summary of algorithms purpose.
int m_numberOfPeriods
The number of periods in the raw file.
std::vector< specnum_t > m_monitordetectorList
a vector holding the indexes of monitors
Defines a wrapper around an open file.
std::shared_ptr< WorkspaceGroup > WorkspaceGroup_sptr
shared pointer to Mantid::API::WorkspaceGroup
std::shared_ptr< T > createWorkspace(InitArgs... args)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Mantid::Types::Core::DateAndTime DLLExport extractEndTime(const std::string &filename)
Gets the start time from the nexus file.
Mantid::Types::Core::DateAndTime DLLExport extractStartTime(const std::string &filename)
Extracts the start and the end time from a Nexus file.
std::shared_ptr< Workspace2D > Workspace2D_sptr
shared pointer to Mantid::DataObjects::Workspace2D
Helper class which provides the Collimation Length for SANS instruments.
int32_t specnum_t
Typedef for a spectrum Number.