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"
22
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 SpectrumDetectorMapping detectorMapping(isisRaw().spec, isisRaw().udet, isisRaw().i_det);
122 localWorkspace->updateSpectraUsing(detectorMapping);
123
124 runLoadInstrument(m_filename, localWorkspace, 0.0, 0.4);
125
126 m_prog_start = 0.4;
127 Run &run = localWorkspace->mutableRun();
128 if (bLoadlogFiles) {
129 runLoadLog(m_filename, localWorkspace, 0.4, 0.5);
130 m_prog_start = 0.5;
131 const int period_number = firstPeriod + 1;
132 createPeriodLogs(period_number, localWorkspace);
133 }
134 // Set the total proton charge for this run
135 setProtonCharge(run);
136 setRunNumber(run);
137 run.addProperty("raw_filename", m_filename);
138
139 // Set progress to start of range taking account of ChildAlgorithms
140 setProg(0.0);
141
142 // populate instrument parameters
143 g_log.debug("Populating the instrument parameters...");
144 progress(m_prog, "Populating the instrument parameters...");
145 localWorkspace->populateInstrumentParameters();
146
148 WorkspaceGroup_sptr monitorws_grp;
149 DataObjects::Workspace2D_sptr monitorWorkspace;
150 specnum_t normalwsSpecs = 0;
151 specnum_t monitorwsSpecs = 0;
152 std::vector<specnum_t> monitorSpecList;
153
154 if (bincludeMonitors) {
155 setWorkspaceProperty("OutputWorkspace", title, ws_grp, localWorkspace, m_numberOfPeriods, false, this);
156 } else {
157 // gets the monitor spectra list from workspace
158 monitorSpecList = getmonitorSpectrumList(detectorMapping);
159 // calculate the workspace size for normal workspace and monitor workspace
160 calculateWorkspacesizes(monitorSpecList, normalwsSpecs, monitorwsSpecs);
161 try {
162 validateWorkspaceSizes(bexcludeMonitors, bseparateMonitors, normalwsSpecs, monitorwsSpecs);
163 } catch (std::out_of_range &) {
164 fclose(file);
165 throw;
166 }
167
168 // now create a workspace of size normalwsSpecs and set it as output
169 // workspace
170 if (normalwsSpecs > 0) {
171 localWorkspace = createWorkspace(localWorkspace, normalwsSpecs, m_lengthIn, m_lengthIn - 1);
172 setWorkspaceProperty("OutputWorkspace", title, ws_grp, localWorkspace, m_numberOfPeriods, false, this);
173 }
174 // now create monitor workspace if separateMonitors selected
175 if (bseparateMonitors) {
176 createMonitorWorkspace(monitorWorkspace, localWorkspace, monitorws_grp, monitorwsSpecs, normalwsSpecs,
177 m_numberOfPeriods, m_lengthIn, title, this);
178 }
179 }
180
181 if (bseparateMonitors) {
182 if (normalwsSpecs == 0) {
183 // Ensure we fill the correct group as if we are only
184 // loading monitors then
185 // we essentially want normal behavior
186 // with no extra _monitors workspace
187 ws_grp = monitorws_grp;
188 } else { // attach monitor workspace to main workspace
189 localWorkspace->setMonitorWorkspace(monitorWorkspace);
190 }
191 }
192
193 // Loop over the number of periods in the raw file, putting each period in a
194 // separate workspace
195
196 for (int period = 0; period < m_numberOfPeriods; ++period) {
197 // skipping the first spectra in each period
198 skipData(file, static_cast<int>(period * (m_numberOfSpectra + 1)));
199
200 // check for excluded periods
201 if (!isPeriodIncluded(period)) {
202 skipPeriod(file, period);
203 continue;
204 }
205
206 if (period > firstPeriod) {
207 if (localWorkspace) {
208 localWorkspace = createWorkspace(localWorkspace);
209 }
210 if (bseparateMonitors) {
211 try {
212 monitorWorkspace = createWorkspace(monitorWorkspace, monitorwsSpecs, m_lengthIn, m_lengthIn - 1);
213 } catch (std::out_of_range &) {
214 g_log.information() << "Separate Monitors option is selected and no "
215 "monitors in the selected specra range.\n";
216 g_log.information() << "Error in creating one of the output workspaces\n";
217 } catch (std::runtime_error &) {
218 g_log.information() << "Separate Monitors option is selected,Error "
219 "in creating one of the output workspaces\n";
220 }
221 } // end of separate Monitors
222
223 if (bLoadlogFiles) {
224 const int period_number = period + 1;
225 // remove previous period data
226 std::stringstream prevPeriod;
227 prevPeriod << "PERIOD " << (getPreviousPeriod(period_number));
228 if (localWorkspace) {
229 Run &runObj = localWorkspace->mutableRun();
230 runObj.removeLogData(prevPeriod.str());
231 runObj.removeLogData("current_period");
232 // add current period data
233 createPeriodLogs(period_number, localWorkspace);
234 }
235 if (monitorWorkspace) {
236 Run &runObj = monitorWorkspace->mutableRun();
237 runObj.removeLogData(prevPeriod.str());
238 runObj.removeLogData("current_period");
239 // add current period data
240 createPeriodLogs(period_number, monitorWorkspace);
241 }
242 } // end of if loop for loadlogfiles
243 }
244
245 if (bexcludeMonitors) {
246 excludeMonitors(file, period, monitorSpecList, localWorkspace);
247 }
248 if (bincludeMonitors) {
249 includeMonitors(file, period, localWorkspace);
250 }
251 if (bseparateMonitors) {
252 separateMonitors(file, period, monitorSpecList, localWorkspace, monitorWorkspace);
253 }
254
255 // Re-update spectra etc.
256 if (localWorkspace)
257 localWorkspace->updateSpectraUsing(detectorMapping);
258
259 if (monitorWorkspace)
260 monitorWorkspace->updateSpectraUsing(detectorMapping);
261
262 // Assign the result to the output workspace property
263 if (m_numberOfPeriods > 1) {
264 if (bseparateMonitors) {
265 if (normalwsSpecs > 0) {
266 // declare and set monitor workspace for each period
267 setWorkspaceProperty(monitorWorkspace, monitorws_grp, period, true, this);
268 } else {
269 localWorkspace = monitorWorkspace;
270 }
271 // declare and set output workspace for each period
272 setWorkspaceProperty(localWorkspace, ws_grp, period, false, this);
273 } else {
274 setWorkspaceProperty(localWorkspace, ws_grp, period, false, this);
275 }
276 // progress for workspace groups
277 setProg(static_cast<double>(period) / static_cast<double>(m_numberOfPeriods - 1));
278 }
279
280 } // loop over periods
281
282 // Map spectra whose file detector IDs the instrument does not define onto the detector of the same ID; a no-op
283 // unless the instrument definition enables it. Left until here so every period and monitor workspace are populated.
285
286 // Clean up
287 reset();
288 fclose(file);
289}
296void LoadRaw3::excludeMonitors(FILE *file, const int &period, const std::vector<specnum_t> &monitorList,
297 const DataObjects::Workspace2D_sptr &ws_sptr) {
298 int64_t histCurrent = -1;
299 int64_t wsIndex = 0;
300 auto histTotal = static_cast<double>(m_total_specs * m_numberOfPeriods);
301 // loop through the spectra
302 for (specnum_t i = 1; i <= m_numberOfSpectra; ++i) {
303 specnum_t histToRead = i + period * (m_numberOfSpectra + 1);
304 if ((i >= m_spec_min && i < m_spec_max) ||
305 (m_list && find(m_spec_list.begin(), m_spec_list.end(), i) != m_spec_list.end())) {
306 progress(m_prog, "Reading raw file data...");
307 // skip monitor spectrum
308 if (isMonitor(monitorList, i)) {
309 skipData(file, histToRead);
310 continue;
311 }
312
313 // read spectrum
314 if (!readData(file, histToRead)) {
315 throw std::runtime_error("Error reading raw file");
316 }
317 // set the workspace data
319 // increment workspace index
320 ++wsIndex;
321
322 if (m_numberOfPeriods == 1) {
323 if (++histCurrent % 100 == 0) {
324 setProg(static_cast<double>(histCurrent) / histTotal);
325 }
327 }
328
329 } // end of if loop for spec min,max check
330 else {
331 skipData(file, histToRead);
332 }
333 } // end of for loop
334}
335
341void LoadRaw3::includeMonitors(FILE *file, const int64_t &period, const DataObjects::Workspace2D_sptr &ws_sptr) {
342
343 int64_t histCurrent = -1;
344 int64_t wsIndex = 0;
345 auto histTotal = static_cast<double>(m_total_specs * m_numberOfPeriods);
346 // loop through spectra
347 for (specnum_t i = 1; i <= m_numberOfSpectra; ++i) {
348 int64_t histToRead = i + period * (m_numberOfSpectra + 1);
349 if ((i >= m_spec_min && i < m_spec_max) ||
350 (m_list && find(m_spec_list.begin(), m_spec_list.end(), i) != m_spec_list.end())) {
351 progress(m_prog, "Reading raw file data...");
352
353 // read spectrum from raw file
354 if (!readData(file, histToRead)) {
355 throw std::runtime_error("Error reading raw file");
356 }
357 // set workspace data
359 ++wsIndex;
360
361 if (m_numberOfPeriods == 1) {
362 if (++histCurrent % 100 == 0) {
363 setProg(double(histCurrent) / histTotal);
364 }
366 }
367
368 } else {
369 skipData(file, histToRead);
370 }
371 }
372 // loadSpectra(file,period,m_total_specs,ws_sptr,m_timeChannelsVec);
373}
374
383void LoadRaw3::separateMonitors(FILE *file, const int64_t &period, const std::vector<specnum_t> &monitorList,
384 const DataObjects::Workspace2D_sptr &ws_sptr,
385 const DataObjects::Workspace2D_sptr &mws_sptr) {
386 int64_t histCurrent = -1;
387 int64_t wsIndex = 0;
388 int64_t mwsIndex = 0;
389 auto histTotal = static_cast<double>(m_total_specs * m_numberOfPeriods);
390 // loop through spectra
391 for (specnum_t i = 1; i <= m_numberOfSpectra; ++i) {
392 int64_t histToRead = i + period * (m_numberOfSpectra + 1);
393 if ((i >= m_spec_min && i < m_spec_max) ||
394 (m_list && find(m_spec_list.begin(), m_spec_list.end(), i) != m_spec_list.end())) {
395 progress(m_prog, "Reading raw file data...");
396
397 // read spectrum from raw file
398 if (!readData(file, histToRead)) {
399 throw std::runtime_error("Error reading raw file");
400 }
401 // if this a monitor, store that spectrum to monitor workspace
402 if (isMonitor(monitorList, i)) {
404 ++mwsIndex;
405 } else {
406 // not a monitor, store the spectrum to normal output workspace
408 ++wsIndex;
409 }
410
411 if (m_numberOfPeriods == 1) {
412 if (++histCurrent % 100 == 0) {
413 setProg(static_cast<double>(histCurrent) / histTotal);
414 }
416 }
417
418 } else {
419 skipData(file, histToRead);
420 }
421 }
422}
423
429void LoadRaw3::skipPeriod(FILE *file, const int64_t &period) {
430 for (specnum_t i = 1; i <= m_numberOfSpectra; ++i) {
431 int64_t histToRead = i + period * (m_numberOfSpectra + 1);
432 skipData(file, histToRead);
433 }
434}
435
439bool LoadRaw3::isPeriodIncluded(int period) const {
440 return !isSelectedPeriods() || std::find(m_periodList.begin(), m_periodList.end(), period + 1) != m_periodList.end();
441}
442
447int LoadRaw3::getPreviousPeriod(int period) const {
448 if (isSelectedPeriods()) {
449 // find period number preceding the argument in the period list
450 auto pitr = std::find(m_periodList.begin(), m_periodList.end(), period);
451 if (pitr == m_periodList.end() || pitr == m_periodList.begin()) {
452 throw std::logic_error("Unexpected period number found.");
453 }
454 return *(--pitr);
455 }
456 return period - 1;
457}
458
461 // read in the settings passed to the algorithm
462 m_spec_list = getProperty("SpectrumList");
463 m_spec_max = getProperty("SpectrumMax");
464 m_spec_min = getProperty("SpectrumMin");
465 m_periodList = getProperty("PeriodList");
466 if (!m_periodList.empty()) {
467 // periods will be expected in ascending order
468 std::sort(m_periodList.begin(), m_periodList.end());
469 // check that the periods are within their range: 1 <= p <=
470 // m_numberOfPeriods
471 auto minElement = std::min_element(m_periodList.begin(), m_periodList.end());
472 auto maxElement = std::max_element(m_periodList.begin(), m_periodList.end());
473 if (*minElement < 1 || *maxElement > m_numberOfPeriods) {
474 throw std::runtime_error("Values in PeriodList must be between 1 and "
475 "total number of periods.");
476 }
477 }
478}
479
482void LoadRaw3::setProg(double prog) { m_prog = m_prog_start + (m_prog_end - m_prog_start) * prog; }
483
492void LoadRaw3::validateWorkspaceSizes(bool bexcludeMonitors, bool bseparateMonitors, const int64_t normalwsSpecs,
493 const int64_t monitorwsSpecs) {
494 if (normalwsSpecs <= 0 && bexcludeMonitors) {
495 throw std::out_of_range("All the spectra in the selected range for this "
496 "workspace are monitors and Exclude monitors "
497 "option selected ");
498 }
499 if (bseparateMonitors) {
500 if (normalwsSpecs <= 0 && monitorwsSpecs <= 0) {
501 throw std::out_of_range("Workspace size is zero,Error in creating output workspace.");
502 }
503 }
504}
505
511bool LoadRaw3::isMonitor(const std::vector<specnum_t> &monitorIndexes, specnum_t spectrumNum) {
512 return (find(monitorIndexes.begin(), monitorIndexes.end(), spectrumNum) != monitorIndexes.end());
513}
514
515} // 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:90
void removeLogData(const std::string &name, const bool delproperty=true)
Remove a named log entry.
Definition LogManager.h:151
This class stores information regarding an experimental run as a series of log entries.
Definition Run.h:36
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:84
int getPreviousPeriod(int period) const
get the previous period number
Definition LoadRaw3.cpp:447
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:383
void setProg(double)
sets progress taking account of progress time taken up by ChildAlgorithms
Definition LoadRaw3.cpp:482
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:439
void includeMonitors(FILE *file, const int64_t &period, const DataObjects::Workspace2D_sptr &ws_sptr)
creates output workspace whcih includes monitors
Definition LoadRaw3.cpp:341
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:492
int64_t m_total_specs
total number of specs
Definition LoadRaw3.h:114
LoadRaw3()
Default constructor.
Definition LoadRaw3.cpp:34
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:460
void skipPeriod(FILE *file, const int64_t &period)
skip all spectra in a period
Definition LoadRaw3.cpp:429
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:511
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:296
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
MANTID_DATAHANDLING_DLL void correctLoadedWorkspaces(const API::Algorithm &loader, Kernel::Logger &log)
Applies correctSpectraMapping to whichever workspaces a loader declared: its output,...
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