34#include "MantidNexus/NexusFile.h"
39double wavelengthToTOF(
const double lambda,
const double l1,
const double l2) {
48constexpr double degToRad(
const double x) {
return x * M_PI / 180.; }
54constexpr double radToDeg(
const double x) {
return x * 180. / M_PI; }
60constexpr double mmToMeter(
const double x) {
return x * 1.e-3; }
70 for (
size_t i = 0; i < nHisto; ++i) {
71 if (!spectrumInfo.isMonitor(i)) {
76 int end =
static_cast<int>(nHisto) - 1;
77 for (ptrdiff_t i =
static_cast<ptrdiff_t
>(nHisto) - 1; i != 0; --i) {
78 if (!spectrumInfo.isMonitor(i)) {
83 return std::pair<int, int>{begin, end};
91 std::iota(xs.begin(), xs.end(), 0.0);
95enum class RotationPlane { horizontal, vertical };
103Mantid::Kernel::V3D detectorPosition(
const RotationPlane plane,
const double distance,
const double angle) {
104 const double a = degToRad(angle);
105 double x = 0,
y = 0,
z = 0;
107 case RotationPlane::horizontal:
108 x = distance * std::sin(a);
109 z = distance * std::cos(a);
111 case RotationPlane::vertical:
112 y = distance * std::sin(a);
113 z = distance * std::cos(a);
128 case RotationPlane::horizontal:
131 case RotationPlane::vertical:
143using namespace Kernel;
145using namespace Nexus;
146using Mantid::Types::Core::DateAndTime;
160 if ((descriptor.isEntry(
"/entry0/wavelength") ||
161 descriptor.isEntry(
"/entry0/theta"))
162 && descriptor.isEntry(
"/entry0/experiment_identifier") && descriptor.isEntry(
"/entry0/mode") &&
163 (descriptor.isEntry(
"/entry0/instrument/VirtualChopper") ||
164 descriptor.isEntry(
"/entry0/instrument/Theta"))
175 "Name of the Nexus file to load");
177 "Name of the output workspace");
179 "Foreground peak position in fractional workspace "
180 "index (if not given the peak is searched for and fitted).");
182 "The fractional workspace index of the geometric centre of "
183 "the detector at incident beam axis (127.5 for D17 and Figaro).");
184 const std::vector<std::string> measurements({
"DirectBeam",
"ReflectedBeam"});
185 declareProperty(
"Measurement",
"DirectBeam", std::make_unique<StringListValidator>(measurements),
186 "Load as direct or reflected beam.");
189 "Start workspace index used for peak fitting.");
191 "End workspace index used for peak fitting.");
192 declareProperty(
"FitRangeLower", -1.,
"Minimum wavelength used for peak fitting.");
193 declareProperty(
"FitRangeUpper", -1.,
"Maximum wavelength used for peak fitting.");
194 const std::vector<std::string> availableUnits{
"Wavelength",
"TimeOfFlight"};
195 declareProperty(
"XUnit",
"Wavelength", std::make_shared<StringListValidator>(availableUnits),
196 "X unit of the OutputWorkspace");
198 "A dictionary of key-pair values for logs to be replaced.");
232 std::string instrumentName = entry.
getString(instrumentNameAddress.append(
"/name"));
233 if (instrumentName.empty())
234 throw std::runtime_error(
"Cannot set the instrument name from the Nexus file!");
235 boost::to_lower(instrumentName);
236 if (instrumentName ==
"d17") {
238 }
else if (instrumentName ==
"figaro") {
241 std::ostringstream str;
242 str <<
"Unsupported instrument: " << instrumentName <<
'.';
243 throw std::runtime_error(str.str());
245 g_log.
debug() <<
"Instrument name: " << instrumentName <<
'\n';
254 NXInt firstChopper = entry.
openNXInt(
"instrument/ChopperSetting/firstChopper");
256 NXInt secondChopper = entry.
openNXInt(
"instrument/ChopperSetting/secondChopper");
257 secondChopper.
load();
276 convertToWavelength->initialize();
279 convertToWavelength->setPropertyValue(
"Target",
"Wavelength");
280 convertToWavelength->executeAsChildAlg();
292 g_log.
debug() <<
"Number of monitors: " << monitorNames.size() <<
'\n';
293 for (
size_t i = 0; i < monitorNames.size(); ++i) {
295 g_log.
debug() <<
"Data size of monitor ID " << i <<
" is " << monitorNames[i].size() <<
'\n';
302 m_localWorkspace->getAxis(0)->unit() = UnitFactory::Instance().create(
"TOF");
343 throw std::runtime_error(
"The log with the given name does not exist " + entryName);
354 const std::vector<std::string> monitors{
"monitor1/data",
"monitor2/data"};
366 std::vector<double> xVals;
370 if (run.hasProperty(
"Distance.edelay_delay"))
372 else if (run.hasProperty(
"Theta.edelay_delay"))
374 else if (run.hasProperty(
"MainParameters.edelay_delay")) {
377 g_log.
warning() <<
"Unable to find edelay_delay from the file\n";
381 std::string chopper{
"Chopper"};
382 double chop1Speed{0.0}, chop1Phase{0.0}, chop2Speed{0.0}, chop2Phase{0.0};
385 std::string chop1SpeedName, chop1PhaseName, chop2SpeedName, chop2PhaseName;
386 if (duration > 30.0) {
387 chop1SpeedName = instrument->getStringParameter(
"chopper1_speed")[0];
388 chop1PhaseName = instrument->getStringParameter(
"chopper1_phase")[0];
389 chop2SpeedName = instrument->getStringParameter(
"chopper2_speed")[0];
390 chop2PhaseName = instrument->getStringParameter(
"chopper2_phase")[0];
392 chop1SpeedName = instrument->getStringParameter(
"chopper1_speed_alt")[0];
393 chop1PhaseName = instrument->getStringParameter(
"chopper1_phase_alt")[0];
394 chop2SpeedName = instrument->getStringParameter(
"chopper2_speed_alt")[0];
395 chop2PhaseName = instrument->getStringParameter(
"chopper2_phase_alt")[0];
401 if (chop1Phase > 360.) {
404 std::swap(chop1Phase, chop2Speed);
409 if (chop1Phase > 360.0)
415 }
else if (run.hasProperty(
m_offsetFrom +
".pickup_offset")) {
418 throw std::runtime_error(
"Unable to find chopper pickup offset");
423 }
else if (run.hasProperty(
m_offsetFrom +
".openOffset")) {
426 throw std::runtime_error(
"Unable to find chopper open offset");
430 chopper =
"Virtual chopper";
439 g_log.
debug() <<
"Open offset: " << openOffset <<
'\n';
440 g_log.
debug() <<
"Chopper 1 phase: " << chop1Phase <<
'\n';
441 g_log.
debug() << chopper <<
" 1 speed: " << chop1Speed <<
'\n';
442 g_log.
debug() << chopper <<
" 2 phase: " << chop2Phase <<
'\n';
443 g_log.
debug() << chopper <<
" 2 speed: " << chop2Speed <<
'\n';
445 if (chop1Speed <= 0.0) {
446 g_log.
error() <<
"First chopper velocity " << chop1Speed <<
". Check you NeXus file.\n";
449 const double chopWindow = instrument->getNumberParameter(
"chopper_window_opening")[0];
450 m_localWorkspace->mutableRun().addProperty(
"ChopperWindow", chopWindow,
"degree",
true);
451 g_log.
debug() <<
"Chopper Opening Window [degrees]" << chopWindow <<
'\n';
453 const double t_TOF2 =
m_tofDelay - 1.e+6 * 60.0 * (POFF - chopWindow + chop2Phase - chop1Phase + openOffset) /
454 (2.0 * 360 * chop1Speed);
455 g_log.
debug() <<
"t_TOF2: " << t_TOF2 <<
'\n';
457 for (
int channelIndex = 0; channelIndex < static_cast<int>(
m_numberOfChannels) + 1; ++channelIndex) {
459 xVals.emplace_back(t_TOF1 + t_TOF2);
462 g_log.
debug(
"Time channel index for axis description \n");
464 xVals.emplace_back(
static_cast<double>(t));
478 const std::vector<double> &xVals) {
481 const int nb_monitors =
static_cast<int>(monitorNames.size());
483 if (!xVals.empty()) {
488 for (
auto im = 0; im < nb_monitors; ++im) {
489 const std::string monitorDataSetName(
"monitor" +
std::to_string(im + 1) +
"/data");
515 auto const bgs3 =
m_localWorkspace->mutableRun().getLogAsSingleValue(
"BGS3.value");
522 if (logsToReplace !=
nullptr && logsToReplace->propertyCount() > 0) {
523 for (
auto *prop : logsToReplace->getProperties()) {
524 if (prop->type() ==
"number") {
525 runDetails.
addProperty(prop->name(), std::stod(prop->value()),
true);
527 runDetails.
addProperty(prop->name(), prop->value(),
true);
539 if (!
isDefault(
"ForegroundPeakCentre")) {
543 auto startIndex = autoIndices.first;
544 auto endIndex = autoIndices.second;
545 if (!
isDefault(
"FitStartWorkspaceIndex")) {
546 startIndex =
getProperty(
"FitStartWorkspaceIndex");
548 if (!
isDefault(
"FitEndWorkspaceIndex")) {
552 integration->initialize();
554 integration->setProperty(
"OutputWorkspace",
"__unused_for_child");
555 integration->setProperty(
"StartWorkspaceIndex", startIndex);
556 integration->setProperty(
"EndWorkspaceIndex", endIndex);
558 integration->setProperty(
"RangeLower",
562 integration->setProperty(
"RangeUpper",
565 integration->execute();
568 transpose->initialize();
569 transpose->setProperty(
"InputWorkspace", integralWS);
570 transpose->setProperty(
"OutputWorkspace",
"__unused_for_child");
571 transpose->execute();
572 integralWS = transpose->getProperty(
"OutputWorkspace");
573 rebinIntegralWorkspace(*integralWS);
575 const auto maxValueIt = std::max_element(integralWS->y(0).cbegin(), integralWS->y(0).cend());
576 const double height = *maxValueIt;
578 const size_t maxIndex = std::distance(integralWS->y(0).cbegin(), maxValueIt);
579 const auto centreByMax =
static_cast<double>(maxIndex);
580 const auto &ys = integralWS->y(0);
581 auto lessThanHalfMax = [
height](
const double x) {
return x < 0.5 *
height; };
582 using IterType = HistogramData::HistogramY::const_iterator;
583 std::reverse_iterator<IterType> revMaxValueIt{maxValueIt};
584 auto revMinFwhmIt = std::find_if(revMaxValueIt, ys.crend(), lessThanHalfMax);
585 auto maxFwhmIt = std::find_if(maxValueIt, ys.cend(), lessThanHalfMax);
586 std::reverse_iterator<IterType> revMaxFwhmIt{maxFwhmIt};
587 if (revMinFwhmIt == ys.crend() || maxFwhmIt == ys.cend()) {
588 return centreByMax + startIndex;
590 const auto fwhm =
static_cast<double>(std::distance(revMaxFwhmIt, revMinFwhmIt) + 1);
592 auto func = API::FunctionFactory::Instance().createFunction(
"CompositeFunction");
594 Kernel::DynamicPointerCastHelper::dynamicPointerCastWithCheck<API::CompositeFunction, API::IFunction>(func);
595 func = API::FunctionFactory::Instance().createFunction(
"Gaussian");
597 Kernel::DynamicPointerCastHelper::dynamicPointerCastWithCheck<API::IPeakFunction, API::IFunction>(func);
598 gaussian->setHeight(
height);
599 gaussian->setCentre(centreByMax);
600 gaussian->setFwhm(fwhm);
601 sum->addFunction(gaussian);
602 func = API::FunctionFactory::Instance().createFunction(
"LinearBackground");
603 func->setParameter(
"A0", 0.);
604 func->setParameter(
"A1", 0.);
605 sum->addFunction(func);
609 fit->setProperty(
"Function", std::dynamic_pointer_cast<API::IFunction>(sum));
610 fit->setProperty(
"InputWorkspace", integralWS);
611 fit->setProperty(
"StartX", centreByMax - 3 * fwhm);
612 fit->setProperty(
"EndX", centreByMax + 3 * fwhm);
614 const std::string fitStatus = fit->getProperty(
"OutputStatus");
615 if (fitStatus !=
"success") {
616 g_log.
warning(
"Fit not successful, using position of max value.\n");
617 return centreByMax + startIndex;
619 const auto centre = gaussian->centre();
620 return centre + startIndex;
628 m_localWorkspace->mutableRun().addProperty(
"reduction.line_position", peakCentre,
true);
629 const double detectorCentre =
getProperty(
"DetectorCentreFractionalIndex");
632 if (measurement ==
"ReflectedBeam") {
635 g_log.
warning(
"Sample angle is either 0 or doesn't exist in the file. "
636 "Please specify BraggAngle manually for reflected beams.");
655 std::string entryName;
657 if (entry.
isValid(
"instrument/SAN/value")) {
658 entryName =
"instrument/SAN/value";
659 }
else if (entry.
isValid(
"instrument/san/value")) {
660 entryName =
"instrument/san/value";
663 if (entry.
isValid(
"instrument/Theta/wanted_theta")) {
664 entryName =
"instrument/Theta/wanted_theta";
667 if (!entryName.empty()) {
677 const auto &detectorPanels = instrument->getAllComponentsWithName(
"detector");
678 if (detectorPanels.size() != 1) {
679 throw std::runtime_error(
"IDF should have a single 'detector' component.");
681 const auto &detector = std::dynamic_pointer_cast<const Geometry::RectangularDetector>(detectorPanels.front());
694 const std::string componentName =
"detector";
696 const auto newpos = detectorPosition(rotPlane,
m_detectorDistance, detectorRotationAngle);
699 const auto rotation = detectorFaceRotation(rotPlane, detectorRotationAngle);
705 double slit1ToSample{0.0};
706 double slit2ToSample{0.0};
710 const double offset =
m_sampleZOffset / std::cos(degToRad(deflectionAngle));
711 if (run.hasProperty(
"Distance.S2_Sample")) {
712 slit1ToSample = mmToMeter(
doubleFromRun(
"Distance.S2_Sample"));
714 throw std::runtime_error(
"Unable to find slit 2 to sample distance");
716 if (run.hasProperty(
"Distance.S3_Sample")) {
717 slit2ToSample = mmToMeter(
doubleFromRun(
"Distance.S3_Sample"));
719 throw std::runtime_error(
"Unable to find slit 3 to sample distance");
721 slit2ToSample += offset;
722 slit1ToSample += offset;
724 if (run.hasProperty(
"Distance.S2toSample")) {
725 slit1ToSample = mmToMeter(
doubleFromRun(
"Distance.S2toSample"));
726 }
else if (run.hasProperty(
"Distance.S2_Sample")) {
727 slit1ToSample = mmToMeter(
doubleFromRun(
"Distance.S2_Sample"));
729 throw std::runtime_error(
"Unable to find slit 2 to sample distance");
731 if (run.hasProperty(
"Distance.S3toSample")) {
732 slit2ToSample = mmToMeter(
doubleFromRun(
"Distance.S3toSample"));
733 }
else if (run.hasProperty(
"Distance.S3_Sample")) {
734 slit2ToSample = mmToMeter(
doubleFromRun(
"Distance.S3_Sample"));
736 throw std::runtime_error(
"Unable to find slit 3 to sample distance");
739 V3D pos{0.0, 0.0, -slit1ToSample};
741 pos = {0.0, 0.0, -slit2ToSample};
748 const std::string source =
"chopper1";
765 const double detectorDistance)
const {
766 const double offsetWidth = (detectorCentre - peakCentre) *
m_pixelWidth;
770 return sign * radToDeg(std::atan2(offsetWidth, detectorDistance));
777 std::string distanceEntry;
779 distanceEntry =
"det.value";
781 distanceEntry =
"Distance.Sample_CenterOfDetector_distance";
789 std::string offsetEntry;
791 if (run.hasProperty(
"Theta.sampleHorizontalOffset"))
792 offsetEntry =
"Theta.sampleHorizontalOffset";
793 else if (run.hasProperty(
"Distance.sampleHorizontalOffset")) {
794 offsetEntry =
"Distance.sampleHorizontalOffset";
795 }
else if (run.hasProperty(
"Distance.sample_changer_horizontal_offset")) {
796 offsetEntry =
"Distance.sample_changer_horizontal_offset";
797 }
else if (run.hasProperty(
"Theta.sample_horizontal_offset")) {
798 offsetEntry =
"Theta.sample_horizontal_offset";
800 throw std::runtime_error(
"Unable to find sample horizontal offset in the file");
812 const std::string chopperGapUnit =
m_localWorkspace->getInstrument()->getStringParameter(
"chopper_gap_unit")[0];
813 const double scale = (chopperGapUnit ==
"cm") ? 0.01 : (chopperGapUnit ==
"mm") ? 0.001 : 1.;
815 double pairSeparation;
816 if (run.hasProperty(
"VirtualChopper.dist_chop_samp")) {
820 m_localWorkspace->mutableRun().addProperty(
"VirtualChopper.dist_chop_samp", pairCentre,
"meter",
true);
821 pairSeparation =
doubleFromRun(
"Distance.ChopperGap") * scale;
824 pairCentre -= 0.5 * pairSeparation;
825 }
else if (run.hasProperty(
"VirtualChopper.MidChopper_Sample_distance")) {
828 pairCentre = mmToMeter(
doubleFromRun(
"VirtualChopper.MidChopper_Sample_distance"));
829 pairSeparation =
doubleFromRun(
"Distance.ChopperGap") * scale;
830 m_localWorkspace->mutableRun().addProperty(
"VirtualChopper.MidChopper_Sample_distance", pairCentre,
"meter",
832 }
else if (run.hasProperty(
"Distance.Chopper1_Sample")) {
834 pairCentre = mmToMeter(
doubleFromRun(
"Distance.MidChopper_Sample"));
835 pairSeparation =
doubleFromRun(
"Distance.ChopperGap") * scale;
836 m_localWorkspace->mutableRun().addProperty(
"VirtualChopper.MidChopper_Sample_distance", pairCentre,
"meter",
839 throw std::runtime_error(
"Unable to extract chopper to sample distance");
843 m_localWorkspace->mutableRun().addProperty(
"Distance.ChopperGap", pairSeparation,
"meter",
true);
846 if (run.hasProperty(
"ChopperSetting.chopperpair_sample_distance")) {
847 const double chopperDist = mmToMeter(
doubleFromRun(
"ChopperSetting.chopperpair_sample_distance"));
848 std::string entryName =
"correct_chopper_sample_distance";
849 bool correctChopperSampleDistance =
m_localWorkspace->getInstrument()->getBoolParameter(entryName)[0];
851 if (correctChopperSampleDistance) {
855 return chopperDist + offset;
856 }
else if (run.hasProperty(
"Distance.MidChopper_Sample")) {
857 return mmToMeter(
doubleFromRun(
"Distance.MidChopper_Sample"));
859 throw std::runtime_error(
"Unable to extract chopper to sample distance");
const std::vector< double > * lambda
Mantid::Kernel::Quat(ComponentInfo::* rotation)(const size_t) const
#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.
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.
void progress(double p, const std::string &msg="", double estimatedTime=0.0, int progressPrecision=0)
Sends ProgressNotification.
bool isDefault(const std::string &name) const
const SpectrumInfo & spectrumInfo() const
Return a reference to the SpectrumInfo object.
@ Load
allowed here which will be passed to the algorithm
void addProperty(Kernel::Property *prop, bool overwrite=false)
Add data to the object in the form of a property.
Base MatrixWorkspace Abstract Class.
HistogramData::HistogramX & mutableX(const size_t index) &
virtual std::size_t getNumberHistograms() const =0
Returns the number of histograms in the workspace.
Helper class for reporting progress from algorithms.
This class stores information regarding an experimental run as a series of log entries.
A property class for workspaces.
LoadILLReflectometry : Loads an ILL reflectometry Nexus data file.
size_t m_numberOfChannels
(1: TOF (default), 0: monochromatic)
void exec() override
Execute the algorithm.
double doubleFromRun(const std::string &entryName) const
LoadILLReflectometry::doubleFromRun Returns a sample log a single double.
void loadNexusEntriesIntoProperties()
Use the LoadHelper utility to load most of the nexus entries into workspace sample log properties.
std::string m_chopper1Name
double detectorRotation()
Compute the detector rotation angle around origin.
double offsetAngle(const double peakCentre, const double detectorCentre, const double detectorDistance) const
Calculate the offset angle between detector center and peak.
double sampleDetectorDistance() const
Return the sample to detector distance for the current instrument.
double m_detectorDistance
double sourceSampleDistance() const
Return the source to sample distance for the current instrument.
Mantid::Types::Core::DateAndTime m_startTime
std::vector< std::string > getMonitorNames()
Load monitor data.
void initPixelWidth()
Initialize m_pixelWidth from the IDF as the step of rectangular detector.
void sampleHorizontalOffset()
Return the horizontal offset along the z axis.
void convertTofToWavelength()
Call child algorithm ConvertUnits for conversion from TOF to wavelength Note that DAN calibration is ...
void initNames(const Nexus::NXEntry &entry)
Init names of sample logs based on instrument specific NeXus file entries.
void sampleAngle(const Nexus::NXEntry &entry)
Sets the sample angle (i.e.
void initWorkspace(const std::vector< std::string > &monitorNames)
Creates the workspace and initialises member variables with the corresponding values.
void placeDetector()
Update detector position according to data file.
size_t m_numberOfHistograms
API::MatrixWorkspace_sptr m_localWorkspace
std::string m_sampleAngleName
void loadDataDetails(const Nexus::NXEntry &entry)
Load Data details (number of tubes, channels, etc)
std::vector< double > getXValues()
Determine x values (unit time-of-flight)
double reflectometryPeak()
Gaussian fit to determine peak position if no user position given.
void placeSource()
Update source position.
double collimationAngle() const
Return the incident neutron deflection angle.
void placeSlits()
Update the slit positions.
void loadData(const Nexus::NXEntry &entry, const std::vector< std::string > &monitorNames, const std::vector< double > &xVals)
Load data from nexus file.
void init() override
Initialize the algorithm's properties.
std::string m_chopper2Name
BoundedValidator is a validator that requires the values to be between upper or lower bounds,...
Records the filename and the description of failure.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
void debug(const std::string &msg)
Logs at debug level.
void error(const std::string &msg)
Logs at error level.
void warning(const std::string &msg)
Logs at warning level.
The concrete, templated class for properties.
static double run(const std::string &src, const std::string &dest, const double srcValue, const double l1, const double l2, const double theta, const DeltaEMode::Type emode, const double efixed)
Convert a single value between the given units (as strings)
Class that provides for a standard Nexus exception.
std::string getString(const std::string &name) const
Returns a string.
NXFloat openNXFloat(const std::string &name) const
Creates and opens a float dataset.
void close()
Close this class.
NXInt openNXInt(const std::string &name) const
Creates and opens an integer dataset.
bool isValid(const std::string &address) const
Check if a address exists relative to the current class address.
Templated class implementation of NXDataSet.
void load()
Read all of the datablock in.
Implements NXentry Nexus class.
Implements NXroot Nexus class.
NXEntry openFirstEntry()
Open the first NXentry in the file.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
void addNexusFieldsToWsRun(Nexus::File &filehandle, API::Run &runDetails, const std::string &entryName="", bool useFullAddress=false)
Add properties from a nexus file to the workspace run.
void rotateComponent(const API::MatrixWorkspace_sptr &ws, const std::string &componentName, const Kernel::Quat &rot)
LoadHelper::rotateComponent.
Nexus::NXInt getIntDataset(const Nexus::NXEntry &, const std::string &)
Fetches NXInt data from the requested group name in the entry provided.
void moveComponent(const API::MatrixWorkspace_sptr &ws, const std::string &componentName, const Kernel::V3D &newPos)
LoadHelper::moveComponent.
void fillStaticWorkspace(const API::MatrixWorkspace_sptr &, const Mantid::Nexus::NXInt &, const std::vector< double > &xAxis, int64_t initialSpectrum=0, bool pointData=false, const std::vector< detid_t > &detectorIDs=std::vector< int >(), const std::set< detid_t > &acceptedID=std::set< int >(), const std::tuple< short, short, short > &axisOrder=std::tuple< short, short, short >(0, 1, 2))
Fills workspace with histogram data from provided data structure.
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...
void loadEmptyInstrument(const API::MatrixWorkspace_sptr &ws, const std::string &instrumentName, const std::string &instrumentAddress="")
Loads empty instrument of chosen name into a provided workspace.
std::string findInstrumentNexusAddress(const Mantid::Nexus::NXEntry &)
Finds the address for the instrument name in the nexus file Usually of the form: entry0/<NXinstrument...
std::shared_ptr< const PropertyManager > PropertyManager_const_sptr
shared pointer to Mantid::Kernel::PropertyManager(const version)
constexpr double EMPTY_DBL() noexcept
Returns what we consider an "empty" double within a property.
std::string to_string(const wide_integer< Bits, Signed > &n)
@ Input
An input workspace.
@ Output
An output workspace.