Mantid
Loading...
Searching...
No Matches
LoadHelper.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2013 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#include "MantidAPI/Run.h"
10#include "MantidDataHandling/DllConfig.h"
12
13namespace Mantid {
14
15namespace DataHandling {
16
19namespace LoadHelper {
20
22std::string getStringFromNexusPath(const Mantid::NeXus::NXEntry &, const std::string &);
23double getDoubleFromNexusPath(const Mantid::NeXus::NXEntry &, const std::string &);
24std::vector<double> getTimeBinningFromNexusPath(const Mantid::NeXus::NXEntry &, const std::string &);
25double calculateEnergy(double);
26double calculateTOF(double, double);
27double getInstrumentProperty(const API::MatrixWorkspace_sptr &, const std::string &);
28void addNexusFieldsToWsRun(NXhandle nxfileID, API::Run &runDetails, const std::string &entryName = "",
29 bool useFullPath = false);
30void dumpNexusAttributes(NXhandle nxfileID);
31std::string dateTimeInIsoFormat(const std::string &);
32
33void moveComponent(const API::MatrixWorkspace_sptr &ws, const std::string &componentName, const Kernel::V3D &newPos);
34void rotateComponent(const API::MatrixWorkspace_sptr &ws, const std::string &componentName, const Kernel::Quat &rot);
35Kernel::V3D getComponentPosition(const API::MatrixWorkspace_sptr &ws, const std::string &componentName);
36
37void loadEmptyInstrument(const API::MatrixWorkspace_sptr &ws, const std::string &instrumentName,
38 const std::string &instrumentPath = "");
39
40void recurseAndAddNexusFieldsToWsRun(NXhandle nxfileID, API::Run &runDetails, std::string &parent_name,
41 std::string &parent_class, int level, bool useFullPath);
42} // namespace LoadHelper
43} // namespace DataHandling
44} // namespace Mantid
This class stores information regarding an experimental run as a series of log entries.
Definition: Run.h:38
Class for quaternions.
Definition: Quat.h:39
Class for 3D vectors.
Definition: V3D.h:34
Implements NXentry Nexus class.
Definition: NexusClasses.h:898
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
double getInstrumentProperty(const API::MatrixWorkspace_sptr &, const std::string &)
Definition: LoadHelper.cpp:109
double calculateEnergy(double)
Calculate Neutron Energy from wavelength: .
Definition: LoadHelper.cpp:82
void recurseAndAddNexusFieldsToWsRun(NXhandle nxfileID, API::Run &runDetails, std::string &parent_name, std::string &parent_class, int level, bool useFullPath)
Recursively add properties from a nexus file to the workspace run.
Definition: LoadHelper.cpp:168
void rotateComponent(const API::MatrixWorkspace_sptr &ws, const std::string &componentName, const Kernel::Quat &rot)
LoadHelper::rotateComponent.
Definition: LoadHelper.cpp:472
std::string getStringFromNexusPath(const Mantid::NeXus::NXEntry &, const std::string &)
Definition: LoadHelper.cpp:49
std::vector< double > getTimeBinningFromNexusPath(const Mantid::NeXus::NXEntry &, const std::string &)
Gets the time binning from a Nexus float array Adds an extra bin at the end.
Definition: LoadHelper.cpp:61
void loadEmptyInstrument(const API::MatrixWorkspace_sptr &ws, const std::string &instrumentName, const std::string &instrumentPath="")
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
double getDoubleFromNexusPath(const Mantid::NeXus::NXEntry &, const std::string &)
Definition: LoadHelper.cpp:53
std::string findInstrumentNexusPath(const Mantid::NeXus::NXEntry &)
Finds the path for the instrument name in the nexus file Usually of the form: entry0/<NXinstrument cl...
Definition: LoadHelper.cpp:37
void moveComponent(const API::MatrixWorkspace_sptr &ws, const std::string &componentName, const Kernel::V3D &newPos)
LoadHelper::moveComponent.
Definition: LoadHelper.cpp:454
void dumpNexusAttributes(NXhandle nxfileID)
Show attributes attached to the current Nexus entry.
Definition: LoadHelper.cpp:362
double calculateTOF(double, double)
Calculate TOF from distance.
Definition: LoadHelper.cpp:94
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
Kernel::V3D getComponentPosition(const API::MatrixWorkspace_sptr &ws, const std::string &componentName)
LoadHelper::getComponentPosition.
Definition: LoadHelper.cpp:489
Helper class which provides the Collimation Length for SANS instruments.