Mantid
Loading...
Searching...
No Matches
LoadRaw3.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
8#include "LoadRaw/isisraw2.h"
21
22#include <Poco/Path.h>
23#include <cmath>
24#include <cstdio> //Required for gcc 4.4
25#include <memory>
26
27namespace Mantid::DataHandling {
29
30using namespace Kernel;
31using namespace API;
32
35 : m_filename(), m_numberOfSpectra(), m_cache_options(), m_specTimeRegimes(), m_noTimeRegimes(0), m_prog(0.0),
36 m_prog_start(0.0), m_prog_end(1.0), m_lengthIn(0), m_timeChannelsVec(), m_total_specs(0), m_periodList() {}
37
41 auto mustBePositive = std::make_shared<BoundedValidator<int>>();
42 mustBePositive->setLower(1);
43 declareProperty("SpectrumMin", 1, mustBePositive,
44 "The index number of the first spectrum to read. Only used if\n"
45 "SpectrumMax is set.");
46 declareProperty("SpectrumMax", EMPTY_INT(), mustBePositive,
47 "The number of the last spectrum to read. Only used if explicitly\n"
48 "set.");
49 declareProperty(std::make_unique<ArrayProperty<specnum_t>>("SpectrumList"),
50 "A comma-separated list of individual spectra to read. Only used if\n"
51 "explicitly set.");
52 declareProperty(std::make_unique<ArrayProperty<int>>("PeriodList"),
53 "A comma-separated list of individual periods to read. Only used if\n"
54 "explicitly set.");
55
56 std::vector<std::string> monitorOptions;
57 monitorOptions.emplace_back("Include");
58 monitorOptions.emplace_back("Exclude");
59 monitorOptions.emplace_back("Separate");
60 std::map<std::string, std::string> monitorOptionsAliases;
61 monitorOptionsAliases["1"] = "Separate";
62 monitorOptionsAliases["0"] = "Exclude";
63 declareProperty("LoadMonitors", "Include",
64 std::make_shared<StringListValidator>(monitorOptions, monitorOptionsAliases),
65 "Option to control the loading of monitors.\n"
66 "Allowed options are Include,Exclude, Separate.\n"
67 "Include:The default is Include option which loads the "
68 "monitors into the output workspace.\n"
69 "Exclude:The Exclude option excludes monitors from the "
70 "output workspace.\n"
71 "Separate:The Separate option loads monitors into a separate "
72 "workspace called OutputWorkspace_monitor.\n"
73 "Defined aliases:\n"
74 "1: Equivalent to Separate.\n"
75 "0: Equivalent to Exclude.\n");
76}
77
85 // Retrieve the filename from the properties
86 m_filename = getPropertyValue("Filename");
87 // open the raw file
88 FILE *file = openRawFile(m_filename);
89
90 bool bLoadlogFiles = getProperty("LoadLogFiles");
91
92 bool bincludeMonitors, bseparateMonitors, bexcludeMonitors;
93 LoadRawHelper::ProcessLoadMonitorOptions(bincludeMonitors, bseparateMonitors, bexcludeMonitors, this);
94
95 std::string title;
96 // read workspace title from raw file
97 readTitle(file, title);
98
99 // read workspace dimensions,number of periods etc from the raw file.
101
103 // to validate the optional parameters, if set
105
106 // Calculate the size of a workspace, given its number of periods & spectra to
107 // read
109
110 // Get the time channel array(s) and store in a vector inside a shared pointer
112
113 // The first period to load
114 int firstPeriod = isSelectedPeriods() ? m_periodList.front() - 1 : 0;
115
116 // Create the 2D workspace for the output
118
119 // Only run the Child Algorithms once
120 loadRunParameters(localWorkspace);
121 const SpectrumDetectorMapping detectorMapping(isisRaw().spec, isisRaw().udet, isisRaw().i_det);
122 localWorkspace->updateSpectraUsing(detectorMapping);
123
124 runLoadInstrument(m_filename, localWorkspace, 0.0, 0.4);
125 m_prog_start = 0.4;
126 Run &run = localWorkspace->mutableRun();
127 if (bLoadlogFiles) {
128 runLoadLog(m_filename, localWorkspace, 0.4, 0.5);
129 m_prog_start = 0.5;
130 const int period_number = firstPeriod + 1;
131 createPeriodLogs(period_number, localWorkspace);
132 }
133 // Set the total proton charge for this run
134 setProtonCharge(run);
135 setRunNumber(run);
136 run.addProperty("raw_filename", m_filename);
137
138 // Set progress to start of range taking account of ChildAlgorithms
139 setProg(0.0);
140
141 // populate instrument parameters
142 g_log.debug("Populating the instrument parameters...");
143 progress(m_prog, "Populating the instrument parameters...");
144 localWorkspace->populateInstrumentParameters();
145
147 WorkspaceGroup_sptr monitorws_grp;
148 DataObjects::Workspace2D_sptr monitorWorkspace;
149 specnum_t normalwsSpecs = 0;
150 specnum_t monitorwsSpecs = 0;
151 std::vector<specnum_t> monitorSpecList;
152
153 if (bincludeMonitors) {
154 setWorkspaceProperty("OutputWorkspace", title, ws_grp, localWorkspace, m_numberOfPeriods, false, this);
155 } else {
156 // gets the monitor spectra list from workspace
157 monitorSpecList = getmonitorSpectrumList(detectorMapping);
158 // calculate the workspace size for normal workspace and monitor workspace
159 calculateWorkspacesizes(monitorSpecList, normalwsSpecs, monitorwsSpecs);
160 try {
161 validateWorkspaceSizes(bexcludeMonitors, bseparateMonitors, normalwsSpecs, monitorwsSpecs);
162 } catch (std::out_of_range &) {
163 fclose(file);
164 throw;
165 }
166
167 // now create a workspace of size normalwsSpecs and set it as output
168 // workspace
169 if (normalwsSpecs > 0) {
170 localWorkspace = createWorkspace(localWorkspace, normalwsSpecs, m_lengthIn, m_lengthIn - 1);
171 setWorkspaceProperty("OutputWorkspace", title, ws_grp, localWorkspace, m_numberOfPeriods, false, this);
172 }
173 // now create monitor workspace if separateMonitors selected
174 if (bseparateMonitors) {
175 createMonitorWorkspace(monitorWorkspace, localWorkspace, monitorws_grp, monitorwsSpecs, normalwsSpecs,
176 m_numberOfPeriods, m_lengthIn, title, this);
177 }
178 }
179
180 if (bseparateMonitors) {
181 if (normalwsSpecs == 0) {
182 // Ensure we fill the correct group as if we are only
183 // loading monitors then
184 // we essentially want normal behavior
185 // with no extra _monitors workspace
186 ws_grp = monitorws_grp;
187 } else { // attach monitor workspace to main workspace
188 localWorkspace->setMonitorWorkspace(monitorWorkspace);
189 }
190 }
191
192 // Loop over the number of periods in the raw file, putting each period in a
193 // separate workspace
194
195 for (int period = 0; period < m_numberOfPeriods; ++period) {
196 // skipping the first spectra in each period
197 skipData(file, static_cast<int>(period * (m_numberOfSpectra + 1)));
198
199 // check for excluded periods
200 if (!isPeriodIncluded(period)) {
201 skipPeriod(file, period);
202 continue;
203 }
204
205 if (period > firstPeriod) {
206 if (localWorkspace) {
207 localWorkspace = createWorkspace(localWorkspace);
208 }
209 if (bseparateMonitors) {
210 try {
211 monitorWorkspace = createWorkspace(monitorWorkspace, monitorwsSpecs, m_lengthIn, m_lengthIn - 1);
212 } catch (std::out_of_range &) {
213 g_log.information() << "Separate Monitors option is selected and no "
214 "monitors in the selected specra range.\n";
215 g_log.information() << "Error in creating one of the output workspaces\n";
216 } catch (std::runtime_error &) {
217 g_log.information() << "Separate Monitors option is selected,Error "
218 "in creating one of the output workspaces\n";
219 }
220 } // end of separate Monitors
221
222 if (bLoadlogFiles) {
223 const int period_number = period + 1;
224 // remove previous period data
225 std::stringstream prevPeriod;
226 prevPeriod << "PERIOD " << (getPreviousPeriod(period_number));
227 if (localWorkspace) {
228 Run &runObj = localWorkspace->mutableRun();
229 runObj.removeLogData(prevPeriod.str());
230 runObj.removeLogData("current_period");
231 // add current period data
232 createPeriodLogs(period_number, localWorkspace);
233 }
234 if (monitorWorkspace) {
235 Run &runObj = monitorWorkspace->mutableRun();
236 runObj.removeLogData(prevPeriod.str());
237 runObj.removeLogData("current_period");
238 // add current period data
239 createPeriodLogs(period_number, monitorWorkspace);
240 }
241 } // end of if loop for loadlogfiles
242 }
243
244 if (bexcludeMonitors) {
245 excludeMonitors(file, period, monitorSpecList, localWorkspace);
246 }
247 if (bincludeMonitors) {
248 includeMonitors(file, period, localWorkspace);
249 }
250 if (bseparateMonitors) {
251 separateMonitors(file, period, monitorSpecList, localWorkspace, monitorWorkspace);
252 }
253
254 // Re-update spectra etc.
255 if (localWorkspace)
256 localWorkspace->updateSpectraUsing(detectorMapping);
257
258 if (monitorWorkspace)
259 monitorWorkspace->updateSpectraUsing(detectorMapping);
260
261 // Assign the result to the output workspace property
262 if (m_numberOfPeriods > 1) {
263 if (bseparateMonitors) {
264 if (normalwsSpecs > 0) {
265 // declare and set monitor workspace for each period
266 setWorkspaceProperty(monitorWorkspace, monitorws_grp, period, true, this);
267 } else {
268 localWorkspace = monitorWorkspace;
269 }
270 // declare and set output workspace for each period
271 setWorkspaceProperty(localWorkspace, ws_grp, period, false, this);
272 } else {
273 setWorkspaceProperty(localWorkspace, ws_grp, period, false, this);
274 }
275 // progress for workspace groups
276 setProg(static_cast<double>(period) / static_cast<double>(m_numberOfPeriods - 1));
277 }
278
279 } // loop over periods
280 // Clean up
281
282 reset();
283 fclose(file);
284}
291void LoadRaw3::excludeMonitors(FILE *file, const int &period, const std::vector<specnum_t> &monitorList,
292 const DataObjects::Workspace2D_sptr &ws_sptr) {
293 int64_t histCurrent = -1;
294 int64_t wsIndex = 0;
295 auto histTotal = static_cast<double>(m_total_specs * m_numberOfPeriods);
296 // loop through the spectra
297 for (specnum_t i = 1; i <= m_numberOfSpectra; ++i) {
298 specnum_t histToRead = i + period * (m_numberOfSpectra + 1);
299 if ((i >= m_spec_min && i < m_spec_max) ||
300 (m_list && find(m_spec_list.begin(), m_spec_list.end(), i) != m_spec_list.end())) {
301 progress(m_prog, "Reading raw file data...");
302 // skip monitor spectrum
303 if (isMonitor(monitorList, i)) {
304 skipData(file, histToRead);
305 continue;
306 }
307
308 // read spectrum
309 if (!readData(file, histToRead)) {
310 throw std::runtime_error("Error reading raw file");
311 }
312 // set the workspace data
314 // increment workspace index
315 ++wsIndex;
316
317 if (m_numberOfPeriods == 1) {
318 if (++histCurrent % 100 == 0) {
319 setProg(static_cast<double>(histCurrent) / histTotal);
320 }
322 }
323
324 } // end of if loop for spec min,max check
325 else {
326 skipData(file, histToRead);
327 }
328 } // end of for loop
329}
330
336void LoadRaw3::includeMonitors(FILE *file, const int64_t &period, const DataObjects::Workspace2D_sptr &ws_sptr) {
337
338 int64_t histCurrent = -1;
339 int64_t wsIndex = 0;
340 auto histTotal = static_cast<double>(m_total_specs * m_numberOfPeriods);
341 // loop through spectra
342 for (specnum_t i = 1; i <= m_numberOfSpectra; ++i) {
343 int64_t histToRead = i + period * (m_numberOfSpectra + 1);
344 if ((i >= m_spec_min && i < m_spec_max) ||
345 (m_list && find(m_spec_list.begin(), m_spec_list.end(), i) != m_spec_list.end())) {
346 progress(m_prog, "Reading raw file data...");
347
348 // read spectrum from raw file
349 if (!readData(file, histToRead)) {
350 throw std::runtime_error("Error reading raw file");
351 }
352 // set workspace data
354 ++wsIndex;
355
356 if (m_numberOfPeriods == 1) {
357 if (++histCurrent % 100 == 0) {
358 setProg(double(histCurrent) / histTotal);
359 }
361 }
362
363 } else {
364 skipData(file, histToRead);
365 }
366 }
367 // loadSpectra(file,period,m_total_specs,ws_sptr,m_timeChannelsVec);
368}
369
378void LoadRaw3::separateMonitors(FILE *file, const int64_t &period, const std::vector<specnum_t> &monitorList,
379 const DataObjects::Workspace2D_sptr &ws_sptr,
380 const DataObjects::Workspace2D_sptr &mws_sptr) {
381 int64_t histCurrent = -1;
382 int64_t wsIndex = 0;
383 int64_t mwsIndex = 0;
384 auto histTotal = static_cast<double>(m_total_specs * m_numberOfPeriods);
385 // loop through spectra
386 for (specnum_t i = 1; i <= m_numberOfSpectra; ++i) {
387 int64_t histToRead = i + period * (m_numberOfSpectra + 1);
388 if ((i >= m_spec_min && i < m_spec_max) ||
389 (m_list && find(m_spec_list.begin(), m_spec_list.end(), i) != m_spec_list.end())) {
390 progress(m_prog, "Reading raw file data...");
391
392 // read spectrum from raw file
393 if (!readData(file, histToRead)) {
394 throw std::runtime_error("Error reading raw file");
395 }
396 // if this a monitor, store that spectrum to monitor workspace
397 if (isMonitor(monitorList, i)) {
399 ++mwsIndex;
400 } else {
401 // not a monitor, store the spectrum to normal output workspace
403 ++wsIndex;
404 }
405
406 if (m_numberOfPeriods == 1) {
407 if (++histCurrent % 100 == 0) {
408 setProg(static_cast<double>(histCurrent) / histTotal);
409 }
411 }
412
413 } else {
414 skipData(file, histToRead);
415 }
416 }
417}
418
424void LoadRaw3::skipPeriod(FILE *file, const int64_t &period) {
425 for (specnum_t i = 1; i <= m_numberOfSpectra; ++i) {
426 int64_t histToRead = i + period * (m_numberOfSpectra + 1);
427 skipData(file, histToRead);
428 }
429}
430
434bool LoadRaw3::isPeriodIncluded(int period) const {
435 return !isSelectedPeriods() || std::find(m_periodList.begin(), m_periodList.end(), period + 1) != m_periodList.end();
436}
437
442int LoadRaw3::getPreviousPeriod(int period) const {
443 if (isSelectedPeriods()) {
444 // find period number preceding the argument in the period list
445 auto pitr = std::find(m_periodList.begin(), m_periodList.end(), period);
446 if (pitr == m_periodList.end() || pitr == m_periodList.begin()) {
447 throw std::logic_error("Unexpected period number found.");
448 }
449 return *(--pitr);
450 }
451 return period - 1;
452}
453
456 // read in the settings passed to the algorithm
457 m_spec_list = getProperty("SpectrumList");
458 m_spec_max = getProperty("SpectrumMax");
459 m_spec_min = getProperty("SpectrumMin");
460 m_periodList = getProperty("PeriodList");
461 if (!m_periodList.empty()) {
462 // periods will be expected in ascending order
463 std::sort(m_periodList.begin(), m_periodList.end());
464 // check that the periods are within their range: 1 <= p <=
465 // m_numberOfPeriods
466 auto minElement = std::min_element(m_periodList.begin(), m_periodList.end());
467 auto maxElement = std::max_element(m_periodList.begin(), m_periodList.end());
468 if (*minElement < 1 || *maxElement > m_numberOfPeriods) {
469 throw std::runtime_error("Values in PeriodList must be between 1 and "
470 "total number of periods.");
471 }
472 }
473}
474
477void LoadRaw3::setProg(double prog) { m_prog = m_prog_start + (m_prog_end - m_prog_start) * prog; }
478
487void LoadRaw3::validateWorkspaceSizes(bool bexcludeMonitors, bool bseparateMonitors, const int64_t normalwsSpecs,
488 const int64_t monitorwsSpecs) {
489 if (normalwsSpecs <= 0 && bexcludeMonitors) {
490 throw std::out_of_range("All the spectra in the selected range for this "
491 "workspace are monitors and Exclude monitors "
492 "option selected ");
493 }
494 if (bseparateMonitors) {
495 if (normalwsSpecs <= 0 && monitorwsSpecs <= 0) {
496 throw std::out_of_range("Workspace size is zero,Error in creating output workspace.");
497 }
498 }
499}
500
506bool LoadRaw3::isMonitor(const std::vector<specnum_t> &monitorIndexes, specnum_t spectrumNum) {
507 return (find(monitorIndexes.begin(), monitorIndexes.end(), spectrumNum) != monitorIndexes.end());
508}
509
510} // namespace Mantid::DataHandling
#define DECLARE_FILELOADER_ALGORITHM(classname)
DECLARE_FILELOADER_ALGORITHM should be used in place of the standard DECLARE_ALGORITHM macro when wri...
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
Definition: Algorithm.cpp:1913
std::string getPropertyValue(const std::string &name) const override
Get the value of a property as a string.
Definition: Algorithm.cpp:2026
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
Definition: Algorithm.cpp:2076
void progress(double p, const std::string &msg="", double estimatedTime=0.0, int progressPrecision=0)
Sends ProgressNotification.
Definition: Algorithm.cpp:231
void interruption_point()
This is called during long-running operations, and check if the algorithm has requested that it be ca...
Definition: Algorithm.cpp:1687
void addProperty(Kernel::Property *prop, bool overwrite=false)
Add data to the object in the form of a property.
Definition: LogManager.h:79
void removeLogData(const std::string &name, const bool delproperty=true)
Remove a named log entry.
Definition: LogManager.h:140
This class stores information regarding an experimental run as a series of log entries.
Definition: Run.h:38
A minimal class to hold the mapping between the spectrum number and its related detector ID numbers f...
std::vector< std::shared_ptr< HistogramData::HistogramX > > m_timeChannelsVec
time channels vector
Definition: LoadRaw3.h:111
int64_t m_lengthIn
Read in the time bin boundaries.
Definition: LoadRaw3.h:109
int64_t m_noTimeRegimes
number of time regime
Definition: LoadRaw3.h:101
std::vector< int > m_periodList
A list of periods to read. Each value is between 1 and m_numberOfPeriods.
Definition: LoadRaw3.h:115
void exec() override
Overwrites Algorithm method.
Definition: LoadRaw3.cpp:84
int getPreviousPeriod(int period) const
get the previous period number
Definition: LoadRaw3.cpp:442
void separateMonitors(FILE *file, const int64_t &period, const std::vector< specnum_t > &monitorList, const DataObjects::Workspace2D_sptr &ws_sptr, const DataObjects::Workspace2D_sptr &mws_sptr)
creates two output workspaces none normal workspace and separate one for monitors
Definition: LoadRaw3.cpp:378
void setProg(double)
sets progress taking account of progress time taken up by ChildAlgorithms
Definition: LoadRaw3.cpp:477
std::string m_filename
The name and path of the input file.
Definition: LoadRaw3.h:92
bool isPeriodIncluded(int period) const
check if a period should be loaded
Definition: LoadRaw3.cpp:434
void includeMonitors(FILE *file, const int64_t &period, const DataObjects::Workspace2D_sptr &ws_sptr)
creates output workspace whcih includes monitors
Definition: LoadRaw3.cpp:336
double m_prog_start
Start and ends values of progress counter.
Definition: LoadRaw3.h:105
void validateWorkspaceSizes(bool bexcludeMonitors, bool bseparateMonitors, const int64_t normalwsSpecs, const int64_t monitorwsSpecs)
validate workspace sizes
Definition: LoadRaw3.cpp:487
int64_t m_total_specs
total number of specs
Definition: LoadRaw3.h:113
LoadRaw3()
Default constructor.
Definition: LoadRaw3.cpp:34
double m_prog
The current value of the progress counter.
Definition: LoadRaw3.h:103
bool isSelectedPeriods() const
return true if loading a selection of periods
Definition: LoadRaw3.h:79
void setOptionalProperties()
sets optional properties
Definition: LoadRaw3.cpp:455
void skipPeriod(FILE *file, const int64_t &period)
skip all spectra in a period
Definition: LoadRaw3.cpp:424
void init() override
Overwrites Algorithm method.
Definition: LoadRaw3.cpp:39
bool isMonitor(const std::vector< specnum_t > &monitorIndexes, specnum_t spectrumNum)
returns true if the given spectrum is a monitor
Definition: LoadRaw3.cpp:506
void excludeMonitors(FILE *file, const int &period, const std::vector< specnum_t > &monitorList, const DataObjects::Workspace2D_sptr &ws_sptr)
creates output workspace, monitors excluded from this workspace
Definition: LoadRaw3.cpp:291
specnum_t m_numberOfSpectra
The number of spectra in the raw file.
Definition: LoadRaw3.h:95
std::vector< std::shared_ptr< HistogramData::HistogramX > > getTimeChannels(const int64_t &regimes, const int64_t &lengthIn)
Constructs the time channel (X) vector(s)
void reset()
resets the isisraw shared pointer
void calculateWorkspacesizes(const std::vector< specnum_t > &monitorSpecList, specnum_t &normalwsSpecs, specnum_t &monitorwsSpecs)
calculate workspace sizes if separate or exclude monitors are selected
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 void ProcessLoadMonitorOptions(bool &bincludeMonitors, bool &bseparateMonitors, bool &bexcludeMonitors, API::Algorithm *const pAlgo)
The method to interpret LoadMonitors property options and convert then into boolean values.
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
static void createMonitorWorkspace(DataObjects::Workspace2D_sptr &monws_sptr, const DataObjects::Workspace2D_sptr &normalws_sptr, API::WorkspaceGroup_sptr &mongrp_sptr, const int64_t mwsSpecs, const int64_t nwsSpecs, const int64_t numberOfPeriods, const int64_t lengthIn, const std::string &title, API::Algorithm *const pAlg)
creates monitor workspace
ISISRAW2 & isisRaw() const
return an reference to the ISISRAW2 reader
void init() override
Overwrites Algorithm method.
specnum_t m_spec_max
The value of the spectrum_max property.
std::vector< specnum_t > m_spec_list
The value of the spectrum_list property.
bool readData(FILE *file, int hist)
reads data
void createPeriodLogs(int64_t period, const DataObjects::Workspace2D_sptr &local_workspace)
Create the period specific logs.
specnum_t m_spec_min
The value of the spectrum_min property.
void runLoadLog(const std::string &fileName, const DataObjects::Workspace2D_sptr &, double, double)
load log algorithm
void setRunNumber(API::Run &run)
Stores the run number in the sample's logs.
void loadRunParameters(const API::MatrixWorkspace_sptr &localWorkspace, ISISRAW *const =nullptr) const
Read in run parameters Public so that LoadRaw2 can use it.
void runLoadInstrument(const std::string &fileName, const DataObjects::Workspace2D_sptr &, double, double)
loadinstrument Child 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
bool m_list
Has the spectrum_list property been set?
void setProtonCharge(API::Run &run)
set proton charge
static API::WorkspaceGroup_sptr createGroupWorkspace()
creates shared pointer to group workspace
specnum_t calculateWorkspaceSize()
calculate workspace size
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.
void checkOptionalProperties()
Validates the optional 'spectra to read' properties, if they have been set.
std::vector< specnum_t > getmonitorSpectrumList(const API::SpectrumDetectorMapping &mapping)
gets the monitor spectrum list from the workspace
int m_numberOfPeriods
The number of periods in the raw file.
Support for a property that holds an array of values.
Definition: ArrayProperty.h:28
void debug(const std::string &msg)
Logs at debug level.
Definition: Logger.cpp:114
void information(const std::string &msg)
Logs at information level.
Definition: Logger.cpp:105
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
constexpr int EMPTY_INT() noexcept
Returns what we consider an "empty" integer within a property.
Definition: EmptyValues.h:25
int32_t specnum_t
Typedef for a spectrum Number.
Definition: IDTypes.h:16