15#include "MantidHistogramData/HistogramX.h"
17#include "MantidTypes/Core/DateAndTime.h"
18#include "MantidTypes/SpectrumDefinition.h"
33class SpectrumDetectorMapping;
36namespace DataHandling {
48 const std::string
name()
const override {
return "LoadRawHelper"; }
50 int version()
const override {
return 1; }
52 const std::string
summary()
const override {
return "Helper class for LoadRaw algorithms."; }
54 FILE *openRawFile(
const std::string &fileName);
62 static std::list<std::string> searchForLogFiles(
const Poco::Path &pathToRawFile);
64 static bool isExcludeMonitors(
const std::string &monitorOption);
66 static bool isSeparateMonitors(
const std::string &monitorOption);
68 static bool isIncludeMonitors(
const std::string &monitorOption);
70 static void ProcessLoadMonitorOptions(
bool &bincludeMonitors,
bool &bseparateMonitors,
bool &bexcludeMonitors,
76 const int64_t nwsSpecs,
const int64_t numberOfPeriods,
const int64_t lengthIn,
83 int64_t nVectors = -1, int64_t xLengthIn = -1,
84 int64_t yLengthIn = -1);
88 const std::string &title);
91 static void setWorkspaceProperty(
const std::string &propertyName,
const std::string &title,
109 void init()
override;
111 void readTitle(FILE *file, std::string &title);
113 void readworkspaceParameters(
specnum_t &numberOfSpectra,
int &numberOfPeriods, int64_t &lengthIn,
114 int64_t &noTimeRegimes);
117 void skipData(FILE *file,
int hist);
118 void skipData(FILE *file, int64_t hist);
121 void ioRaw(FILE *file,
bool from_file);
124 bool readData(FILE *file,
int hist);
125 bool readData(FILE *file, int64_t hist);
128 std::vector<std::shared_ptr<HistogramData::HistogramX>> getTimeChannels(
const int64_t ®imes,
129 const int64_t &lengthIn);
147 const std::vector<std::shared_ptr<HistogramData::HistogramX>> &timeChannelsVec, int64_t wsIndex,
148 specnum_t nspecNum, int64_t noTimeRegimes, int64_t lengthIn, int64_t binStart);
151 float getProtonCharge()
const;
153 void setProtonCharge(
API::Run &run);
158 int getNumberofTimeRegimes();
165 void setOptionalProperties(
const int &spec_min,
const int &spec_max,
const std::vector<int> &spec_list);
167 void checkOptionalProperties();
171 void calculateWorkspacesizes(
const std::vector<specnum_t> &monitorSpecList,
specnum_t &normalwsSpecs,
175 const std::vector<std::shared_ptr<HistogramData::HistogramX>> &);
192 void exec()
override;
194 static std::string convertMonthLabelToIntStr(std::string month);
221 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::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.
~LoadRawHelper()
Destructor.
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.
std::unique_ptr< ISISRunLogs > m_logCreator
A ptr to the log creator.
specnum_t m_spec_min
The value of the spectrum_min property.
specnum_t m_numberOfSpectra
number of spectra
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.