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//----------------------------------------------------------------------
14#include <climits>
15
16//----------------------------------------------------------------------
17// Forward declaration
18//----------------------------------------------------------------------
19class ISISRAW2;
20
21namespace Mantid {
22namespace DataHandling {
30class MANTID_DATAHANDLING_DLL LoadRaw3 : public LoadRawHelper {
31
32public:
34 LoadRaw3();
36 const std::string name() const override { return "LoadRaw"; }
38 const std::string summary() const override {
39 return "Loads a data file in ISIS RAW format and stores it in a 2D "
40 "workspace (Workspace2D class).";
41 }
42
44 int version() const override { return 3; }
45 const std::vector<std::string> seeAlso() const override {
46 return {"LoadVesuvio", "RawFileInfo", "LoadSampleDetailsFromRaw", "LoadRawBin0", "LoadRawSpectrum0"};
47 }
49 const std::string category() const override { return "DataHandling\\Raw"; }
50
51private:
53 void init() override;
55 void exec() override;
56
58 bool isMonitor(const std::vector<specnum_t> &monitorIndexes, specnum_t spectrumNum);
59
61 void validateWorkspaceSizes(bool bexcludeMonitors, bool bseparateMonitors, const int64_t normalwsSpecs,
62 const int64_t monitorwsSpecs);
63
65 void excludeMonitors(FILE *file, const int &period, const std::vector<specnum_t> &monitorList,
66 const DataObjects::Workspace2D_sptr &ws_sptr);
67
69 void includeMonitors(FILE *file, const int64_t &period, const DataObjects::Workspace2D_sptr &ws_sptr);
70
73 void separateMonitors(FILE *file, const int64_t &period, const std::vector<specnum_t> &monitorList,
74 const DataObjects::Workspace2D_sptr &ws_sptr, const DataObjects::Workspace2D_sptr &mws_sptr);
75
77 void skipPeriod(FILE *file, const int64_t &period);
79 bool isSelectedPeriods() const { return !m_periodList.empty(); }
81 bool isPeriodIncluded(int period) const;
83 int getPreviousPeriod(int period) const;
84
86 void setOptionalProperties();
87
89 void setProg(double);
90
92 std::string m_filename;
93
97 std::vector<std::string> m_cache_options;
99 std::map<int64_t, int64_t> m_specTimeRegimes;
103 double m_prog;
107
109 int64_t m_lengthIn;
111 std::vector<std::shared_ptr<HistogramData::HistogramX>> m_timeChannelsVec;
115 std::vector<int> m_periodList;
116};
117
118} // namespace DataHandling
119} // 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:30
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
std::string m_filename
The name and path of the input file.
Definition: LoadRaw3.h:92
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:45
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition: LoadRaw3.h:44
double m_prog_start
Start and ends values of progress counter.
Definition: LoadRaw3.h:105
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition: LoadRaw3.h:36
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
Definition: LoadRaw3.h:49
int64_t m_total_specs
total number of specs
Definition: LoadRaw3.h:113
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
std::vector< std::string > m_cache_options
Allowed values for the cache property.
Definition: LoadRaw3.h:97
std::map< int64_t, int64_t > m_specTimeRegimes
A map for storing the time regime for each spectrum.
Definition: LoadRaw3.h:99
specnum_t m_numberOfSpectra
The number of spectra in the raw file.
Definition: LoadRaw3.h:95
const std::string summary() const override
Summary of algorithms purpose.
Definition: LoadRaw3.h:38
Helper class for LoadRaw algorithms.
Definition: LoadRawHelper.h:40
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:16