Mantid
Loading...
Searching...
No Matches
LoadRaw3.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 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 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include "MantidDataHandling/DllConfig.h"
15#include <climits>
16
17//----------------------------------------------------------------------
18// Forward declaration
19//----------------------------------------------------------------------
20class ISISRAW2;
21
22namespace Mantid {
23namespace DataHandling {
31class MANTID_DATAHANDLING_DLL LoadRaw3 : public LoadRawHelper {
32
33public:
35 LoadRaw3();
37 const std::string name() const override { return "LoadRaw"; }
39 const std::string summary() const override {
40 return "Loads a data file in ISIS RAW format and stores it in a 2D "
41 "workspace (Workspace2D class).";
42 }
43
45 int version() const override { return 3; }
46 const std::vector<std::string> seeAlso() const override {
47 return {"LoadVesuvio", "RawFileInfo", "LoadSampleDetailsFromRaw", "LoadRawBin0", "LoadRawSpectrum0"};
48 }
50 const std::string category() const override { return "DataHandling\\Raw"; }
51
52private:
54 void init() override;
56 void exec() override;
57
59 bool isMonitor(const std::vector<specnum_t> &monitorIndexes, specnum_t spectrumNum);
60
62 void validateWorkspaceSizes(bool bexcludeMonitors, bool bseparateMonitors, const int64_t normalwsSpecs,
63 const int64_t monitorwsSpecs);
64
66 void excludeMonitors(FILE *file, const int &period, const std::vector<specnum_t> &monitorList,
67 const DataObjects::Workspace2D_sptr &ws_sptr);
68
70 void includeMonitors(FILE *file, const int64_t &period, const DataObjects::Workspace2D_sptr &ws_sptr);
71
74 void separateMonitors(FILE *file, const int64_t &period, const std::vector<specnum_t> &monitorList,
75 const DataObjects::Workspace2D_sptr &ws_sptr, const DataObjects::Workspace2D_sptr &mws_sptr);
76
78 void skipPeriod(FILE *file, const int64_t &period);
80 bool isSelectedPeriods() const { return !m_periodList.empty(); }
82 bool isPeriodIncluded(int period) const;
84 int getPreviousPeriod(int period) const;
85
87 void setOptionalProperties();
88
90 void setProg(double);
91
93 std::string m_filename;
94
98 std::vector<std::string> m_cache_options;
100 std::map<int64_t, int64_t> m_specTimeRegimes;
104 double m_prog;
108
110 int64_t m_lengthIn;
112 std::vector<std::shared_ptr<HistogramData::HistogramX>> m_timeChannelsVec;
116 std::vector<int> m_periodList;
117};
118
119} // namespace DataHandling
120} // namespace Mantid
isis raw file.
Definition isisraw2.h:13
Loads an file in ISIS RAW format and stores it in a 2D workspace (Workspace2D class).
Definition LoadRaw3.h:31
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
std::string m_filename
The name and path of the input file.
Definition LoadRaw3.h:93
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Definition LoadRaw3.h:46
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition LoadRaw3.h:45
double m_prog_start
Start and ends values of progress counter.
Definition LoadRaw3.h:106
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition LoadRaw3.h:37
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
Definition LoadRaw3.h:50
int64_t m_total_specs
total number of specs
Definition LoadRaw3.h:114
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
std::vector< std::string > m_cache_options
Allowed values for the cache property.
Definition LoadRaw3.h:98
std::map< int64_t, int64_t > m_specTimeRegimes
A map for storing the time regime for each spectrum.
Definition LoadRaw3.h:100
specnum_t m_numberOfSpectra
The number of spectra in the raw file.
Definition LoadRaw3.h:96
const std::string summary() const override
Summary of algorithms purpose.
Definition LoadRaw3.h:39
Helper class for LoadRaw algorithms.
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.
Definition IDTypes.h:14