29#include "MantidNexus/NexusFile.h"
44 return std::find(std::begin(monitorBlocks), std::end(monitorBlocks), dataBlock) != std::end(monitorBlocks);
48 for (
auto &dataBlock : dataBlocks) {
49 if (matchesMonitorBlock(dataBlock)) {
62using namespace Kernel;
65using namespace HistogramData;
70 : m_filename(), m_instrument_name(), m_samplename(), m_detBlockInfo(), m_monBlockInfo(), m_loadBlockInfo(),
71 m_have_detector(false), m_hasVMSBlock(false), m_load_selected_spectra(false), m_wsInd2specNum_map(),
72 m_spec2det_map(), m_entrynumber(0), m_tof_data(), m_spec(), m_spec_end(nullptr), m_monitors(), m_logCreator(),
73 m_progress(), m_nexusFile() {}
82 if (descriptor.
isEntry(
"/raw_data_1",
"NXentry")) {
92 const std::vector<std::string> exts{
".nxs",
".n*"};
94 "The name of the Nexus file to load");
97 auto mustBePositiveSpectrum = std::make_shared<BoundedValidator<specnum_t>>();
98 mustBePositiveSpectrum->setLower(0);
102 auto mustBePositive = std::make_shared<BoundedValidator<int64_t>>();
103 declareProperty(
"EntryNumber",
static_cast<int64_t
>(0), mustBePositive,
104 "0 indicates that every entry is loaded, into a separate "
105 "workspace within a group. "
106 "A positive number identifies one entry to be loaded, into "
109 std::vector<std::string> monitorOptions{
"Include",
"Exclude",
"Separate"};
110 std::map<std::string, std::string> monitorOptionsAliases;
111 monitorOptionsAliases[
"1"] =
"Separate";
112 monitorOptionsAliases[
"0"] =
"Exclude";
114 std::make_shared<Kernel::StringListValidator>(monitorOptions, monitorOptionsAliases),
115 "Option to control the loading of monitors.\n"
116 "Allowed options are Include,Exclude, Separate.\n"
117 "Include:The default is Include option would load monitors with the "
118 "workspace if monitors spectra are within the range of loaded "
120 "If the time binning for the monitors is different from the\n"
121 "binning of the detectors this option is equivalent to the Separate "
123 "Exclude:Exclude option excludes monitors from the output workspace.\n"
124 "Separate:Separate option loads monitors into a separate workspace "
125 "called: OutputWorkspace_monitors.\n"
127 "1: Equivalent to Separate.\n"
128 "0: Equivalent to Exclude.\n");
142 bool bincludeMonitors, bseparateMonitors, bexcludeMonitors;
169 spectrum_index.
load();
170 ndets = spectrum_index.
dim0();
175 }
catch (std::runtime_error &) {
186 for (
auto it = entry.
groups().cbegin(); it != entry.
groups().cend(); ++it) {
187 if (it->nxclass ==
"NXmonitor")
201 if (ndets == 0 && nmons == 0) {
202 if (bexcludeMonitors) {
203 g_log.
warning() <<
"Nothing to do. No detectors found and no monitor "
207 g_log.
error() <<
"Invalid NeXus structure, cannot find detector or monitor blocks.";
208 throw std::runtime_error(
"Inconsistent NeXus file structure.");
228 local_workspace->getAxis(0)->unit() = UnitFactory::Instance().create(
"TOF");
229 local_workspace->setYUnit(
"Counts");
232 m_progress->report(
"Loading instrument and run details");
241 else if (bseparateMonitors) {
248 if (!foundInstrument) {
254 local_workspace->loadSampleAndLogInfoNexus(
m_nexusFile.get());
281 wksp_group->setTitle(local_workspace->getTitle());
285 const std::string prop_name =
"OutputWorkspace_";
288 std::ostringstream os;
290 m_progress->report(
"Loading period " + os.str());
292 local_workspace = std::dynamic_pointer_cast<DataObjects::Workspace2D>(
302 wksp_group->addWorkspace(local_workspace);
303 setProperty(prop_name + os.str(), std::static_pointer_cast<Workspace>(local_workspace));
306 setProperty(
"OutputWorkspace", std::dynamic_pointer_cast<Workspace>(wksp_group));
308 setProperty(
"OutputWorkspace", std::dynamic_pointer_cast<Workspace>(local_workspace));
314 if (bseparateMonitors) {
321 auto monitor_workspace = std::dynamic_pointer_cast<DataObjects::Workspace2D>(
337 local_workspace->setMonitorWorkspace(monitor_workspace);
339 ISISRunLogs monLogCreator(monitor_workspace->run());
340 monLogCreator.
addPeriodLogs(1, monitor_workspace->mutableRun());
342 const std::string monitorPropBase =
"MonitorWorkspace";
343 const std::string monitorWsNameBase = wsName +
"_monitors";
346 monitor_group->setTitle(monitor_workspace->getTitle());
349 std::ostringstream os;
351 m_progress->report(
"Loading period " + os.str());
353 monitor_workspace = std::dynamic_pointer_cast<DataObjects::Workspace2D>(
356 monLogCreator.
addPeriodLogs(
static_cast<int>(p), monitor_workspace->mutableRun());
361 auto data_ws = std::static_pointer_cast<API::MatrixWorkspace>(wksp_group->getItem(p - 1));
362 data_ws->setMonitorWorkspace(monitor_workspace);
366 monitor_group->addWorkspace(monitor_workspace);
367 setProperty(monitorPropBase + os.str(), std::static_pointer_cast<Workspace>(monitor_workspace));
372 setProperty(monitorPropBase, std::dynamic_pointer_cast<Workspace>(monitor_group));
377 setProperty(monitorPropBase, std::static_pointer_cast<Workspace>(monitor_workspace));
380 g_log.
information() <<
" no monitors to load for workspace: " << wsName <<
'\n';
396 const Run &run = ws->run();
404 g_log.
warning(
"Workspace has not proton_charge_by_period log");
417 bool range_supplied(
false);
426 if (bexcludeMonitor || bseparateMonitors) {
433 range_supplied =
true;
440 range_supplied =
true;
445 if (spec_min > spec_max) {
446 throw std::invalid_argument(
"Inconsistent range properties. SpectrumMin is "
447 "larger than SpectrumMax.");
451 std::string err =
"Inconsistent range property. SpectrumMax is larger than number of "
454 throw std::invalid_argument(err);
460 std::string err =
"Invalid entry number entered. File contains " +
462 throw std::invalid_argument(err);
470 std::vector<specnum_t> spec_list =
getProperty(
"SpectrumList");
471 auto hasSpecList =
false;
473 if (!spec_list.empty()) {
477 std::sort(spec_list.begin(), spec_list.end());
482 bool isSpectraListTooLarge;
483 bool isSpectraListTooSmall;
486 if (bseparateMonitors) {
489 isSpectraListTooLarge = spec_list.back() > std::max(maxMonBlock, maxLoadBlock);
490 isSpectraListTooSmall = spec_list.front() < std::min(minMonBlock, minLoadBlock);
493 isSpectraListTooLarge = spec_list.back() > maxLoadBlock;
494 isSpectraListTooSmall = spec_list.front() < minLoadBlock;
497 if (isSpectraListTooLarge) {
498 std::string err =
"The specified spectrum list contains a spectrum number which is "
500 "than the largest loadable spectrum number for your selection of "
501 "excluded/included/separate monitors. The largest loadable "
502 "spectrum number is " +
504 throw std::invalid_argument(err);
506 if (isSpectraListTooSmall) {
507 std::string err =
"The specified spectrum list contains a spectrum number which is "
509 "than the smallest loadable spectrum number for your selection of "
510 "excluded/included/separate monitors. The smallest loadable "
511 "spectrum number is " +
513 throw std::invalid_argument(err);
518 if (range_supplied) {
521 auto isInRange = [&spec_min, &spec_max](
specnum_t x) {
return (spec_min <=
x) && (
x <= spec_max); };
523 spec_list.erase(remove_if(spec_list.begin(), spec_list.end(), isInRange), spec_list.end());
526 for (
auto i = spec_min; i < spec_max + 1; ++i) {
527 spec_list.emplace_back(i);
529 std::sort(spec_list.begin(), spec_list.end());
541 if (bexcludeMonitor || bseparateMonitors) {
542 auto newMonitors = getMonitorsFromComposite(composite,
m_monBlockInfo);
548 if (!newMonitors.isEmpty()) {
555 if (bseparateMonitors && composite.
isEmpty()) {
557 bseparateMonitors =
false;
569 if (range_supplied) {
573 new_monitors.
truncate(spec_min, spec_max);
584 throw std::invalid_argument(
"Your spectrum number selection was not valid. "
585 "Make sure that you select spectrum numbers "
586 "and ranges which are compatible with your "
587 "selection of excluded/included/separate monitors. ");
590 return bseparateMonitors;
606 if (range_supplied || hasSpectraList ||
true) {
609 for (; !generator->isDone(); generator->next()) {
610 auto spec_num =
static_cast<specnum_t>(generator->getValue());
624 std::vector<specnum_t> includedMonitors;
627 auto isMonitor = [&monitors](
specnum_t spectrumNumber) {
return monitors.find(spectrumNumber) != monitors.end(); };
628 for (
const auto &dataBlock : dataBlocks) {
629 auto min = dataBlock.getMinSpectrumID();
630 if (isMonitor(min)) {
632 includedMonitors.emplace_back(min);
634 auto max = dataBlock.getMaxSpectrumID();
643 return block1.last < block2.first;
649 auto allMonitorsIncluded = monitors.size() == includedMonitors.size();
650 if (!includedMonitors.empty() && !allMonitorsIncluded) {
651 for (
auto it = monitors.begin(); it != monitors.end();) {
652 if (std::find(includedMonitors.begin(), includedMonitors.end(), it->first) != includedMonitors.end()) {
663 const auto nSpec = std::accumulate(
665 [](
size_t sum,
const auto &spectraBlock) { return sum + spectraBlock.last - spectraBlock.first + 1; });
680 if (block1.first > block1.last && block2.first > block2.last)
681 throw std::runtime_error(
"LoadISISNexus2: inconsistent spectra ranges");
682 if (block1.last >= block2.first) {
683 throw std::runtime_error(
"LoadISISNexus2: the range of SpectraBlocks must not overlap");
698 bool update_spectra2det_mapping) {
699 int64_t hist_index = 0;
700 int64_t period_index(period - 1);
703 if (spectraBlock.isMonitor) {
707 mondata.
load(1,
static_cast<int>(period - 1));
710 local_workspace->setHistogram(hist_index, BinEdges(timeBins(), timeBins() + timeBins.
dim0()),
713 if (update_spectra2det_mapping) {
714 auto &spec = local_workspace->getSpectrum(hist_index);
717 spec.setSpectrumNo(specNum);
725 const int *
const spec_begin =
m_spec.data();
729 const int64_t blocksize = 8;
730 const int64_t rangesize = spectraBlock.last - spectraBlock.first + 1;
731 const int64_t fullblocks = rangesize / blocksize;
732 int64_t spectra_no = spectraBlock.first;
736 int64_t filestart = std::lower_bound(spec_begin,
m_spec_end, spectra_no) - spec_begin;
737 if (fullblocks > 0) {
738 for (int64_t i = 0; i < fullblocks; ++i) {
739 loadBlock(data, blocksize, period_index, filestart, hist_index, spectra_no, local_workspace);
740 filestart += blocksize;
743 int64_t finalblock = rangesize - (fullblocks * blocksize);
744 if (finalblock > 0) {
745 loadBlock(data, finalblock, period_index, filestart, hist_index, spectra_no, local_workspace);
751 const std::string title = entry.
getString(
"title");
752 local_workspace->setTitle(title);
754 local_workspace->mutableRun().addProperty(
"run_title", title,
true);
755 }
catch (std::runtime_error &) {
759 std::string notes =
"";
762 }
catch (std::runtime_error &) {
765 local_workspace->setComment(notes);
774 m_logCreator->addPeriodLogs(
static_cast<int>(period), local_workspace->mutableRun());
790 data.
load(blocksize, period, start);
791 int *data_start = data();
793 int64_t
final(hist + blocksize);
794 while (hist <
final) {
796 local_workspace->setHistogram(hist, BinEdges(
m_tof_data), Counts(data_start, data_end));
800 auto &spec = local_workspace->getSpectrum(hist);
805 spec.setSpectrumNo(specNum);
819 bool executionSuccessful(
true);
825 }
catch (std::invalid_argument &) {
827 executionSuccessful =
false;
828 }
catch (std::runtime_error &) {
829 g_log.
information(
"Unable to successfully run LoadInstrument Child Algorithm");
830 executionSuccessful =
false;
832 if (executionSuccessful) {
834 const auto &
pmap = localWorkspace->constInstrumentParameters();
835 if (
pmap.contains(localWorkspace->getInstrument()->getComponentID(),
"det-pos-source")) {
836 std::shared_ptr<Geometry::Parameter> updateDets =
837 pmap.get(localWorkspace->getInstrument()->getComponentID(),
"det-pos-source");
838 std::string
value = updateDets->value<std::string>();
839 if (
value.substr(0, 8) ==
"datafile") {
842 updateInst->setPropertyValue(
"Filename",
m_filename);
843 if (
value ==
"datafile-ignore-phi") {
844 updateInst->setProperty(
"IgnorePhi",
true);
846 "in the data file except for the phi values");
853 updateInst->execute();
866 API::Run &runDetails = local_workspace->mutableRun();
885 g_log.
debug() <<
"Sample geometry - ID: " << local_workspace->mutableSample().getGeometryFlag()
886 <<
", thickness: " << local_workspace->mutableSample().getThickness()
887 <<
", height: " << local_workspace->mutableSample().getHeight()
888 <<
", width: " << local_workspace->mutableSample().getWidth() <<
"\n";
898 alg->setPropertyValue(
"Filename", this->
getProperty(
"Filename"));
901 alg->executeAsChildAlg();
902 }
catch (std::runtime_error &) {
903 g_log.
warning() <<
"Unable to load run logs. There will be no log "
904 <<
"data associated with this workspace\n";
909 ws->populateInstrumentParameters();
943 int64_t ndets, int64_t n_vms_compat_spectra,
944 const std::map<specnum_t, std::string> &monitors,
bool excludeMonitors,
945 bool separateMonitors) {
946 size_t nmons = monitors.size();
952 for (
const auto &monitor : monitors) {
953 auto monID = monitor.first;
955 monTemp.setMinSpectrumID(monID);
956 monTemp.setMaxSpectrumID(monID);
968 separateMonitors =
false;
969 return separateMonitors;
980 static_cast<int>(data.
dim0()) ,
981 data.
dim2() , std::move(monitorSpectra));
993 bool removeMonitors = excludeMonitors || separateMonitors;
1000 if (!removeMonitors) {
1001 g_log.
warning() <<
" Performing separate loading as can not load spectra "
1002 "and monitors in the single workspace:\n";
1012 separateMonitors =
true;
1013 removeMonitors =
true;
1023 if (!removeMonitors) {
1030 if (separateMonitors)
1034 if ((totNumOfSpectra !=
static_cast<size_t>(n_vms_compat_spectra)) ||
1035 (spectraID_max - spectraID_min + 1 !=
static_cast<int64_t
>(n_vms_compat_spectra))) {
1043 throw std::runtime_error(
"LoadISISNexus: There seems to be an "
1044 "inconsistency in the spectrum numbers.");
1048 return separateMonitors;
1059 auto hasMultipleTimeRegimes(
false);
1063 hasMultipleTimeRegimes = dae.
containsGroup(
"time_channels_3");
1066 return hasMultipleTimeRegimes;
double value
The value of the point.
std::map< DeltaEMode::Type, std::string > index
#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.
@ Load
allowed here which will be passed to the algorithm
Defines a class to aid in creating ISIS specific run logs for periods, status etc.
void addPeriodLogs(const int period, API::Run &exptRun)
Adds period related logs.
bool hasProperty(const std::string &name) const
Does the property exist on the object.
void addProperty(Kernel::Property *prop, bool overwrite=false)
Add data to the object in the form of a property.
This class stores information regarding an experimental run as a series of log entries.
A minimal class to hold the mapping between the spectrum number and its related detector ID numbers f...
const std::set< detid_t > & getDetectorIDsForSpectrumNo(const specnum_t spectrumNo) const
Class to hold a set of workspaces.
A property class for workspaces.
DataBlockComposite: The DataBlockComposite handles a collection of DataBlocks.
specnum_t getMinSpectrumID() const override
void truncate(specnum_t specMin, specnum_t specMax)
std::vector< specnum_t > getAllSpectrumNumbers()
Provides a container with all spectrum numbers.
size_t getNumberOfSpectra() const override
std::unique_ptr< DataBlockGenerator > getGenerator() const override
size_t getNumberOfChannels() const override
size_t getNumberOfPeriods() const override
std::vector< DataBlock > getDataBlocks()
specnum_t getMaxSpectrumID() const override
void addDataBlock(const DataBlock &dataBlock)
void removeSpectra(DataBlockComposite &toRemove)
Removes the input data blocks from the current list of data blocks.
DataBlock: The DataBlock class holds information about a contiguous block of spectrum numbers.
static bool runLoadIDFFromNexus(const std::string &nexusfilename, T localWorkspace, const std::string &top_entry_name, Algorithm *alg)
Load instrument for Nexus file.
int64_t m_entrynumber
The number of the input entry.
std::string m_filename
The name and path of the input file.
DataBlockComposite m_monBlockInfo
void buildSpectraInd2SpectraNumMap(bool range_supplied, bool hasSpectraList, const DataBlockComposite &dataBlockComposite)
Build the list of spectra to load and include into spectra-detectors map.
const specnum_t * m_spec_end
Pointer to one-past-the-end of spectrum number array (m_spec)
void createPeriodLogs(int64_t period, DataObjects::Workspace2D_sptr &local_workspace)
Creates period log data in the workspace.
std::map< int64_t, specnum_t > m_wsInd2specNum_map
map of workspace Index to spectra Number (spectraID)
int confidence(Nexus::NexusDescriptor &descriptor) const override
Returns a confidence value that this algorithm can load a file.
void loadLogs(DataObjects::Workspace2D_sptr &ws)
Load log data from the nexus file.
void exec() override
Overwrites Algorithm method.
bool findSpectraDetRangeInFile(const Nexus::NXEntry &entry, std::vector< specnum_t > &spectrum_index, int64_t ndets, int64_t n_vms_compat_spectra, const std::map< specnum_t, std::string > &monitors, bool excludeMonitors, bool separateMonitors)
Method takes input parameters which describe monitor loading and analyze them against spectra/monitor...
void checkOverlappingSpectraRange()
Check if any of the spectra block ranges overlap.
std::map< specnum_t, std::string > m_monitors
Monitors, map spectrum index to monitor group name.
bool isMultipleTimeRegimeFile(const Nexus::NXEntry &entry) const
Check if is the file is a multiple time regime file.
bool m_have_detector
Is there a detector block.
boost::scoped_ptr< API::ISISRunLogs > m_logCreator
A pointer to the ISISRunLogs creator.
std::shared_ptr< API::Progress > m_progress
Progress reporting object.
void validateMultiPeriodLogs(const Mantid::API::MatrixWorkspace_sptr &)
Check for a set of synthetic logs associated with multi-period log data.
std::string m_instrument_name
The instrument name from Nexus.
std::shared_ptr< HistogramData::HistogramX > m_tof_data
Time channels.
void loadSampleData(DataObjects::Workspace2D_sptr &, const Mantid::Nexus::NXEntry &entry)
Load in details about the sample.
void loadRunDetails(DataObjects::Workspace2D_sptr &local_workspace, Mantid::Nexus::NXEntry &entry)
Load in details about the run.
LoadISISNexus2()
Default constructor.
DataBlockComposite m_detBlockInfo
void loadPeriodData(int64_t period, Mantid::Nexus::NXEntry &entry, DataObjects::Workspace2D_sptr &local_workspace, bool update_spectra2det_mapping=false)
Load a given period into the workspace.
std::vector< specnum_t > m_spec
Spectra numbers.
void runLoadInstrument(DataObjects::Workspace2D_sptr &)
Run LoadInstrument as a ChildAlgorithm.
void loadBlock(Nexus::NXInt &data, int64_t blocksize, int64_t period, int64_t start, int64_t &hist, int64_t &spec_num, DataObjects::Workspace2D_sptr &local_workspace)
Perform a call to nxgetslab, via the NexusClasses wrapped methods for a given block-size.
boost::scoped_ptr< Nexus::File > m_nexusFile
DataBlockComposite m_loadBlockInfo
API::SpectrumDetectorMapping m_spec2det_map
spectra Number to detector ID (multi)map
static double dblSqrt(double in)
Personal wrapper for sqrt to allow msvs to compile.
size_t prepareSpectraBlocks(std::map< specnum_t, std::string > &monitors, DataBlockComposite &LoadBlock)
Prepare a vector of SpectraBlock structures to simplify loading.
bool checkOptionalProperties(bool bseparateMonitors, bool bexcludeMonitor)
Check the validity of the optional properties of the algorithm and identify if partial data should be...
std::vector< SpectraBlock > m_spectraBlocks
List of disjoint data blocks to load.
bool m_load_selected_spectra
if true, a spectra list or range of spectra is supplied
void init() override
Overwrites Algorithm method.
static void ProcessLoadMonitorOptions(bool &bincludeMonitors, bool &bseparateMonitors, bool &bexcludeMonitors, const API::Algorithm *pAlgo)
The method to interpret LoadMonitors property options and convert then into boolean values.
Support for a property that holds an array of values.
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.
void information(const std::string &msg)
Logs at information level.
OptionalBool : Tri-state bool.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
The base class for a Nexus class (group).
std::string getString(const std::string &name) const
Returns a string.
bool containsGroup(const std::string &query) const
Returns whether an individual group (or group) is present.
NXFloat openNXFloat(const std::string &name) const
Creates and opens a float dataset.
std::vector< NXClassInfo > & groups() const
Returns a list of all classes (or groups) in this NXClass.
NXClass openNXGroup(const std::string &name) const
Creates and opens an arbitrary (non-standard) class (group).
NXInt openNXInt(const std::string &name) const
Creates and opens an integer dataset.
Templated class implementation of NXDataSet.
void load()
Read all of the datablock in.
container_T< T > & vecBuffer()
Returns a the internal buffer.
dimsize_t dim0() const
Returns the number of elements along the first dimension.
dimsize_t dim2() const
Returns the number of elements along the third dimension.
void open()
Opens the data set. Does not read in any data. Call load(...) to load the data.
Implements NXdata Nexus class.
NXInt openIntData()
Opens data of int type.
Implements NXentry Nexus class.
NXData openNXData(const std::string &name) const
Opens a NXData.
NexusAddress const & address() const
Returns the absolute address to the object.
std::shared_ptr< File > m_fileID
Nexus file id.
Implements NXroot Nexus class.
NXEntry openEntry(const std::string &name)
Opens an entry – a topmost Nexus class.
bool isEntry(const std::string &entryName, const std::string &groupClass) const noexcept
Checks if a full-address entry exists for a particular groupClass in a Nexus dataset.
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 loadSampleGeometry(API::Sample &sample, const Nexus::NXEntry &entry, const bool hasVMSBlock)
Load geometrical data about the sample from the nexus entry into a workspace.
int64_t findNumberOfSpectra(const Nexus::NXEntry &entry, const bool hasVMSBlock)
find the number of spectra in the nexus file
std::shared_ptr< HistogramData::HistogramX > loadTimeData(const Nexus::NXEntry &entry)
Load the time data from nexus entry.
std::tuple< Nexus::NXInt, Nexus::NXInt > findDetectorIDsAndSpectrumNumber(const Nexus::NXEntry &entry, const bool hasVMSBlock)
find detector ids and spectrum numbers
void loadRunDetails(API::Run &runDetails, const Nexus::NXEntry &entry, const bool hasVMSBlock)
Load data about the run.
void DLLExport populateDataBlockCompositeWithContainer(DataBlockComposite &dataBlockComposite, T &indexContainer, int64_t nArray, size_t numberOfPeriods, size_t numberOfChannels, std::vector< specnum_t > monitorSpectra)
Populates a DataBlockComposite with DataBlocks which are extracted from a indexable collection (array...
std::shared_ptr< Workspace2D > Workspace2D_sptr
shared pointer to Mantid::DataObjects::Workspace2D
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.
constexpr int EMPTY_INT() noexcept
Returns what we consider an "empty" integer within a property.
int32_t specnum_t
Typedef for a spectrum Number.
Generate a tableworkspace to store the calibration results.
std::string to_string(const wide_integer< Bits, Signed > &n)
Spectra block descriptor.
@ Output
An output workspace.