21#include "MantidHistogramData/LinearGenerator.h"
34using namespace Kernel;
44 : m_supportedInstruments{
"D11",
"D22",
"D33",
"D16"}, m_defaultBinning{0, 0}, m_resMode(
"nominal"), m_isTOF(
false),
59 return "Loads ILL nexus files for SANS instruments D11, D16, D22, D33.";
73 ((descriptor.
pathExists(
"/entry0/reactor_power") && descriptor.
pathExists(
"/entry0/instrument_name")) ||
74 (descriptor.
pathExists(
"/entry0/instrument/name") && descriptor.
pathExists(
"/entry0/acquisition_mode") &&
75 !descriptor.
pathExists(
"/entry0/instrument/Detector"))))
88 "Name of the nexus file to load");
90 "The name to use for the output workspace");
91 auto mustBePositive = std::make_shared<BoundedValidator<double>>();
92 mustBePositive->setLower(0);
94 "The wavelength of the experiment, in angstroms. Used only for D16. Will "
95 "override the nexus' value if there is one.");
116 progress.report(
"Moving detectors");
130 distance = firstEntry.
getFloat(instrumentPath +
"/Det/value") / 1000;
131 }
catch (std::runtime_error &) {
134 const double angle = firstEntry.
getFloat(instrumentPath +
"/Gamma/value");
135 placeD16(-angle, distance,
"detector");
144 double finalDistance = firstEntry.
getFloat(instrumentPath +
"/Detector 1/det_calc");
146 double currentDistance = pos.
Z();
150 runDetails.
addProperty<
double>(
"L2", finalDistance,
true);
155 const std::string backIndex =
m_localWorkspace->getInstrument()->getStringParameter(
"back_detector_index")[0];
156 const std::string frontIndex =
m_localWorkspace->getInstrument()->getStringParameter(
"front_detector_index")[0];
159 double distance = firstEntry.
getFloat(instrumentPath +
"/Detector " + backIndex +
"/det" + backIndex +
"_calc");
162 runDetails.
addProperty<
double>(
"L2", distance,
true);
164 double offset = firstEntry.
getFloat(instrumentPath +
"/Detector " + backIndex +
"/dtr" + backIndex +
"_actual");
168 distance = firstEntry.
getFloat(instrumentPath +
"/Detector " + frontIndex +
"/det" + frontIndex +
"_calc");
172 offset = firstEntry.
getFloat(instrumentPath +
"/Detector " + frontIndex +
"/dtr" + frontIndex +
"_actual");
174 double angle = firstEntry.
getFloat(instrumentPath +
"/Detector " + frontIndex +
"/dan" + frontIndex +
"_actual");
183 progress.report(
"Moving detectors");
186 runDetails.
addProperty<
double>(
"L2", distance,
true);
193 progress.report(
"Setting sample logs");
204 if (instrumentNamePath.empty()) {
205 throw std::runtime_error(
"Cannot set the instrument name from the Nexus file!");
217 " is not supported. Only D11, D16, D22 and D33 are supported");
229 const std::string &instrumentNamePath) {
230 std::string detectorPath(instrumentNamePath +
"/detector");
259 int &numberOfPixelsPerTube) {
261 numberOfChannels = data.
dim0();
262 numberOfTubes = data.
dim1();
263 numberOfPixelsPerTube = data.
dim2();
265 numberOfPixelsPerTube = data.
dim1();
266 numberOfChannels = data.
dim2();
267 numberOfTubes = data.
dim0();
269 g_log.
debug() <<
"Dimensions found:\n- Number of tubes: " << numberOfTubes
270 <<
"\n- Number of pixels per tube: " << numberOfPixelsPerTube
271 <<
"\n- Number of channels: " << numberOfChannels <<
"\n";
285 path =
"data_scan/detector_data/data";
290 size_t numberOfHistograms;
296 const size_t numberOfWiresInD16B = 1152;
297 const size_t numberOfPixelsPerWireInD16B = 192;
301 if (data.
dim1() == numberOfWiresInD16B && data.
dim2() == numberOfPixelsPerWireInD16B) {
308 int numberOfTubes, numberOfPixelsPerTubes, numberOfChannels;
309 getDataDimensions(data, numberOfChannels, numberOfTubes, numberOfPixelsPerTubes);
319 std::vector<double> binning =
m_isD16Omega && numberOfChannels > 1
330 if (data.
dim1() == 128) {
353 size_t numberOfHistograms =
354 static_cast<size_t>(dataCenter.
dim0() * dataCenter.
dim1() + dataRight.
dim0() * dataRight.
dim1() +
355 dataLeft.
dim0() * dataLeft.
dim1()) +
358 int numberOfChannels, numberOfPixelsPerTubeCenter, numberOfTubesCenter;
359 getDataDimensions(dataCenter, numberOfChannels, numberOfTubesCenter, numberOfPixelsPerTubeCenter);
366 if (numberOfChannels != 1) {
367 std::vector<double> frames(numberOfChannels, 0);
368 for (
int i = 0; i < numberOfChannels; ++i) {
381 if (numberOfChannels != 1) {
384 if (nextIndex < numberOfHistograms)
390 const HistogramData::Counts histoCounts(durations(), durations() + numberOfChannels);
393 HistogramData::CountVariances(std::vector<double>(numberOfChannels, 0)));
412 size_t numberOfHistograms =
413 static_cast<size_t>(data2_data.
dim0() * data2_data.
dim1() + data1_data.
dim0() * data1_data.
dim1()) +
416 int numberOfChannels, numberOfPixelsPerTubeCenter, numberOfTubesCenter;
417 getDataDimensions(data1_data, numberOfChannels, numberOfTubesCenter, numberOfPixelsPerTubeCenter);
425 if (numberOfChannels != 1) {
426 std::vector<double> frames(numberOfChannels, 0);
427 for (
int i = 0; i < numberOfChannels; ++i) {
436 const std::string backIndex =
m_localWorkspace->getInstrument()->getStringParameter(
"back_detector_index")[0];
438 if (backIndex ==
"2") {
448 if (numberOfChannels != 1) {
451 const HistogramData::Counts histoCounts(durations(), durations() + numberOfChannels);
454 HistogramData::CountVariances(std::vector<double>(numberOfChannels, 0)));
485 if (dataRear.
dim2() != dataRight.
dim2() && dataRight.
dim2() != dataLeft.
dim2() &&
487 throw std::runtime_error(
"The time bins have not the same dimension for all the 5 detectors!");
489 const auto numberOfHistograms =
static_cast<size_t>(
498 std::vector<double> binningRear, binningRight, binningLeft, binningDown, binningUp;
500 if (firstEntry.
getFloat(
"mode") == 0.0) {
501 g_log.
debug(
"Getting default wavelength bins...");
515 g_log.
debug(
"Master choppers are " + first +
" and " + second);
520 secondChopper.
load();
521 m_sourcePos = (firstChopper[0] + secondChopper[0]) / 2.;
523 g_log.
debug(
"Getting wavelength bins from the nexus file...");
529 channelWidthSum.
load();
530 channelWidthTimes.
load();
531 std::string distancePrefix(instrumentPath +
"/tof/tof_distance_detector");
532 binningRear =
getVariableTimeBinning(firstEntry, distancePrefix +
"1", channelWidthSum, channelWidthTimes);
533 binningRight =
getVariableTimeBinning(firstEntry, distancePrefix +
"2", channelWidthSum, channelWidthTimes);
534 binningLeft =
getVariableTimeBinning(firstEntry, distancePrefix +
"3", channelWidthSum, channelWidthTimes);
535 binningDown =
getVariableTimeBinning(firstEntry, distancePrefix +
"4", channelWidthSum, channelWidthTimes);
537 }
catch (
const std::runtime_error &) {
543 std::string binPathPrefix(instrumentPath +
"/tof/tof_wavelength_detector");
549 }
catch (std::runtime_error &e) {
550 throw std::runtime_error(
"Unable to load the wavelength axes for TOF data " + std::string(e.what()));
555 g_log.
debug(
"Loading the data into the workspace...");
575 for (std::vector<NXClassInfo>::const_iterator it = firstEntry.
groups().begin(); it != firstEntry.
groups().end();
577 if (it->nxclass ==
"NXmonitor") {
581 g_log.
debug() <<
"Monitor: " << it->nxname <<
" dims = " << data.
dim0() <<
"x" << data.
dim1() <<
"x"
582 << data.
dim2() <<
'\n';
583 const HistogramData::Counts histoCounts(data(), data() + data.
dim2());
585 const HistogramData::CountVariances histoVariances(data(), data() + data.
dim2());
589 HistogramData::BinEdges histoBinEdges(data.
dim2() + 1, HistogramData::LinearGenerator(0.0, 1));
593 HistogramData::BinEdges histoBinEdges = HistogramData::BinEdges(
m_defaultBinning);
596 HistogramData::Points histoPoints = HistogramData::Points(
m_defaultBinning);
601 double averageMonitorCounts =
602 std::accumulate(data(), data() + data.
dim2(),
double(0)) /
static_cast<double>(data.
dim2());
604 if (averageMonitorCounts > 0) {
606 runDetails.
addProperty(
"monitor", averageMonitorCounts,
true);
623 const std::vector<double> &binning) {
624 std::string path =
"/data_scan/scanned_variables/data";
629 uint32_t monitorIndex = 3;
633 scannedVariables.
load();
635 auto firstMonitorValuePos = scannedVariables() + monitorIndex * scannedVariables.
dim1();
637 const HistogramData::Counts counts(firstMonitorValuePos, firstMonitorValuePos + scannedVariables.
dim1());
646 const HistogramData::BinEdges binEdges(binning);
649 HistogramData::Points points = HistogramData::Points(binning);
654 double averageMonitorCounts =
655 std::accumulate(firstMonitorValuePos, firstMonitorValuePos + scannedVariables.
dim1(),
double(0)) /
656 static_cast<double>(scannedVariables.
dim1());
659 if (averageMonitorCounts > 0) {
661 runDetails.
addProperty(
"monitor", averageMonitorCounts,
true);
669 if (scannedVariables.
dim1() == 1) {
670 const HistogramData::BinEdges binEdges(binning);
673 HistogramData::Points points = HistogramData::Points(binning);
692 int numberOfTubes, numberOfChannels, numberOfPixelsPerTube;
697 for (
int tubeIndex = 0; tubeIndex < numberOfTubes; ++tubeIndex) {
698 for (
int pixelIndex = 0; pixelIndex < numberOfPixelsPerTube; ++pixelIndex) {
699 std::vector<int> spectrum(numberOfChannels);
700 for (
int channelIndex = 0; channelIndex < numberOfChannels; ++channelIndex) {
701 spectrum[channelIndex] = data(channelIndex, tubeIndex, pixelIndex);
703 const size_t index = firstIndex + tubeIndex * numberOfPixelsPerTube + pixelIndex;
704 const HistogramData::Counts histoCounts(spectrum.begin(), spectrum.end());
705 const HistogramData::CountVariances histoVariances(spectrum.begin(), spectrum.end());
711 const HistogramData::BinEdges histoPoints(timeBinning);
714 const HistogramData::Points histoPoints(timeBinning);
722 for (
int tubeIndex = 0; tubeIndex < numberOfTubes; ++tubeIndex) {
723 for (
int pixelIndex = 0; pixelIndex < numberOfPixelsPerTube; ++pixelIndex) {
726 data_p = &data(0, tubeIndex, pixelIndex);
728 data_p = &data(tubeIndex, pixelIndex, 0);
730 const size_t index = firstIndex + tubeIndex * numberOfPixelsPerTube + pixelIndex;
731 const HistogramData::Counts histoCounts(data_p, data_p + numberOfChannels);
732 const HistogramData::CountVariances histoVariances(data_p, data_p + numberOfChannels);
737 const HistogramData::Points histoPoints(timeBinning);
740 const HistogramData::BinEdges binEdges(timeBinning);
747 return firstIndex + numberOfTubes * numberOfPixelsPerTube;
768 labelX->setLabel(
"Omega angle");
788 Poco::Path file(instName +
"_Definition.xml");
789 Poco::Path fullPath(directory, file);
790 return fullPath.toString();
842 mover->setProperty(
"ComponentName", componentName);
844 mover->setProperty(
"X", pos.
X());
845 mover->setProperty(
"Y", pos.
Y());
846 mover->setProperty(
"Z", distance);
847 mover->setProperty(
"RelativePosition",
false);
848 mover->executeAsChildAlg();
850 g_log.
debug() <<
"Moving component '" << componentName <<
"' to Z = " << distance <<
'\n';
861 rotater->setProperty(
"ComponentName", componentName);
862 rotater->setProperty(
"X", 0.);
863 rotater->setProperty(
"Y", 1.);
864 rotater->setProperty(
"Z", 0.);
865 rotater->setProperty(
"Angle", angle);
866 rotater->setProperty(
"RelativeRotation",
false);
867 rotater->executeAsChildAlg();
868 g_log.
debug() <<
"Rotating component '" << componentName <<
"' to angle = " << angle <<
" degrees.\n";
880 mover->setProperty(
"ComponentName", componentName);
881 mover->setProperty(
"X", sin(angle * M_PI / 180) * distance);
882 mover->setProperty(
"Y", 0.);
883 mover->setProperty(
"Z", cos(angle * M_PI / 180) * distance);
884 mover->setProperty(
"RelativePosition",
false);
885 mover->executeAsChildAlg();
890 runDetails.
addProperty<
double>(
"L2", distance,
true);
892 g_log.
debug() <<
"Moving component '" << componentName <<
"' to angle = " << angle
893 <<
" degrees and distance = " << distance <<
"metres.\n";
905 mover->setProperty(
"ComponentName", componentName);
906 mover->setProperty(
"X", shift);
907 mover->setProperty(
"Y", pos.
Y());
908 mover->setProperty(
"Z", pos.
Z());
909 mover->setProperty(
"RelativePosition",
false);
910 mover->executeAsChildAlg();
911 g_log.
debug() <<
"Moving component '" << componentName <<
"' to X = " << shift <<
'\n';
923 mover->setProperty(
"ComponentName", componentName);
924 mover->setProperty(
"X", pos.
X());
925 mover->setProperty(
"Y", shift);
926 mover->setProperty(
"Z", pos.
Z());
927 mover->setProperty(
"RelativePosition",
false);
928 mover->executeAsChildAlg();
929 g_log.
debug() <<
"Moving component '" << componentName <<
"' to Y = " << shift <<
'\n';
940 return component->getPos();
954 runDetails.
addProperty<std::string>(
"tof_mode",
"Non TOF");
956 runDetails.
addProperty<std::string>(
"tof_mode",
"TOF");
962 wavelength = entry.
getFloat(instrumentNamePath +
"/Beam/wavelength");
964 wavelength = entry.
getFloat(instrumentNamePath +
"/selector/wavelength");
966 g_log.
debug() <<
"Wavelength found in the nexus file: " << wavelength <<
'\n';
972 wavelength = std::round(wavelength * 100) / 100.;
974 if (wavelength <= 0) {
977 if (entry.
getFloat(
"mode") == 0.0) {
978 throw std::runtime_error(
"Working in Non TOF mode and the wavelength in "
979 "the file is <=0 !!! Check with the instrument "
983 double wavelengthRes = 10.;
984 const std::string entryResolution = instrumentNamePath +
"/selector/";
986 wavelengthRes = entry.
getFloat(entryResolution +
"wavelength_res");
987 }
catch (
const std::runtime_error &) {
989 wavelengthRes = entry.
getFloat(entryResolution +
"wave_length_res");
990 }
catch (
const std::runtime_error &) {
993 g_log.
information() <<
"Could not find wavelength resolution, assuming " << wavelengthRes <<
"%.\n";
998 wavelengthRes = std::round(wavelengthRes * 100) / 100.;
999 runDetails.
addProperty<
double>(
"wavelength", wavelength);
1008 std::string startDate = entry.
getString(
"start_time");
1011 runDetails.
addProperty<std::string>(
"Facility", std::string(
"ILL"));
1021 NXstatus nxStat = NXopen(filename.c_str(), NXACC_READ, &nxHandle);
1022 if (nxStat != NX_ERROR) {
1038 const double l2 = specInfo.l2(
index);
1039 const double z = specInfo.position(
index).Z();
1041 const double scale = (l1 +
z) / (l1 +
l2);
1042 std::transform(
x.begin(),
x.end(),
x.begin(), [scale](
double lambda) { return scale * lambda; });
1048 const double l2 = specInfo.l2(0);
1049 const double monitor2 = -specInfo.position(nHist - 1).Z();
1051 const double monScale = (l1 +
l2) / l1Monitor2;
1052 std::transform(firstPixel.begin(), firstPixel.end(), firstPixel.begin(),
1053 [monScale](
double lambda) { return monScale * lambda; });
1055 const HistogramData::Counts counts =
m_localWorkspace->histogram(mIndex).counts();
1056 const HistogramData::BinEdges binEdges(firstPixel);
1068 mover->setProperty(
"ComponentName",
"moderator");
1069 mover->setProperty(
"X", 0.);
1070 mover->setProperty(
"Y", 0.);
1072 mover->setProperty(
"RelativePosition",
false);
1073 mover->executeAsChildAlg();
1086 scanning_values.
load();
1088 const int nBins = scanning_values.
dim1();
1089 std::vector<double> binning(nBins, 0);
1091 for (
int i = 0; i < nBins; ++i) {
1093 binning[i] = scanning_values(0, i);
1108 const int nBins = sum.
dim0();
1109 std::vector<double> binCenters;
1110 binCenters.reserve(nBins);
1113 for (
int bin = 0; bin < nBins; ++bin) {
1115 const double tof = sum[bin] * 1E-9 - times[bin] * 1E-6 / 2.;
1117 const double velocity = distance[0] / tof;
1120 binCenters.emplace_back(
lambda);
1122 std::vector<double> binEdges;
1123 binEdges.reserve(nBins + 1);
1127 if (binEdges[0] < 0.) {
const std::vector< double > * lambda
std::map< DeltaEMode::Type, std::string > index
#define PARALLEL_FOR_IF(condition)
Empty definitions - to enable set your complier to enable openMP.
#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.
Kernel::Property * getPointerToProperty(const std::string &name) const override
Get a property by name.
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.
@ 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.
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.
LoadILLSANS; supports D11, D22 and D33 (TOF/monochromatic)
void initWorkSpaceD22B(NeXus::NXEntry &, const std::string &)
LoadILLSANS::initWorkSpaceD22B Load D22B data.
bool m_isTOF
TOF or monochromatic flag.
void setInstrumentName(const NeXus::NXEntry &, const std::string &)
Set member variable with the instrument name.
void runLoadInstrument()
Loads the instrument from the IDF.
void loadMetaData(const NeXus::NXEntry &, const std::string &)
Loads some metadata present in the nexus file.
void initWorkSpace(NeXus::NXEntry &, const std::string &)
Loads data for D11, D16 and D22.
void moveDetectorsD33(const DetectorPosition &)
Move the detector banks for D33.
void createEmptyWorkspace(const size_t, const size_t, const MultichannelType type=MultichannelType::TOF)
Create a workspace without any data in it.
std::vector< double > getOmegaBinning(const NeXus::NXEntry &entry, const std::string &path) const
LoadILLSANS::getOmegaBinning Get the binning for an omega scan for D16B files.
const std::string name() const override
Algorithm's name for identification.
const std::string summary() const override
Algorithm's summary.
int confidence(Kernel::NexusDescriptor &descriptor) const override
Returns a confidence value that this algorithm can load a file.
size_t loadDataFromD16ScanMonitors(const NeXus::NXEntry &firstEntry, size_t firstIndex, const std::vector< double > &binning)
Load data from D16B's monitor.
void init() override
Initialize the algorithm's properties.
double m_sourcePos
Source Z (for D33 TOF)
const std::string category() const override
Algorithm's category for identification.
void setFinalProperties(const std::string &filename)
Sets full sample logs.
size_t loadDataFromTubes(NeXus::NXInt &, const std::vector< double > &, size_t, const MultichannelType type=MultichannelType::TOF)
Loads data from tubes.
std::vector< double > getVariableTimeBinning(const NeXus::NXEntry &, const std::string &, const NeXus::NXInt &, const NeXus::NXFloat &) const
Returns the wavelength axis computed in VTOF mode.
void moveDetectorDistance(double distance, const std::string &componentName)
Move detectors in Z axis (X,Y are kept constant)
void initWorkSpaceD11B(NeXus::NXEntry &, const std::string &)
LoadILLSANS::initWorkSpaceD11B Load D11B data.
int version() const override
Algorithm's version for identification.
void initWorkSpaceD33(NeXus::NXEntry &, const std::string &)
Loads data for D33.
Kernel::V3D getComponentPosition(const std::string &componentName)
Get position of a component.
void setNumberOfMonitors()
LoadILLSANS::setNumberOfMonitors Set the number of monitor attribute depending on the instrument load...
void getDataDimensions(const NeXus::NXInt &data, int &numberOfChannels, int &numberOfTubes, int &numberOfPixelsPerTube)
LoadILLSANS::getDataDimensions Retrieves physical dimensions of the data from the dataset dimensions.
void moveSource()
Moves the source to the middle of the two master choppers Used only for D33 in TOF mode.
void moveDetectorVertical(double, const std::string &)
Move detectors in Y.
size_t m_numberOfMonitors
Number of monitors in this instrument.
void placeD16(double, double, const std::string &)
LoadILLSANS::placeD16 : place the D16 detector.
DetectorPosition getDetectorPositionD33(const NeXus::NXEntry &, const std::string &)
Get detector panel distances from the nexus file.
std::vector< double > m_defaultBinning
the default x-axis binning
void exec() override
Execute the algorithm.
std::vector< std::string > m_supportedInstruments
List of supported instruments.
void adjustTOF()
Adjusts pixel by pixel the wavelength axis Used only for D33 in TOF mode.
void moveDetectorHorizontal(double, const std::string &)
Move detectors in X.
API::MatrixWorkspace_sptr m_localWorkspace
to-be output workspace
void rotateInstrument(double, const std::string &)
Rotates instrument detector around y-axis in place.
bool m_isD16Omega
Data comes from a D16 omega scan flag.
std::string m_instrumentName
Name of the instrument.
size_t loadDataFromMonitors(NeXus::NXEntry &firstEntry, size_t firstIndex=0, const MultichannelType type=MultichannelType::TOF)
Loads data from all the monitors.
std::string m_resMode
Resolution mode for D11 and D22.
std::string getInstrumentFilePath(const std::string &) const
Makes up the full path of the relevant IDF dependent on resolution mode.
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 information(const std::string &msg)
Logs at information level.
Defines a wrapper around a file whose internal structure can be accessed using the NeXus API.
bool pathExists(const std::string &path) const
Query if a path exists.
OptionalBool : Tri-state bool.
virtual bool isDefault() const =0
Overriden function that returns if property has the same value that it was initialised with,...
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
constexpr double X() const noexcept
Get x.
constexpr double Y() const noexcept
Get y.
constexpr double Z() const noexcept
Get z.
NXInt openNXInt(const std::string &name) const
Creates and opens an integer dataset.
bool containsGroup(const std::string &query) const
Returns whether an individual group (or group) is present.
std::vector< NXClassInfo > & groups() const
Returns a list of all classes (or groups) in this NXClass.
float getFloat(const std::string &name) const
Returns a float.
NXFloat openNXFloat(const std::string &name) const
Creates and opens a float dataset.
std::string getString(const std::string &name) const
Returns a string.
Templated class implementation of NXDataSet.
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.
int dim2() const
Returns the number of elements along the third dimension.
int dim0() const
Returns the number of elements along the first dimension.
int dim1() const
Returns the number of elements along the second dimension.
Implements NXdata Nexus class.
NXDouble openDoubleData()
Opens data of double type.
NXInt openIntData()
Opens data of int type.
Implements NXentry Nexus class.
NXData openNXData(const std::string &name) const
Opens a NXData.
Implements NXroot Nexus class.
NXEntry openFirstEntry()
Open the first NXentry in the file.
Kernel::Logger g_log("ExperimentInfo")
static logger object
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
double calculateEnergy(double)
Calculate Neutron Energy from wavelength: .
std::string getStringFromNexusPath(const Mantid::NeXus::NXEntry &, const std::string &)
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.
void addNexusFieldsToWsRun(NXhandle nxfileID, API::Run &runDetails, const std::string &entryName="", bool useFullPath=false)
Add properties from a nexus file to the workspace run.
double getDoubleFromNexusPath(const Mantid::NeXus::NXEntry &, const std::string &)
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...
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...
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.
std::shared_ptr< const Instrument > Instrument_const_sptr
Shared pointer to an const instrument object.
void MANTID_KERNEL_DLL convertToBinBoundary(const std::vector< double > &bin_centers, std::vector< double > &bin_edges)
Convert an array of bin centers to bin boundary values.
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.
static constexpr double NeutronMass
Mass of the neutron in kg.
static constexpr double h
Planck constant in J*s.
std::string to_string(const wide_integer< Bits, Signed > &n)
double distanceSampleRear
double distanceSampleBottomTop
double distanceSampleRightLeft
@ Output
An output workspace.