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