27using namespace Kernel;
32 : isisRaw(), m_filename(), m_numberOfSpectra(0), m_cache_options(), m_specTimeRegimes(), m_prog(0.0), m_lengthIn(0),
59 throw std::invalid_argument(
"Incorrect file type encountered.");
69 const int64_t total_specs = 1;
75 int64_t histCurrent = -1;
80 Run &run = localWorkspace->mutableRun();
84 const int period_number = 1;
102 std::stringstream prevPeriod;
103 prevPeriod <<
"PERIOD " << (period);
104 Run &runObj = localWorkspace->mutableRun();
106 runObj.removeLogData(
"current_period");
108 auto period_number =
static_cast<int>(period + 1);
126 throw std::runtime_error(
"Error reading raw file");
133 if (++histCurrent % 100 == 0) {
134 m_prog = double(histCurrent) / histTotal;
#define DECLARE_ALGORITHM(classname)
std::string getPropertyValue(const std::string &name) const override
Get the value of a property as a string.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
void progress(double p, const std::string &msg="", double estimatedTime=0.0, int progressPrecision=0)
Sends ProgressNotification.
void interruption_point()
This is called during long-running operations, and check if the algorithm has requested that it be ca...
void removeLogData(const std::string &name, const bool delproperty=true)
Remove a named log entry.
This class stores information regarding an experimental run as a series of log entries.
std::vector< std::shared_ptr< HistogramData::HistogramX > > getTimeChannels(const int64_t ®imes, const int64_t &lengthIn)
Constructs the time channel (X) vector(s)
void reset()
resets the isisraw shared pointer
void readTitle(FILE *file, std::string &title)
Reads title from the isisraw class.
void skipData(FILE *file, int hist)
skips histrogram data from raw file.
static void setWorkspaceProperty(const std::string &propertyName, const std::string &title, const API::WorkspaceGroup_sptr &grpws_sptr, const DataObjects::Workspace2D_sptr &ws_sptr, int64_t numberOfPeriods, bool bMonitor, API::Algorithm *const pAlg)
sets the workspace property
static DataObjects::Workspace2D_sptr createWorkspace(const DataObjects::Workspace2D_sptr &ws_sptr, int64_t nVectors=-1, int64_t xLengthIn=-1, int64_t yLengthIn=-1)
creates shared pointer to workspace from parent workspace
void init() override
Overwrites Algorithm method.
bool readData(FILE *file, int hist)
reads data
void createPeriodLogs(int64_t period, const DataObjects::Workspace2D_sptr &local_workspace)
Create the period specific logs.
void runLoadLog(const std::string &fileName, const DataObjects::Workspace2D_sptr &, double, double)
load log algorithm
FILE * openRawFile(const std::string &fileName)
Opens Raw File.
void readworkspaceParameters(specnum_t &numberOfSpectra, int &numberOfPeriods, int64_t &lengthIn, int64_t &noTimeRegimes)
reads workspace parameters like number of histograms,size of vectors etc
void setProtonCharge(API::Run &run)
set proton charge
static API::WorkspaceGroup_sptr createGroupWorkspace()
creates shared pointer to group workspace
void setWorkspaceData(const DataObjects::Workspace2D_sptr &newWorkspace, const std::vector< std::shared_ptr< HistogramData::HistogramX > > &timeChannelsVec, int64_t wsIndex, specnum_t nspecNum, int64_t noTimeRegimes, int64_t lengthIn, int64_t binStart)
This method sets the raw file data to workspace vectors.
int m_numberOfPeriods
The number of periods in the raw file.
LoadRawSpectrum0()
Default constructor.
int64_t m_lengthIn
Read in the time bin boundaries.
void exec() override
Overwrites Algorithm method.
double m_prog
The current value of the progress counter.
std::string m_filename
The name and path of the input file.
int64_t m_noTimeRegimes
number of time regime
specnum_t m_numberOfSpectra
The number of spectra in the raw file.
void init() override
Overwrites Algorithm method.
bool isAscii() const
Returns true if the descriptor is looking at an ascii file.
void error(const std::string &msg)
Logs at error level.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
std::shared_ptr< WorkspaceGroup > WorkspaceGroup_sptr
shared pointer to Mantid::API::WorkspaceGroup
Kernel::Logger g_log("ExperimentInfo")
static logger object
std::shared_ptr< Workspace2D > Workspace2D_sptr
shared pointer to Mantid::DataObjects::Workspace2D
std::unique_ptr< T > create(const P &parent, const IndexArg &indexArg, const HistArg &histArg)
This is the create() method that all the other create() methods call.