Mantid
Loading...
Searching...
No Matches
LoadILLPolarizedDiffraction.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
10#include "MantidAPI/Axis.h"
14#include "MantidAPI/Run.h"
25#include "MantidKernel/Unit.h"
28#include "MantidKernel/V3D.h"
30
31#include <Poco/Path.h>
32
33namespace Mantid::DataHandling {
34
35using namespace API;
36using namespace Geometry;
37using namespace Kernel;
38using namespace NeXus;
39using Types::Core::DateAndTime;
40
41namespace {
42// This defines the number of physical pixels in D7
43constexpr size_t D7_NUMBER_PIXELS = 132;
44// This defines the number of monitors in the instrument.
45constexpr size_t NUMBER_MONITORS = 2;
46// This defines Time Of Flight measurement mode switch value
47constexpr size_t TOF_MODE_ON = 1;
48} // namespace
49
50// Register the algorithm into the AlgorithmFactory
51DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILLPolarizedDiffraction)
52
53
54int LoadILLPolarizedDiffraction::confidence(NexusDescriptor &descriptor) const {
55
56 // fields existent only at the ILL Diffraction
57 if (descriptor.pathExists("/entry0/D7")) {
58 return 80;
59 } else {
60 return 0;
61 }
62}
63
65const std::string LoadILLPolarizedDiffraction::name() const { return "LoadILLPolarizedDiffraction"; }
66
68int LoadILLPolarizedDiffraction::version() const { return 1; }
69
71const std::string LoadILLPolarizedDiffraction::category() const { return "DataHandling\\Nexus;ILL\\Diffraction"; }
72
74const std::string LoadILLPolarizedDiffraction::summary() const {
75 return "Loads ILL D7 instrument polarized diffraction nexus files.";
76}
77
82
87 declareProperty(std::make_unique<FileProperty>("Filename", "", FileProperty::Load, ".nxs"),
88 "File path of the data file to load");
89 declareProperty(std::make_unique<WorkspaceProperty<API::WorkspaceGroup>>("OutputWorkspace", "", Direction::Output),
90 "The output workspace.");
91 const std::vector<std::string> positionCalibrationOptions{"None", "Nexus", "YIGFile"};
92 declareProperty("PositionCalibration", "None", std::make_shared<StringListValidator>(positionCalibrationOptions),
93 "Select the type of pixel position calibration. If None, the pixel "
94 "positions are read from IDF file. If Nexus, the positions are read from "
95 "Nexus file. If YIGFile, then the calibration twotheta data is loaded "
96 "from a user-defined calibration file.");
97
98 declareProperty(std::make_unique<FileProperty>("YIGFilename", "", FileProperty::OptionalLoad, ".xml"),
99 "File path of the YIG calibration data file to load.");
100 setPropertySettings("YIGFilename",
101 std::make_unique<Kernel::EnabledWhenProperty>("PositionCalibration", IS_EQUAL_TO, "YIGFile"));
102 declareProperty("ConvertToScatteringAngle", false, "Convert the bin edges to scattering angle.", Direction::Input);
103 declareProperty("TransposeMonochromatic", false, "Transpose the 2D workspace with monochromatic data",
105 const std::vector<std::string> TOFUnitOptions{"UncalibratedTime", "TimeChannels"};
106 declareProperty("TOFUnits", TOFUnitOptions[0], std::make_shared<StringListValidator>(TOFUnitOptions),
107 "The choice of X-axis units for Time-Of-Flight data.");
108}
109
110std::map<std::string, std::string> LoadILLPolarizedDiffraction::validateInputs() {
111 std::map<std::string, std::string> issues;
112 if (getPropertyValue("PositionCalibration") == "YIGFile" && getPropertyValue("YIGFilename") == "") {
113 issues["PositionCalibration"] = "YIG-based position calibration of detectors requested but "
114 "the file was not provided.";
115 }
116 return issues;
117}
118
123
124 Progress progress(this, 0, 1, 3);
125
126 m_fileName = getPropertyValue("Filename");
127 m_wavelength = 0;
128
129 progress.report("Loading the detector polarization analysis data");
130 loadData();
131
132 progress.report("Loading the metadata");
133 loadMetaData();
134
135 progress.report("Sorting polarisations");
136 auto outputWorkspaceGroup = sortPolarisations();
137
138 setProperty("OutputWorkspace", outputWorkspaceGroup);
139}
140
146
147 // open the root entry
148 NXRoot dataRoot(m_fileName);
149
150 // read each entry
151 for (auto entryNumber = 0; entryNumber < static_cast<int>((dataRoot.groups().size())); entryNumber++) {
152 NXEntry entry = dataRoot.openEntry("entry" + std::to_string(entryNumber));
153 m_instName = entry.getString("D7/name");
154
155 std::string start_time = entry.getString("start_time");
156 start_time = LoadHelper::dateTimeInIsoFormat(start_time);
157
158 // init the workspace with proper number of histograms and number of channels
159 auto workspace = initStaticWorkspace(entry);
160
161 // load the instrument
162 loadInstrument(workspace, start_time);
163
164 // rotate detectors to their position during measurement
165 moveTwoTheta(entry, workspace);
166
167 // prepare axes for data
168 std::vector<double> axis = prepareAxes(entry);
169
170 // load data from file
171 std::string dataName = "data/Detector_data";
172 NXUInt data = entry.openNXDataSet<unsigned int>(dataName);
173 data.load();
174
175 // Assign detector counts
177 for (auto pixel_no = 0; pixel_no < static_cast<int>(D7_NUMBER_PIXELS); ++pixel_no) {
178 auto &spectrum = workspace->mutableY(pixel_no);
179 auto &errors = workspace->mutableE(pixel_no);
180 for (auto channel_no = 0; channel_no < static_cast<int>(m_numberOfChannels); ++channel_no) {
181 unsigned int counts = data(pixel_no, 0, channel_no);
182 spectrum[channel_no] = counts;
183 if (counts == 0) {
184 errors[channel_no] = 1.0;
185 } else {
186 errors[channel_no] = std::sqrt(counts);
187 }
188 }
189 workspace->mutableX(pixel_no) = axis;
190 }
191
192 // load and assign monitor data
193 for (auto monitor_no = static_cast<int>(D7_NUMBER_PIXELS);
194 monitor_no < static_cast<int>(D7_NUMBER_PIXELS + NUMBER_MONITORS); ++monitor_no) {
195 NXUInt monitorData = entry.openNXDataSet<unsigned int>(
196 "monitor" + std::to_string(monitor_no + 1 - static_cast<int>(D7_NUMBER_PIXELS)) + "/data");
197 monitorData.load();
198 auto &spectrum = workspace->mutableY(monitor_no);
199 auto &errors = workspace->mutableE(monitor_no);
200 for (auto channel_no = 0; channel_no < static_cast<int>(m_numberOfChannels); channel_no++) {
201 unsigned int counts = monitorData(0, 0, channel_no);
202 spectrum[channel_no] = counts;
203 if (counts == 0) {
204 errors[channel_no] = 1.0;
205 } else {
206 errors[channel_no] = std::sqrt(counts);
207 }
208 }
209 workspace->mutableX(monitor_no) = axis;
210 }
211
212 // convert the spectrum axis to scattering angle
213 if (getProperty("ConvertToScatteringAngle")) {
215 }
216 // transpose monochromatic data distribution
217 if (getProperty("TransposeMonochromatic") && m_acquisitionMode != TOF_MODE_ON) {
219 }
220
221 // adds the current entry workspace to the output group
223 entry.close();
224 }
225 dataRoot.close();
226}
227
232
233 // Open NeXus file
234 NXhandle nxHandle;
235 NXstatus nxStat = NXopen(m_fileName.c_str(), NXACC_READ, &nxHandle);
236
237 if (nxStat != NX_ERROR) {
238 for (auto workspaceId = 0; workspaceId < static_cast<int>(m_outputWorkspaceGroup.size()); ++workspaceId) {
240 std::static_pointer_cast<API::MatrixWorkspace>(m_outputWorkspaceGroup[workspaceId]);
241 auto const entryName = std::string("entry" + std::to_string(workspaceId));
242 LoadHelper::addNexusFieldsToWsRun(nxHandle, workspace->mutableRun(), entryName);
243 if (m_wavelength != 0) {
244 workspace->mutableRun().addProperty("monochromator.wavelength", m_wavelength, true);
245 }
246 }
247 NXclose(&nxHandle);
248 }
249}
250
260 const size_t nSpectra = D7_NUMBER_PIXELS + NUMBER_MONITORS;
261
262 // Set number of channels
263 NXInt acquisitionMode = entry.openNXInt("acquisition_mode");
264 acquisitionMode.load();
265 m_acquisitionMode = acquisitionMode[0];
266 if (m_acquisitionMode == TOF_MODE_ON) {
267 NXFloat timeOfFlightInfo = entry.openNXFloat("D7/Detector/time_of_flight");
268 timeOfFlightInfo.load();
269 m_numberOfChannels = size_t(timeOfFlightInfo[1]);
270 } else {
272 }
273
276
277 // Set x axis units
278 if (m_acquisitionMode == TOF_MODE_ON) {
279 if (getPropertyValue("TOFUnits") == "TimeChannels") {
280 auto lblUnit = std::dynamic_pointer_cast<Kernel::Units::Label>(UnitFactory::Instance().create("Label"));
281 lblUnit->setLabel("Time channel", Units::Symbol::EmptyLabel);
282 workspace->getAxis(0)->unit() = lblUnit;
283 } else {
284 workspace->getAxis(0)->unit() = UnitFactory::Instance().create("TOF");
285 }
286 } else {
287 workspace->getAxis(0)->unit() = UnitFactory::Instance().create("Wavelength");
288 }
289 // Set y axis unit
290 workspace->setYUnit("Counts");
291
292 // check the polarization direction and set the workspace title
293 std::string polDirection = entry.getString("D7/POL/actual_state");
294 std::string flipperState = entry.getString("D7/POL/actual_stateB1B2");
295 workspace->setTitle(polDirection.substr(0, 1) + "_" + flipperState);
296 return workspace;
297}
304 const std::string &startTime) {
305
306 // the start time is needed in the workspace when loading the parameter file
307 workspace->mutableRun().addProperty("start_time", startTime);
308
309 auto loadInst = createChildAlgorithm("LoadInstrument");
310 loadInst->setPropertyValue("Filename", m_instName + "_Definition.xml");
311 loadInst->setProperty<MatrixWorkspace_sptr>("Workspace", workspace);
312 loadInst->setProperty("RewriteSpectraMap", OptionalBool(true));
313 loadInst->execute();
314}
315
325 const NXEntry &entry, const int bankId) {
326
327 auto const nPixelsPerBank = workspace->getInstrument()->getIntParameter("number_pixels_per_bank")[0];
328 std::vector<double> twoTheta(static_cast<int>(nPixelsPerBank));
329
330 if (getPropertyValue("PositionCalibration") == "Nexus") {
331 NXFloat twoThetaPixels = entry.openNXFloat("D7/Detector/bank" + std::to_string(bankId) + "_offset");
332 twoThetaPixels.load();
333 float *twoThetaDataStart = twoThetaPixels();
334 float *twoThetaDataEnd = twoThetaDataStart + nPixelsPerBank;
335 twoTheta.assign(twoThetaDataStart, twoThetaDataEnd);
336 } else {
337 auto loadIpf = createChildAlgorithm("LoadParameterFile");
338 loadIpf->setPropertyValue("Filename", getPropertyValue("YIGFilename"));
339 loadIpf->setProperty("Workspace", workspace);
340 loadIpf->execute();
341
342 Instrument_const_sptr instrument = workspace->getInstrument();
343 IComponent_const_sptr currentBank = instrument->getComponentByName(std::string("bank" + std::to_string(bankId)));
344
345 m_wavelength = currentBank->getNumberParameter("wavelength")[0];
346
347 for (auto pixel_no = 0; pixel_no < static_cast<int>(nPixelsPerBank); pixel_no++) {
348 twoTheta[pixel_no] = currentBank->getNumberParameter("twoTheta_pixel_" + std::to_string(pixel_no + 1))[0];
349 }
350 }
351 return twoTheta;
352}
353
361 const int bankId) {
362 std::vector<double> bankParameters;
363
364 Instrument_const_sptr instrument = workspace->getInstrument();
365 IComponent_const_sptr currentBank = instrument->getComponentByName(std::string("bank" + std::to_string(bankId)));
366
367 auto slope = currentBank->getNumberParameter("gradient")[0];
368 bankParameters.push_back(slope);
369 auto offset = currentBank->getNumberParameter("offset")[0];
370 bankParameters.push_back(offset);
371
372 return bankParameters;
373}
374
381
382 Instrument_const_sptr instrument = workspace->getInstrument();
383 auto const nBanks = instrument->getIntParameter("number_banks")[0];
384 auto const nPixelsPerBank = instrument->getIntParameter("number_pixels_per_bank")[0];
385
386 auto &componentInfo = workspace->mutableComponentInfo();
387 for (auto bank_no = 0; bank_no < static_cast<int>(nBanks); ++bank_no) {
388 NXFloat twoThetaBank =
389 entry.openNXFloat("D7/2theta/actual_bank" + std::to_string(bank_no + 2)); // detector bank IDs start at 2
390 twoThetaBank.load();
391 if (getPropertyValue("PositionCalibration") == "None") {
392 Quat rotation(-twoThetaBank[0], V3D(0, 1, 0));
393 IComponent_const_sptr currentBank =
394 instrument->getComponentByName(std::string("bank" + std::to_string(bank_no + 2)));
395 const auto componentIndex = componentInfo.indexOf(currentBank->getComponentID());
396 componentInfo.setRotation(componentIndex, rotation);
397 } else {
398 std::vector<double> twoThetaPixels = loadTwoThetaDetectors(workspace, entry, bank_no + 2);
399 std::vector<double> bankParameters{1, 0}; // slope, offset
400 if (getPropertyValue("PositionCalibration") == "YIGFile") {
401 bankParameters = loadBankParameters(workspace, bank_no + 2);
402 }
403 for (auto pixel_no = 0; pixel_no < static_cast<int>(nPixelsPerBank); ++pixel_no) {
404 auto const pixelIndex = bank_no * static_cast<int>(nPixelsPerBank) + pixel_no;
405 auto const pixel = componentInfo.componentID(pixelIndex);
406 V3D position = pixel->getPos();
407 double radius, theta, phi;
408 position.getSpherical(radius, theta, phi);
409 position.spherical(radius, bankParameters[0] * twoThetaBank[0] - bankParameters[1] - twoThetaPixels[pixel_no],
410 phi);
411 componentInfo.setPosition(pixelIndex, position);
412 }
413 }
414 }
415}
416
423std::vector<double> LoadILLPolarizedDiffraction::prepareAxes(const NXEntry &entry) {
424 // check the mode of measurement and prepare axes for data
425 std::vector<double> axes;
426
427 if (m_acquisitionMode == TOF_MODE_ON) {
428 NXFloat timeOfFlightInfo = entry.openNXFloat("D7/Detector/time_of_flight");
429 timeOfFlightInfo.load();
430 auto channelWidth = static_cast<double>(timeOfFlightInfo[0]);
431 m_numberOfChannels = size_t(timeOfFlightInfo[1]);
432 auto tofDelay = timeOfFlightInfo[2];
433 for (auto channel_no = 0; channel_no <= static_cast<int>(m_numberOfChannels); channel_no++) {
434 if (getPropertyValue("TOFUnits") == "UncalibratedTime") {
435 axes.push_back(tofDelay + channel_no * channelWidth);
436 } else {
437 axes.push_back(channel_no);
438 }
439 }
440 } else {
441 double wavelength = 0;
442 if (m_wavelength != 0) {
443 wavelength = m_wavelength;
444 } else {
445 NXFloat wavelengthNexus = entry.openNXFloat("D7/monochromator/wavelength");
446 wavelengthNexus.load();
447 wavelength = wavelengthNexus[0];
448 }
449 axes.push_back(static_cast<double>(wavelength * 0.99));
450 axes.push_back(static_cast<double>(wavelength * 1.01));
451 }
452 return axes;
453}
454
460 auto convertSpectrumAxis = createChildAlgorithm("ConvertSpectrumAxis");
461 convertSpectrumAxis->initialize();
462 convertSpectrumAxis->setProperty("InputWorkspace", workspace);
463 convertSpectrumAxis->setProperty("OutputWorkspace", "__unused_for_child");
464 convertSpectrumAxis->setProperty("Target", "SignedTheta");
465 convertSpectrumAxis->setProperty("EMode", "Direct");
466 convertSpectrumAxis->setProperty("OrderAxis", false);
467 convertSpectrumAxis->execute();
468 workspace = convertSpectrumAxis->getProperty("OutputWorkspace");
469
470 auto changeSign = createChildAlgorithm("ConvertAxisByFormula");
471 changeSign->initialize();
472 changeSign->setProperty("InputWorkspace", workspace);
473 changeSign->setProperty("OutputWorkspace", "__unused_for_child");
474 changeSign->setProperty("Axis", "Y");
475 changeSign->setProperty("Formula", "-y");
476 changeSign->execute();
477 return changeSign->getProperty("OutputWorkspace");
478}
479
486 auto transpose = createChildAlgorithm("Transpose");
487 transpose->initialize();
488 transpose->setProperty("InputWorkspace", workspace);
489 transpose->setProperty("OutputWorkspace", "__unused_for_child");
490 transpose->execute();
491 return transpose->getProperty("OutputWorkspace");
492}
493
499 auto outputGroupSize = static_cast<int>(m_outputWorkspaceGroup.size());
500 API::WorkspaceGroup_sptr sortedGroup = std::make_shared<API::WorkspaceGroup>();
501 if (outputGroupSize < 2) {
502 sortedGroup->addWorkspace(std::move(m_outputWorkspaceGroup[0]));
503 } else {
504 std::vector<int> sortedWorkspaceIds(outputGroupSize);
505 std::map<const std::string, int> polarisationsOrder{{"OFF", 0}, {"ZPO", 1}, {"XPO", 3},
506 {"YPO", 5}, {"XPO-YPO", 7}, {"XPO+YPO", 9}};
507 for (auto workspaceId = 0; workspaceId < outputGroupSize; workspaceId++) {
508 auto ws = m_outputWorkspaceGroup[workspaceId];
509 auto flipperState = ws->mutableRun().getLogData("POL.actual_stateB1B2")->value();
510 std::string polarisation = ws->mutableRun().getLogData("POL.actual_state")->value();
511 int sortedId = 0;
512 if (polarisationsOrder.count(polarisation) > 0) {
513 sortedId = polarisationsOrder[polarisation];
514 if (flipperState == "ON")
515 sortedId--;
516 }
517 sortedWorkspaceIds[workspaceId] = sortedId;
518 }
519 for (auto workspaceId : sortedWorkspaceIds) {
520 sortedGroup->addWorkspace(std::move(m_outputWorkspaceGroup[workspaceId]));
521 }
522 }
523 return sortedGroup;
524}
525
526} // namespace Mantid::DataHandling
double position
Definition: GetAllEi.cpp:154
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
int nSpectra
#define PARALLEL_FOR_IF(condition)
Empty definitions - to enable set your complier to enable openMP.
Mantid::Kernel::Quat(ComponentInfo::* rotation)(const size_t) const
double radius
Definition: Rasterize.cpp:31
#define DECLARE_NEXUS_FILELOADER_ALGORITHM(classname)
DECLARE_NEXUS_FILELOADER_ALGORITHM should be used in place of the standard DECLARE_ALGORITHM macro wh...
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
Definition: Algorithm.cpp:1913
std::string getPropertyValue(const std::string &name) const override
Get the value of a property as a string.
Definition: Algorithm.cpp:2026
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
Definition: Algorithm.cpp:2076
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.
Definition: Algorithm.cpp:842
void progress(double p, const std::string &msg="", double estimatedTime=0.0, int progressPrecision=0)
Sends ProgressNotification.
Definition: Algorithm.cpp:231
@ OptionalLoad
to specify a file to read but the file doesn't have to exist
Definition: FileProperty.h:53
@ Load
allowed here which will be passed to the algorithm
Definition: FileProperty.h:52
Defines an interface to an algorithm that loads a file so that it can take part in the automatic sele...
Definition: IFileLoader.h:19
Helper class for reporting progress from algorithms.
Definition: Progress.h:25
A property class for workspaces.
LoadILLPolarizedDiffraction : Loads ILL polarized diffraction nexus files from instrument D7.
std::vector< double > loadTwoThetaDetectors(const API::MatrixWorkspace_sptr &, const NeXus::NXEntry &, const int)
Loads 2theta for each detector pixel from either the nexus file or the Instrument Parameter File.
std::vector< double > prepareAxes(const NeXus::NXEntry &)
Prepares values for bin edges depending of measurement type.
API::WorkspaceGroup_sptr sortPolarisations()
Ensures that the order of flipper state values is 'ON' and then 'OFF' for each polarisation orientati...
API::MatrixWorkspace_sptr transposeMonochromatic(const API::MatrixWorkspace_sptr &)
Transposes given 2D workspace with monochromatic data.
API::MatrixWorkspace_sptr initStaticWorkspace(const NeXus::NXEntry &)
Initializes the output workspace based on the resolved instrument.
void init() override
Initialize the algorithm's properties.
const std::string name() const override
Algorithms name for identification.
void loadData()
Loads the polarized detector data, sets up workspaces and labels according to the measurement type an...
std::string m_instName
instrument name to load the IDF
std::vector< double > loadBankParameters(const API::MatrixWorkspace_sptr &, const int)
Loads offsets and slopes for each detector bank from the workspace entry.
void moveTwoTheta(const NeXus::NXEntry &, const API::MatrixWorkspace_sptr &)
Rotates each pixel to its corresponding 2theta read from the file.
void loadMetaData()
Dumps the metadata from the file for each entry separately.
std::vector< API::MatrixWorkspace_sptr > m_outputWorkspaceGroup
vector with output workspaces
std::map< std::string, std::string > validateInputs() override
Perform validation of ALL the input properties of the algorithm.
const std::string category() const override
Algorithm's category for identification.
int version() const override
Algorithm's version for identification.
API::MatrixWorkspace_sptr convertSpectrumAxis(API::MatrixWorkspace_sptr)
Converts the spectrum axis to scattering angle.
const std::string summary() const override
Algorithm's summary for use in the GUI and help.
void loadInstrument(const API::MatrixWorkspace_sptr &, const std::string &)
Runs LoadInstrument as child to link the instrument to workspace.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
void setPropertySettings(const std::string &name, std::unique_ptr< IPropertySettings > settings)
Defines a wrapper around a file whose internal structure can be accessed using the NeXus API.
OptionalBool : Tri-state bool.
Definition: OptionalBool.h:25
Class for quaternions.
Definition: Quat.h:39
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
static const UnitLabel EmptyLabel
Empty label.
Class for 3D vectors.
Definition: V3D.h:34
NXInt openNXInt(const std::string &name) const
Creates and opens an integer dataset.
Definition: NexusClasses.h:546
void close()
Close this class.
std::vector< NXClassInfo > & groups() const
Returns a list of all classes (or groups) in this NXClass.
Definition: NexusClasses.h:589
NXDataSetTyped< T > openNXDataSet(const std::string &name) const
Templated method for creating datasets.
Definition: NexusClasses.h:536
NXFloat openNXFloat(const std::string &name) const
Creates and opens a float dataset.
Definition: NexusClasses.h:551
std::string getString(const std::string &name) const
Returns a string.
Templated class implementation of NXDataSet.
Definition: NexusClasses.h:203
void load(const int blocksize=1, int i=-1, int j=-1, int k=-1, int l=-1) override
Implementation of the virtual NXDataSet::load(...) method.
Definition: NexusClasses.h:289
Implements NXentry Nexus class.
Definition: NexusClasses.h:898
Implements NXroot Nexus class.
Definition: NexusClasses.h:922
NXEntry openEntry(const std::string &name)
Opens an entry – a topmost Nexus class.
Definition: NexusClasses.h:939
std::shared_ptr< WorkspaceGroup > WorkspaceGroup_sptr
shared pointer to Mantid::API::WorkspaceGroup
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
void addNexusFieldsToWsRun(NXhandle nxfileID, API::Run &runDetails, const std::string &entryName="", bool useFullPath=false)
Add properties from a nexus file to the workspace run.
Definition: LoadHelper.cpp:131
std::string dateTimeInIsoFormat(const std::string &)
Parses the date as formatted at the ILL: 29-Jun-12 11:27:26 and converts it to the ISO format used in...
Definition: LoadHelper.cpp:421
std::unique_ptr< T > create(const P &parent, const IndexArg &indexArg, const HistArg &histArg)
This is the create() method that all the other create() methods call.
std::shared_ptr< const IComponent > IComponent_const_sptr
Typdef of a shared pointer to a const IComponent.
Definition: IComponent.h:161
std::shared_ptr< const Instrument > Instrument_const_sptr
Shared pointer to an const instrument object.
std::enable_if< std::is_pointer< Arg >::value, bool >::type threadSafe(Arg workspace)
Thread-safety check Checks the workspace to ensure it is suitable for multithreaded access.
Definition: MultiThreaded.h:22
std::string to_string(const wide_integer< Bits, Signed > &n)
@ Input
An input workspace.
Definition: Property.h:53
@ Output
An output workspace.
Definition: Property.h:54