Mantid
Loading...
Searching...
No Matches
LoadDiffCal.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
11#include "MantidAPI/Progress.h"
12#include "MantidAPI/Run.h"
13#include "MantidAPI/TableRow.h"
22#include "MantidKernel/Unit.h"
23#include "MantidNexus/H5Util.h"
24
25#include <H5Cpp.h>
26#include <cmath>
27#include <filesystem>
28
29namespace Mantid::DataHandling {
30
40using Mantid::Kernel::compareStringsCaseInsensitive;
45
46using namespace H5;
47using namespace Nexus;
48
49namespace {
50enum class CalibFilenameExtensionEnum { H5, HD5, HDF, CAL, enum_count };
51const std::vector<std::string> calibFilenameExtensions{".h5", ".hd5", ".hdf", ".cal"};
52typedef EnumeratedString<CalibFilenameExtensionEnum, &calibFilenameExtensions, &compareStringsCaseInsensitive>
53 CalibFilenameExtension;
54
55enum class GroupingFilenameExtensionEnum { XML, H5, HD5, HDF, CAL, enum_count };
56const std::vector<std::string> groupingFilenameExtensions{".xml", ".h5", ".hd5", ".hdf", ".cal"};
57typedef EnumeratedString<GroupingFilenameExtensionEnum, &groupingFilenameExtensions, &compareStringsCaseInsensitive>
58 GroupingFilenameExtension;
59
60namespace PropertyNames {
61const std::string CAL_FILE("Filename");
62const std::string GROUP_FILE("GroupFilename");
63const std::string MAKE_CAL("MakeCalWorkspace");
64const std::string MAKE_GRP("MakeGroupingWorkspace");
65const std::string MAKE_MSK("MakeMaskWorkspace");
66} // namespace PropertyNames
67} // namespace
68
69// Register the algorithm into the AlgorithmFactory
70DECLARE_ALGORITHM(LoadDiffCal)
71
72
73const std::string LoadDiffCal::name() const { return "LoadDiffCal"; }
74
76int LoadDiffCal::version() const { return 1; }
77
79const std::string LoadDiffCal::category() const { return "DataHandling\\Instrument;Diffraction\\DataHandling"; }
80
82const std::string LoadDiffCal::summary() const { return "Loads a calibration file for powder diffraction"; }
83
87 // 3 properties for getting the right instrument
89
91 std::make_unique<FileProperty>(PropertyNames::CAL_FILE, "", FileProperty::Load, calibFilenameExtensions),
92 "Path to the input calibration file.");
93
94 declareProperty(std::make_unique<FileProperty>(PropertyNames::GROUP_FILE, "", FileProperty::OptionalLoad,
95 groupingFilenameExtensions),
96 "Overrides grouping from CalFileName");
97
98 declareProperty(std::make_unique<PropertyWithValue<bool>>(PropertyNames::MAKE_GRP, true, Direction::Input),
99 "Set to true to create a GroupingWorkspace with called "
100 "WorkspaceName_group.");
101
102 declareProperty(std::make_unique<PropertyWithValue<bool>>(PropertyNames::MAKE_CAL, true, Direction::Input),
103 "Set to true to create a CalibrationWorkspace with called "
104 "WorkspaceName_cal.");
105
106 declareProperty(std::make_unique<PropertyWithValue<bool>>(PropertyNames::MAKE_MSK, true, Direction::Input),
107 "Set to true to create a MaskWorkspace with called WorkspaceName_mask.");
108
109 declareProperty(std::make_unique<PropertyWithValue<std::string>>("WorkspaceName", "", Direction::Input),
110 "The base of the output workspace names. Names will have '_group', "
111 "'_cal', '_mask' appended to them.");
112
113 std::string grpName("Calibration Validation");
114 declareProperty("TofMin", 0., "Minimum for TOF axis. Defaults to 0.");
115 declareProperty("TofMax", EMPTY_DBL(), "Maximum for TOF axis. Defaults to Unused.");
116 declareProperty(std::make_unique<PropertyWithValue<bool>>("FixConversionIssues", true, Direction::Input),
117 "Set DIFA and TZERO to zero if there is an error and the "
118 "pixel is masked");
119 setPropertyGroup("TofMin", grpName);
120 setPropertyGroup("TofMax", grpName);
121 setPropertyGroup("FixConversionIssues", grpName);
122}
123
124namespace { // anonymous
125
126void setGroupWSProperty(API::Algorithm *alg, const std::string &prefix, const GroupingWorkspace_sptr &wksp) {
128 "OutputGroupingWorkspace", prefix + "_group", Direction::Output),
129 "Set the output GroupingWorkspace, if any.");
130 alg->setProperty("OutputGroupingWorkspace", wksp);
131}
132
133void setMaskWSProperty(API::Algorithm *alg, const std::string &prefix, const MaskWorkspace_sptr &wksp) {
135 "OutputMaskWorkspace", prefix + "_mask", Direction::Output),
136 "Set the output MaskWorkspace, if any.");
137 alg->setProperty("OutputMaskWorkspace", wksp);
138}
139
140void setCalWSProperty(API::Algorithm *alg, const std::string &prefix, const ITableWorkspace_sptr &wksp) {
141 alg->declareProperty(
142 std::make_unique<WorkspaceProperty<ITableWorkspace>>("OutputCalWorkspace", prefix + "_cal", Direction::Output),
143 "Set the output Diffraction Calibration workspace, if any.");
144 alg->setProperty("OutputCalWorkspace", wksp);
145}
146
147} // anonymous namespace
148
149void LoadDiffCal::getInstrument(H5File &file) {
150 // don't bother if there isn't a mask or grouping requested
151 bool makeMask = getProperty(PropertyNames::MAKE_MSK);
152 bool makeGrouping = getProperty(PropertyNames::MAKE_GRP);
153 if ((!makeMask) & (!makeGrouping))
154 return;
155
156 // see if the user specified the instrument independently
159 return;
160 }
161
162 std::string idf = H5Util::readString(file, "/calibration/instrument/instrument_source");
163 std::string instrumentName = H5Util::readString(file, "/calibration/instrument/name");
164
165 g_log.debug() << "IDF : " << idf << "\n"
166 << "NAME: " << instrumentName << "\n";
167
168 API::Algorithm_sptr childAlg = this->createChildAlgorithm("LoadInstrument", 0.0, 0.1);
169 MatrixWorkspace_sptr tempWS(new Workspace2D());
170 childAlg->setProperty<MatrixWorkspace_sptr>("Workspace", tempWS);
171 if (idf.empty()) {
172 childAlg->setPropertyValue("InstrumentName", instrumentName);
173 } else {
174 childAlg->setPropertyValue("Filename", idf);
175 }
176 childAlg->setProperty("RewriteSpectraMap", Mantid::Kernel::OptionalBool(false));
177 childAlg->executeAsChildAlg();
178
179 m_instrument = tempWS->getInstrument();
180
181 g_log.information() << "Loaded instrument \"" << m_instrument->getName() << "\" from \""
182 << m_instrument->getFilename() << "\"\n";
183}
184
185void LoadDiffCal::makeGroupingWorkspace(const std::vector<int32_t> &detids, const std::vector<int32_t> &groups) {
186 bool makeWS = getProperty(PropertyNames::MAKE_GRP);
187 if (!makeWS) {
188 g_log.information("Not loading GroupingWorkspace from the calibration file");
189 return;
190 }
191
192 // load grouping from a separate file if supplied
193 if (!isDefault(PropertyNames::GROUP_FILE)) {
195 return;
196 }
197
198 size_t numDet = detids.size();
199 Progress progress(this, .4, .6, numDet);
200
201 GroupingWorkspace_sptr wksp = std::make_shared<DataObjects::GroupingWorkspace>(m_instrument);
202 wksp->setTitle(m_filename);
203 wksp->mutableRun().addProperty("Filename", m_filename);
204
205 for (size_t i = 0; i < numDet; ++i) {
206 auto detid = static_cast<detid_t>(detids[i]);
207 wksp->setValue(detid, groups[i]);
208 progress.report();
209 }
210
211 setGroupWSProperty(this, m_workspaceName, wksp);
212}
213
214void LoadDiffCal::makeMaskWorkspace(const std::vector<int32_t> &detids, const std::vector<int32_t> &use) {
215 bool makeWS = getProperty(PropertyNames::MAKE_MSK);
216 if (!makeWS) {
217 g_log.information("Not making a MaskWorkspace");
218 return;
219 }
220
221 size_t numDet = detids.size();
222 Progress progress(this, .6, .8, numDet);
223
224 MaskWorkspace_sptr wksp = std::make_shared<DataObjects::MaskWorkspace>(m_instrument);
225 wksp->setTitle(m_filename);
226 wksp->mutableRun().addProperty("Filename", m_filename);
227
228 for (size_t i = 0; i < numDet; ++i) {
229 bool shouldUse = (use[i] > 0); // true if detector is calibrated
230 auto detid = static_cast<detid_t>(detids[i]);
231 // in maskworkspace 0=use, 1=dontuse
232 wksp->setMasked(detid, !shouldUse);
233 // The mask value is 0 if the detector is good for use
234 wksp->setValue(detid, (shouldUse ? 0. : 1.));
235 progress.report();
236 }
237
238 setMaskWSProperty(this, m_workspaceName, wksp);
239}
240
241void LoadDiffCal::makeCalWorkspace(const std::vector<int32_t> &detids, const std::vector<double> &difc,
242 const std::vector<double> &difa, const std::vector<double> &tzero,
243 const std::vector<int32_t> &dasids, const std::vector<double> &offsets,
244 const std::vector<int32_t> &use) {
245 bool makeWS = getProperty(PropertyNames::MAKE_CAL);
246 if (!makeWS) {
247 g_log.information("Not making a calibration workspace");
248 return;
249 }
250
251 size_t numDet = detids.size();
252 Progress progress(this, .8, 1., numDet);
253
254 bool haveDasids = !dasids.empty();
255 bool haveOffsets = !offsets.empty();
256 bool fixIssues = getProperty("FixConversionIssues");
257
258 double tofMin = getProperty("TofMin");
259 double tofMax = getProperty("TofMax");
260 bool useTofMax = !isEmpty(tofMax);
261
262 ITableWorkspace_sptr wksp = std::make_shared<DataObjects::TableWorkspace>();
263 wksp->setTitle(m_filename);
264 wksp->addColumn("int", "detid");
265 wksp->addColumn("double", "difc");
266 wksp->addColumn("double", "difa");
267 wksp->addColumn("double", "tzero");
268 // only add these columns if they have values
269 if (haveDasids)
270 wksp->addColumn("int", "dasid");
271 if (haveOffsets)
272 wksp->addColumn("double", "offset");
273
274 // columns for valid range of data
275 wksp->addColumn("double", "tofmin");
276 if (useTofMax)
277 wksp->addColumn("double", "tofmax");
278
279 size_t badCount = 0;
280 for (size_t i = 0; i < numDet; ++i) {
281 API::TableRow newrow = wksp->appendRow();
282 newrow << detids[i];
283 newrow << difc[i];
284 newrow << difa[i];
285 newrow << tzero[i];
286 if (haveDasids)
287 newrow << dasids[i];
288 if (haveOffsets)
289 newrow << offsets[i];
290
291 // calculate tof range for information
292 Kernel::Units::dSpacing dspacingUnit;
293 const double tofMinRow = dspacingUnit.calcTofMin(difc[i], difa[i], tzero[i], tofMin);
294 std::stringstream msg;
295 if (tofMinRow != tofMin) {
296 msg << "TofMin shifted from " << tofMin << " to " << tofMinRow << " ";
297 }
298 newrow << tofMinRow;
299 if (useTofMax) {
300 const double tofMaxRow = dspacingUnit.calcTofMax(difc[i], difa[i], tzero[i], tofMax);
301 newrow << tofMaxRow;
302
303 if (tofMaxRow != tofMax) {
304 msg << "TofMax shifted from " << tofMax << " to " << tofMaxRow;
305 }
306 }
307 if (!msg.str().empty()) {
308 badCount += 1;
309 std::stringstream longMsg;
310 longMsg << "[detid=" << detids[i];
311 if (haveDasids)
312 longMsg << ", dasid=" << dasids[i];
313 longMsg << "] " << msg.str();
314
315 // to fix issues for masked pixels, just zero difa and tzero
316 if (fixIssues && (!use[i])) {
317 longMsg << " pixel is masked, ";
318 longMsg << " changing difa (" << wksp->cell<double>(i, 2) << " to 0.)";
319 wksp->cell<double>(i, 2) = 0.;
320
321 longMsg << " and tzero (" << wksp->cell<double>(i, 3) << " to 0.)";
322 wksp->cell<double>(i, 3) = 0.;
323
324 // restore valid tof range
325 size_t index = 4; // where tofmin natively is
326 if (haveDasids)
327 index += 1;
328 if (haveOffsets)
329 index += 1;
330 wksp->cell<double>(i, index) = tofMin;
331 if (useTofMax)
332 wksp->cell<double>(i, index + 1) = tofMax;
333 }
334
335 this->g_log.warning(longMsg.str());
336 }
337
338 progress.report();
339 }
340 if (badCount > 0) {
341 this->g_log.warning() << badCount << " rows have reduced time-of-flight range\n";
342 }
343
344 setCalWSProperty(this, m_workspaceName, wksp);
345}
346
348 bool makeWS = getProperty(PropertyNames::MAKE_GRP);
349 if (!makeWS)
350 return; // input property says not to load grouping
351
352 if (isDefault(PropertyNames::GROUP_FILE))
353 return; // a separate grouping file was not specified
354
355 // Check that the instrument is defined
356 if (!m_instrument) {
357 throw std::runtime_error("Cannot load alternate grouping: the instrument is not defined.");
358 }
359 // Create a grouping workspace with this instrument
360 GroupingWorkspace_sptr groupingWorkspace = std::make_shared<DataObjects::GroupingWorkspace>(m_instrument);
361
362 // Get the alternate grouping file name
363 std::string filename = getPropertyValue(PropertyNames::GROUP_FILE);
364 g_log.information() << "Override grouping with information from \"" << filename << "\"\n";
365
366 // Determine file format by file name extension
367 std::string filenameExtension = std::filesystem::path(filename).extension().string();
368 GroupingFilenameExtension enFilenameExtension(
369 filenameExtension); // this will throw a runtime error if the extension is invalid
370 switch (enFilenameExtension) {
371 case GroupingFilenameExtensionEnum::XML: {
372 auto alg = createChildAlgorithm("LoadDetectorsGroupingFile");
373 alg->setProperty("InputWorkspace", groupingWorkspace);
374 alg->setProperty("InputFile", filename);
375 alg->executeAsChildAlg();
376 groupingWorkspace = alg->getProperty("OutputWorkspace");
377 } break;
378 case GroupingFilenameExtensionEnum::H5:
379 case GroupingFilenameExtensionEnum::HD5:
380 case GroupingFilenameExtensionEnum::HDF:
381 case GroupingFilenameExtensionEnum::CAL: {
382 auto alg = createChildAlgorithm("LoadDiffCal");
383 alg->setPropertyValue(PropertyNames::CAL_FILE, filename); // the alternate grouping file
384 alg->setProperty("InputWorkspace", groupingWorkspace); // a workspace to get the instrument from
385 alg->setProperty<bool>(PropertyNames::MAKE_CAL, false);
386 alg->setProperty<bool>(PropertyNames::MAKE_GRP, true);
387 alg->setProperty<bool>(PropertyNames::MAKE_MSK, false);
388 alg->setPropertyValue("WorkspaceName", m_workspaceName);
389 alg->executeAsChildAlg();
390 groupingWorkspace = alg->getProperty("OutputGroupingWorkspace");
391 } break;
392 default:
393 std::ostringstream os;
394 os << "Alternate grouping file has an invalid extension: "
395 << "\"" << filenameExtension << "\"";
396 throw std::runtime_error(os.str());
397 }
398
399 setGroupWSProperty(this, m_workspaceName, groupingWorkspace);
400}
401
403 bool makeCalWS = getProperty(PropertyNames::MAKE_CAL);
404 bool makeMaskWS = getProperty(PropertyNames::MAKE_MSK);
405 bool makeGroupWS = getProperty(PropertyNames::MAKE_GRP);
406 API::MatrixWorkspace_sptr inputWs = getProperty("InputWorkspace");
407
408 bool haveGroupingFile = !isDefault(PropertyNames::GROUP_FILE);
409
410 auto alg = createChildAlgorithm("LoadCalFile", 0., 1.);
411 alg->setPropertyValue("CalFilename", m_filename);
412 alg->setProperty("InputWorkspace", inputWs);
413 alg->setPropertyValue("InstrumentName", getPropertyValue("InstrumentName"));
414 alg->setPropertyValue("InstrumentFilename", getPropertyValue("InstrumentFilename"));
415 alg->setProperty<bool>("MakeOffsetsWorkspace", makeCalWS);
416 alg->setProperty<bool>("MakeGroupingWorkspace", makeGroupWS);
417 alg->setProperty<bool>("MakeMaskWorkspace", makeMaskWS);
418 alg->setPropertyValue("WorkspaceName", m_workspaceName);
419 alg->executeAsChildAlg();
420
421 if (makeCalWS) {
422 ITableWorkspace_sptr wksp = alg->getProperty("OutputCalWorkspace");
423 setCalWSProperty(this, m_workspaceName, wksp);
424 }
425
426 if (makeMaskWS) {
427 MatrixWorkspace_sptr wksp = alg->getProperty("OutputMaskWorkspace");
428 setMaskWSProperty(this, m_workspaceName, std::dynamic_pointer_cast<DataObjects::MaskWorkspace>(wksp));
429 }
430
431 if (makeGroupWS) {
432 GroupingWorkspace_sptr wksp = alg->getProperty("OutputGroupingWorkspace");
433 if (haveGroupingFile) {
434 // steal the instrument from what was loaded already
435 if (!m_instrument)
436 m_instrument = wksp->getInstrument();
438 } else {
439 setGroupWSProperty(this, m_workspaceName, wksp);
440 }
441 }
442}
443
444//----------------------------------------------------------------------------------------------
448 m_filename = getPropertyValue(PropertyNames::CAL_FILE);
449 m_workspaceName = getPropertyValue("WorkspaceName");
450
451 // Determine file format by file name extension
452 std::string filenameExtension = std::filesystem::path(m_filename).extension().string();
453 CalibFilenameExtension enFilenameExtension(
454 filenameExtension); // this will throw a runtime error if the extension is invalid
455 if (enFilenameExtension == CalibFilenameExtensionEnum::CAL) {
457 return;
458 }
459
460 // read in everything from the file
461 H5::Exception::dontPrint();
462 H5File file;
463 try {
464 file = H5File(m_filename, H5F_ACC_RDONLY, Nexus::H5Util::defaultFileAcc());
465 } catch (FileIException &) {
466 throw FileError("Failed to open file using HDF5", m_filename);
467 }
468 getInstrument(file);
469
470 Progress progress(this, 0.1, 0.4, 8);
471 Group calibrationGroup;
472 try {
473 calibrationGroup = file.openGroup("calibration");
474 } catch (FileIException &e) {
475#if H5_VERSION_GE(1, 8, 13)
476 UNUSED_ARG(e);
477 H5::Exception::printErrorStack();
478#else
479 e.printError(stderr);
480#endif
481 file.close();
482 throw FileError("Did not find group \"/calibration\"", m_filename);
483 }
484
485 progress.report("Reading detid");
486 std::vector<int32_t> detids = H5Util::readArray1DCoerce<int32_t>(calibrationGroup, "detid");
487 progress.report("Reading dasid");
488 std::vector<int32_t> dasids = H5Util::readArray1DCoerce<int32_t>(calibrationGroup, "dasid");
489 progress.report("Reading group");
490 std::vector<int32_t> groups = H5Util::readArray1DCoerce<int32_t>(calibrationGroup, "group");
491 progress.report("Reading use");
492 std::vector<int32_t> use = H5Util::readArray1DCoerce<int32_t>(calibrationGroup, "use");
493
494 progress.report("Reading difc");
495 std::vector<double> difc = H5Util::readArray1DCoerce<double>(calibrationGroup, "difc");
496 progress.report("Reading difa");
497 std::vector<double> difa = H5Util::readArray1DCoerce<double>(calibrationGroup, "difa");
498 progress.report("Reading tzero");
499 std::vector<double> tzero = H5Util::readArray1DCoerce<double>(calibrationGroup, "tzero");
500 progress.report("Reading offset");
501 std::vector<double> offset = H5Util::readArray1DCoerce<double>(calibrationGroup, "offset");
502
503 file.close();
504
505 // verify the minimum is present
506 if (detids.empty()) {
507 throw std::runtime_error("File was missing required field \"/calibraion/detid\"");
508 }
509 if (difc.empty()) {
510 throw std::runtime_error("File was missing required field \"/calibraion/difc\"");
511 }
512
513 // fix up empty arrays
514 if (groups.empty())
515 groups.assign(detids.size(), 1); // all go to one spectrum
516 if (use.empty())
517 use.assign(detids.size(), 1); // all detectors are good, use them
518 if (difa.empty())
519 difa.assign(detids.size(), 0.); // turn off difa
520 if (tzero.empty())
521 tzero.assign(detids.size(), 0.); // turn off tzero
522
523 // create the appropriate output workspaces
524 makeGroupingWorkspace(detids, groups);
525 makeMaskWorkspace(detids, use);
526 makeCalWorkspace(detids, difc, difa, tzero, dasids, offset, use);
527}
528} // namespace Mantid::DataHandling
std::string name
Definition Run.cpp:60
#define DECLARE_ALGORITHM(classname)
Definition Algorithm.h:538
std::map< DeltaEMode::Type, std::string > index
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
Definition System.h:48
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
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.
virtual std::shared_ptr< Algorithm > createChildAlgorithm(const std::string &name, const double startProgress=-1., const double endProgress=-1., const bool enableLogging=true, const int &version=-1)
Create a Child Algorithm.
Kernel::Logger & g_log
Definition Algorithm.h:422
void progress(double p, const std::string &msg="", double estimatedTime=0.0, int progressPrecision=0)
Sends ProgressNotification.
bool isDefault(const std::string &name) const
static bool isEmpty(const NumT toCheck)
checks that the value was not set by users, uses the value in empty double/int.
A specialized class for dealing with file properties.
@ OptionalLoad
to specify a file to read but the file doesn't have to exist
@ Load
allowed here which will be passed to the algorithm
ITableWorkspace is an implementation of Workspace in which the data are organised in columns of same ...
Helper class for reporting progress from algorithms.
Definition Progress.h:25
TableRow represents a row in a TableWorkspace.
Definition TableRow.h:39
T & cell(size_t col)
Templated method to access the element col in the row.
Definition TableRow.h:115
A property class for workspaces.
static void getInstrument3WaysInit(Mantid::API::Algorithm *alg)
For use by getInstrument3Ways, initializes the properties.
static bool instrumentIsSpecified(API::Algorithm const *alg)
static Geometry::Instrument_const_sptr getInstrument3Ways(API::Algorithm *alg)
Get a pointer to an instrument in one of 3 ways: InputWorkspace, InstrumentName, InstrumentFilename.
LoadDiffCal : TODO: DESCRIPTION.
Definition LoadDiffCal.h:23
int version() const override
Algorithm's version for identification.
Geometry::Instrument_const_sptr m_instrument
Definition LoadDiffCal.h:46
void init() override
Initialize the algorithm's properties.
void getInstrument(H5::H5File &file)
const std::string summary() const override
Algorithm's summary for use in the GUI and help.
void exec() override
Execute the algorithm.
void makeGroupingWorkspace(const std::vector< int32_t > &detids, const std::vector< int32_t > &groups)
const std::string category() const override
Algorithm's category for identification.
void makeMaskWorkspace(const std::vector< int32_t > &detids, const std::vector< int32_t > &use)
void makeCalWorkspace(const std::vector< int32_t > &detids, const std::vector< double > &difc, const std::vector< double > &difa, const std::vector< double > &tzero, const std::vector< int32_t > &dasids, const std::vector< double > &offsets, const std::vector< int32_t > &use)
Concrete workspace implementation.
Definition Workspace2D.h:29
The class Group represents a set of symmetry operations (or symmetry group).
Definition Group.h:135
Records the filename and the description of failure.
Definition Exception.h:98
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
virtual void declareProperty(std::unique_ptr< Property > p, const std::string &doc="")=0
Function to declare properties (i.e. store them)
void setPropertyGroup(const std::string &name, const std::string &group)
Set the group for a given property.
void debug(const std::string &msg)
Logs at debug level.
Definition Logger.cpp:145
void warning(const std::string &msg)
Logs at warning level.
Definition Logger.cpp:117
void information(const std::string &msg)
Logs at information level.
Definition Logger.cpp:136
OptionalBool : Tri-state bool.
The concrete, templated class for properties.
d-Spacing in Angstrom
Definition Unit.h:351
double calcTofMax(const double difc, const double difa, const double tzero, const double tofmax=0.)
Definition Unit.cpp:782
double calcTofMin(const double difc, const double difa, const double tzero, const double tofmin=0.)
Definition Unit.cpp:775
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
std::shared_ptr< Algorithm > Algorithm_sptr
Typedef for a shared pointer to an Algorithm.
Definition Algorithm.h:52
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< GroupingWorkspace > GroupingWorkspace_sptr
shared pointer to the GroupingWorkspace class
std::shared_ptr< MaskWorkspace > MaskWorkspace_sptr
shared pointer to the MaskWorkspace class
MANTID_NEXUS_DLL std::string readString(H5::H5File &file, const std::string &address)
Definition H5Util.cpp:266
MANTID_NEXUS_DLL H5::FileAccPropList defaultFileAcc()
Default file access is H5F_CLOSE_STRONG.
Definition H5Util.cpp:119
int32_t detid_t
Typedef for a detector ID.
constexpr double EMPTY_DBL() noexcept
Returns what we consider an "empty" double within a property.
Definition EmptyValues.h:42
STL namespace.
Describes the direction (within an algorithm) of a Property.
Definition Property.h:50
@ Input
An input workspace.
Definition Property.h:53
@ Output
An output workspace.
Definition Property.h:54