/
LoadRawSpectrum0.h
108 lines (90 loc) · 3.61 KB
/
LoadRawSpectrum0.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#ifndef MANTID_DATAHANDLING_LOADRAWSPECTRUM0_H
#define MANTID_DATAHANDLING_LOADRAWSPECTRUM0_H
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidAPI/Algorithm.h"
#include "MantidDataObjects/Workspace2D.h"
#include "MantidDataHandling/LoadRawHelper.h"
#include <climits>
//----------------------------------------------------------------------
// Forward declaration
//----------------------------------------------------------------------
class ISISRAW2;
namespace Mantid {
namespace DataHandling {
/**
Loads zeroth spectrum from ISIS RAW format file and stores it in a 2D workspace
(Workspace2D class). LoadRawSpectrum0 is an algorithm and inherits
from the LoadRawHelper class .
Required Properties:
<UL>
<LI> Filename - The name of and path to the input RAW file </LI>
<LI> OutputWorkspace - The name of the workspace in which to store the imported
data
(a multiperiod file will store higher periods in workspaces called
OutputWorkspace_PeriodNo)</LI>
</UL>
@author Sofia Antony,ISIS,RAL
@date 12/04/2010
Copyright © 2010 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport LoadRawSpectrum0 : public LoadRawHelper {
public:
/// Default constructor
LoadRawSpectrum0();
/// Destructor
~LoadRawSpectrum0() override;
/// Algorithm's name for identification overriding a virtual method
const std::string name() const override { return "LoadRawSpectrum0"; }
/// Summary of algorithms purpose
const std::string summary() const override {
return "Loads spectrum zero from ISIS raw file and stores it in a 2D "
"workspace (Workspace2D class).";
}
/// Algorithm's version for identification overriding a virtual method
int version() const override { return 1; }
/// Algorithm's category for identification overriding a virtual method
const std::string category() const override {
return "Diagnostics\\Raw;DataHandling\\Raw";
}
private:
/// Overwrites Algorithm method.
void init() override;
/// Overwrites Algorithm method
void exec() override;
/// ISISRAW class instance which does raw file reading. Shared pointer to
/// prevent memory leak when an exception is thrown.
boost::shared_ptr<ISISRAW2> isisRaw;
/// The name and path of the input file
std::string m_filename;
/// The number of spectra in the raw file
specnum_t m_numberOfSpectra;
/// Allowed values for the cache property
std::vector<std::string> m_cache_options;
/// A map for storing the time regime for each spectrum
std::map<int64_t, int64_t> m_specTimeRegimes;
/// The current value of the progress counter
double m_prog;
/// Read in the time bin boundaries
int64_t m_lengthIn;
/// number of time regime
int64_t m_noTimeRegimes;
};
}
}
#endif